From 7a54109e1bd0171ecc441163e0dd16515c95ab02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 26 Mar 2005 16:47:37 +0000 Subject: [PATCH] moved BitmapBuffer, because it comes in handy in app_server git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12040 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../servers/app/painter/BitmapBuffer.cpp | 73 ------------------- src/tests/servers/app/painter/BitmapBuffer.h | 31 -------- 2 files changed, 104 deletions(-) delete mode 100644 src/tests/servers/app/painter/BitmapBuffer.cpp delete mode 100644 src/tests/servers/app/painter/BitmapBuffer.h diff --git a/src/tests/servers/app/painter/BitmapBuffer.cpp b/src/tests/servers/app/painter/BitmapBuffer.cpp deleted file mode 100644 index 25e3103419..0000000000 --- a/src/tests/servers/app/painter/BitmapBuffer.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// BitmapBuffer.h - -#include - -#include "BitmapBuffer.h" - -// constructor -BitmapBuffer::BitmapBuffer(BBitmap* bitmap) - : fBitmap(bitmap) -{ -} - -// destructor -BitmapBuffer::~BitmapBuffer() -{ - delete fBitmap; -} - -// InitCheck -status_t -BitmapBuffer::InitCheck() const -{ - status_t ret = B_NO_INIT; - if (fBitmap) - ret = fBitmap->InitCheck(); - return ret; -} - -// ColorSpace -color_space -BitmapBuffer::ColorSpace() const -{ - if (InitCheck() >= B_OK) - return fBitmap->ColorSpace(); - return B_NO_COLOR_SPACE; -} - -// Bits -void* -BitmapBuffer::Bits() const -{ - if (InitCheck() >= B_OK) - return fBitmap->Bits(); - return NULL; -} - -// BytesPerRow -uint32 -BitmapBuffer::BytesPerRow() const -{ - if (InitCheck() >= B_OK) - return fBitmap->BytesPerRow(); - return 0; -} - -// Width -uint32 -BitmapBuffer::Width() const -{ - if (InitCheck() >= B_OK) - return fBitmap->Bounds().IntegerWidth() + 1; - return 0; -} - -// Height -uint32 -BitmapBuffer::Height() const -{ - if (InitCheck() >= B_OK) - return fBitmap->Bounds().IntegerHeight() + 1; - return 0; -} - diff --git a/src/tests/servers/app/painter/BitmapBuffer.h b/src/tests/servers/app/painter/BitmapBuffer.h deleted file mode 100644 index a90af10bbd..0000000000 --- a/src/tests/servers/app/painter/BitmapBuffer.h +++ /dev/null @@ -1,31 +0,0 @@ -// BitmapBuffer.h - -#ifndef BITMAP_BUFFER_H -#define BITMAP_BUFFER_H - -#include "RenderingBuffer.h" - -class BBitmap; - -class BitmapBuffer : public RenderingBuffer { - public: - BitmapBuffer(BBitmap* bitmap); - virtual ~BitmapBuffer(); - - virtual status_t InitCheck() const; - - virtual color_space ColorSpace() const; - virtual void* Bits() const; - virtual uint32 BytesPerRow() const; - virtual uint32 Width() const; - virtual uint32 Height() const; - - // BitmapBuffer - const BBitmap* Bitmap() const - { return fBitmap; } - private: - - BBitmap* fBitmap; -}; - -#endif // BITMAP_BUFFER_H