diff options
Diffstat (limited to 'src/gallium/winsys/sw/hgl/bitmap_wrapper.cpp')
-rw-r--r-- | src/gallium/winsys/sw/hgl/bitmap_wrapper.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gallium/winsys/sw/hgl/bitmap_wrapper.cpp b/src/gallium/winsys/sw/hgl/bitmap_wrapper.cpp index 4015a22..ef81edc 100644 --- a/src/gallium/winsys/sw/hgl/bitmap_wrapper.cpp +++ b/src/gallium/winsys/sw/hgl/bitmap_wrapper.cpp @@ -77,10 +77,22 @@ void copy_bitmap_bits(const Bitmap* bitmap, void* data, int32 length) { BBitmap *bb = (BBitmap*)bitmap; - if (bb) { - color_space cs = bb->ColorSpace(); - bb->ImportBits(data, length, bb->BytesPerRow(), 0, cs); - } + + // We assume the data is 1:1 the format of the bitmap + if (bb) + bb->ImportBits(data, length, bb->BytesPerRow(), 0, bb->ColorSpace()); +} + + +void +import_bitmap_bits(const Bitmap* bitmap, void* data, int32 length, + unsigned srcStride, color_space srcColorSpace) +{ + BBitmap *bb = (BBitmap*)bitmap; + + // Import image and adjust image format from source to dest + if (bb) + bb->ImportBits(data, length, srcStride, 0, srcColorSpace); } |