Kaydet (Commit) 3f9acb7f authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Nah, I don't need a getOffset(), but I do need a getBufferSize()

To properly handle subsetted BitmapDevices in the iOS vcl backend I
seem to need to know what the size of the full BitmapDevice is.

I wasted at least one day on desperate hacking and debugging, trying
to wrap my head around a misunderstanding of what a subsetted
BitmapDevice is. I thought it involved coordinate offsetting...

Change-Id: I83bf1a7d75ce192aaf21f1e408008e362fd6c6e6
üst b7bae354
......@@ -79,7 +79,7 @@ class BASEBMP_DLLPUBLIC BitmapDevice : public boost::enable_shared_from_this<Bit
private boost::noncopyable
{
public:
/** Query size of device in pixel
/** Query size of device in pixel columns (X) and rows (Y, "scanlines")
*/
basegfx::B2IVector getSize() const;
......@@ -92,12 +92,12 @@ public:
*/
bool isTopDown() const;
/** Query the offset from the start of the memory buffer
/** Query the size of the whole frame buffer
@ return the offset, which is (0,0) unless this is a subset
device.
@ return the size of the whole frame buffer, the same as
getSize() unless this is a "subset" device.
*/
basegfx::B2IVector getOffset() const;
basegfx::B2IVector getBufferSize() const;
/** Query type of scanline memory format
*/
......@@ -552,6 +552,7 @@ public:
protected:
BASEBMP_DLLPRIVATE BitmapDevice( const basegfx::B2IBox& rBounds,
const basegfx::B2IVector& rBufferSize,
sal_Int32 nScanlineFormat,
sal_Int32 nScanlineStride,
sal_uInt8* pFirstScanline,
......@@ -688,10 +689,16 @@ BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC createBitmapDevice( const basegfx::B2IVe
/** Function to retrieve a subsetted BitmapDevice to the same
memory.
Note that there is no coordinate system translation or offsetting
involved.
This method creates a second bitmap device instance, which renders
to the same memory as the original, but to a limited, rectangular
area. Useful to implement rectangular clips (usually faster than
setting up a 1bpp clip mask).
to the same memory as the original, with the same pixel coordinate
pairs refering to the same pixels in the memory buffer, but with
rendering clipped to a rectangular area. Useful to implement
rectangular clips (usually faster than setting up a 1bpp clip
mask).
*/
BitmapDeviceSharedPtr BASEBMP_DLLPUBLIC subsetBitmapDevice( const BitmapDeviceSharedPtr& rProto,
const basegfx::B2IBox& rSubset );
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment