Author: mmlr Date: 2010-12-28 23:17:28 +0100 (Tue, 28 Dec 2010) New Revision: 40003 Changeset: http://dev.haiku-os.org/changeset/40003 Modified: haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.cpp haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.h Log: Add way to add a "minimal" bitmap without colorspace/flags for adding multiple similar bitmaps. Modified: haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.cpp 2010-12-28 22:12:13 UTC (rev 40002) +++ haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.cpp 2010-12-28 22:17:28 UTC (rev 40003) @@ -58,14 +58,17 @@ #ifndef CLIENT_COMPILE void -RemoteMessage::AddBitmap(const ServerBitmap& bitmap) +RemoteMessage::AddBitmap(const ServerBitmap& bitmap, bool minimal) { Add(bitmap.Width()); Add(bitmap.Height()); Add(bitmap.BytesPerRow()); - Add(bitmap.ColorSpace()); - Add(bitmap.Flags()); + if (!minimal) { + Add(bitmap.ColorSpace()); + Add(bitmap.Flags()); + } + uint32 bitsLength = bitmap.BitsLength(); Add(bitsLength); @@ -279,17 +282,21 @@ status_t -RemoteMessage::ReadBitmap(BBitmap** _bitmap) +RemoteMessage::ReadBitmap(BBitmap** _bitmap, bool minimal, + color_space colorSpace, uint32 flags) { - color_space colorSpace; - uint32 bitsLength, flags; + uint32 bitsLength; int32 width, height, bytesPerRow; Read(width); Read(height); Read(bytesPerRow); - Read(colorSpace); - Read(flags); + + if (!minimal) { + Read(colorSpace); + Read(flags); + } + Read(bitsLength); if (bitsLength > fDataLeft) Modified: haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.h =================================================================== --- haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.h 2010-12-28 22:12:13 UTC (rev 40002) +++ haiku/trunk/src/servers/app/drawing/remote/RemoteMessage.h 2010-12-28 22:17:28 UTC (rev 40003) @@ -60,6 +60,7 @@ RP_COPY_RECT_NO_CLIPPING, RP_INVERT_RECT, RP_DRAW_BITMAP, + RP_DRAW_BITMAP_RECTS, RP_STROKE_ARC = 80, RP_STROKE_BEZIER, @@ -145,7 +146,8 @@ void AddGradient(const BGradient& gradient); #ifndef CLIENT_COMPILE - void AddBitmap(const ServerBitmap& bitmap); + void AddBitmap(const ServerBitmap& bitmap, + bool minimal = false); void AddFont(const ServerFont& font); void AddPattern(const Pattern& pattern); void AddDrawState(const DrawState& drawState); @@ -168,7 +170,10 @@ // sets viewstate and returns pattern status_t ReadString(char** _string, size_t& length); - status_t ReadBitmap(BBitmap** _bitmap); + status_t ReadBitmap(BBitmap** _bitmap, + bool minimal = false, + color_space colorSpace = B_RGB32, + uint32 flags = 0); status_t ReadGradient(BGradient** _gradient); status_t ReadArrayLine(BPoint& startPoint, BPoint& endPoint, rgb_color& color);