From ec17c60f5af36e4075cbe926b8ed8ddf8a42306f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 7 Dec 2005 10:50:01 +0000 Subject: [PATCH] Added a TODO why our bitmap code is currently pretty inefficient. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15390 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Bitmap.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/Bitmap.cpp b/src/kits/interface/Bitmap.cpp index 0a05f177b4..dbd9c6ff79 100644 --- a/src/kits/interface/Bitmap.cpp +++ b/src/kits/interface/Bitmap.cpp @@ -2244,16 +2244,11 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags, link.Attach(bytesPerRow); link.Attach(screenID.id); - // Reply Code: SERVER_TRUE // Reply Data: // 1) int32 server token // 2) area_id id of the area in which the bitmap data resides // 3) int32 area pointer offset used to calculate fBasePtr - // alternatively, if something went wrong - // Reply Code: SERVER_FALSE - // Reply Data: - // None error = B_ERROR; if (link.FlushWithReply(error) == B_OK && error == B_OK) { // server side success @@ -2266,6 +2261,8 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags, link.Read(&areaOffset); // Get the area in which the data resides +// TODO: the actual cloning doesn't have to happen before someone calls Bits() +// that would make bitmap creation a lot cheaper and faster... fArea = clone_area("shared bitmap area", (void**)&fBasePtr, B_ANY_ADDRESS, @@ -2274,7 +2271,7 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags, if (fArea >= B_OK) { // Jump to the location in the area fBasePtr = (int8*)fBasePtr + areaOffset; - + fSize = size; fColorSpace = colorSpace; fBounds = bounds;