From 1c3680d3027c9ee80ae2fb221e5381b328f79845 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 28 Dec 2010 22:08:46 +0000 Subject: [PATCH] Allow creating a BitmapDrawingEngine with a specific colorspace. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40000 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/BitmapDrawingEngine.cpp | 5 +++-- src/servers/app/BitmapDrawingEngine.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/servers/app/BitmapDrawingEngine.cpp b/src/servers/app/BitmapDrawingEngine.cpp index a14b268810..3c360b143b 100644 --- a/src/servers/app/BitmapDrawingEngine.cpp +++ b/src/servers/app/BitmapDrawingEngine.cpp @@ -4,8 +4,9 @@ #include -BitmapDrawingEngine::BitmapDrawingEngine() +BitmapDrawingEngine::BitmapDrawingEngine(color_space colorSpace) : DrawingEngine(), + fColorSpace(colorSpace), fHWInterface(NULL), fBitmap(NULL) { @@ -62,7 +63,7 @@ BitmapDrawingEngine::SetSize(int32 newWidth, int32 newHeight) return B_OK; fBitmap = new(std::nothrow) UtilityBitmap(BRect(0, 0, newWidth - 1, - newHeight - 1), B_RGB32, 0); + newHeight - 1), fColorSpace, 0); if (fBitmap == NULL) return B_NO_MEMORY; diff --git a/src/servers/app/BitmapDrawingEngine.h b/src/servers/app/BitmapDrawingEngine.h index f81fa3597b..11e5b814bd 100644 --- a/src/servers/app/BitmapDrawingEngine.h +++ b/src/servers/app/BitmapDrawingEngine.h @@ -9,7 +9,8 @@ class UtilityBitmap; class BitmapDrawingEngine : public DrawingEngine { public: - BitmapDrawingEngine(); + BitmapDrawingEngine( + color_space colorSpace = B_RGB32); virtual ~BitmapDrawingEngine(); #if DEBUG @@ -22,6 +23,7 @@ virtual ~BitmapDrawingEngine(); color_space space); private: + color_space fColorSpace; BitmapHWInterface* fHWInterface; UtilityBitmap* fBitmap; BRegion fClipping;