From ee18c3ccff16d9fbd767dca092b4953f9a922785 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 6 Mar 2006 00:18:26 +0000 Subject: [PATCH] Added an extended ImportBits() to ServerBitmap to allow the use of offsets and made ReadBitmap() use it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16593 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/servers/app/ServerBitmap.h | 4 ++++ src/servers/app/ServerBitmap.cpp | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/headers/private/servers/app/ServerBitmap.h b/headers/private/servers/app/ServerBitmap.h index ead88f6420..4c7e375fb4 100644 --- a/headers/private/servers/app/ServerBitmap.h +++ b/headers/private/servers/app/ServerBitmap.h @@ -64,6 +64,10 @@ class ServerBitmap { status_t ImportBits(const void *bits, int32 bitsLength, int32 bytesPerRow, color_space colorSpace); + status_t ImportBits(const void *bits, int32 bitsLength, + int32 bytesPerRow, color_space colorSpace, + BPoint from, BPoint to, int32 width, + int32 height); void PrintToStream(); diff --git a/src/servers/app/ServerBitmap.cpp b/src/servers/app/ServerBitmap.cpp index e0c22bf08e..89e8d9f109 100644 --- a/src/servers/app/ServerBitmap.cpp +++ b/src/servers/app/ServerBitmap.cpp @@ -258,6 +258,19 @@ ServerBitmap::ImportBits(const void *bits, int32 bitsLength, int32 bytesPerRow, } +status_t +ServerBitmap::ImportBits(const void *bits, int32 bitsLength, int32 bytesPerRow, + color_space colorSpace, BPoint from, BPoint to, int32 width, int32 height) +{ + if (!bits || bitsLength < 0 || bytesPerRow <= 0 || width < 0 || height < 0) + return B_BAD_VALUE; + + return BPrivate::ConvertBits(bits, fBuffer, bitsLength, BitsLength(), + bytesPerRow, fBytesPerRow, colorSpace, fSpace, from, to, fWidth, + fHeight); +} + + void ServerBitmap::PrintToStream() {