LibreOffice Module canvas (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vclcanvas::BitmapBackBuffer Class Reference

Backbuffer implementation for canvas bitmap. More...

#include <bitmapbackbuffer.hxx>

Inheritance diagram for vclcanvas::BitmapBackBuffer:
[legend]
Collaboration diagram for vclcanvas::BitmapBackBuffer:
[legend]

Public Member Functions

 BitmapBackBuffer (const BitmapEx &rBitmap, const OutputDevice &rRefDevice)
 Create a backbuffer for given reference device. More...
 
virtual ~BitmapBackBuffer () override
 
virtual OutputDevicegetOutDev () override
 
virtual const OutputDevicegetOutDev () const override
 
void clear ()
 Clear the underlying bitmap to white, all transparent. More...
 
BitmapExgetBitmapReference ()
 Exposing our internal bitmap. More...
 
Size getBitmapSizePixel () const
 
- Public Member Functions inherited from vclcanvas::OutDevProvider
virtual ~OutDevProvider ()
 
virtual OutputDevicegetOutDev ()=0
 
virtual const OutputDevicegetOutDev () const =0
 

Private Member Functions

void createVDev () const
 
void updateVDev () const
 

Private Attributes

::canvas::vcltools::VCLObject< BitmapExmaBitmap
 
VclPtr< VirtualDevicempVDev
 
const OutputDevicemrRefDevice
 
bool mbBitmapContentIsCurrent
 When true, the bitmap contains the last valid content. More...
 
bool mbVDevContentIsCurrent
 When true, and mpVDev is non-NULL, the VDev contains the last valid content. More...
 

Detailed Description

Backbuffer implementation for canvas bitmap.

This class abstracts away the renderable bitmap for the bitmap canvas. The actual VirtualDevice is only created when necessary, which makes read-only bitmaps a lot smaller.

Definition at line 38 of file bitmapbackbuffer.hxx.

Constructor & Destructor Documentation

◆ BitmapBackBuffer()

vclcanvas::BitmapBackBuffer::BitmapBackBuffer ( const BitmapEx rBitmap,
const OutputDevice rRefDevice 
)

Create a backbuffer for given reference device.

Definition at line 31 of file bitmapbackbuffer.cxx.

◆ ~BitmapBackBuffer()

vclcanvas::BitmapBackBuffer::~BitmapBackBuffer ( )
overridevirtual

Member Function Documentation

◆ clear()

void vclcanvas::BitmapBackBuffer::clear ( )

Clear the underlying bitmap to white, all transparent.

Definition at line 64 of file bitmapbackbuffer.cxx.

References COL_TRANSPARENT(), BitmapEx::Erase(), and getBitmapReference().

◆ createVDev()

void vclcanvas::BitmapBackBuffer::createVDev ( ) const
private

◆ getBitmapReference()

BitmapEx & vclcanvas::BitmapBackBuffer::getBitmapReference ( )

Exposing our internal bitmap.

Only to be used from CanvasBitmapHelper

Definition at line 70 of file bitmapbackbuffer.cxx.

References maBitmap, mbBitmapContentIsCurrent, mbVDevContentIsCurrent, and mpVDev.

Referenced by clear().

◆ getBitmapSizePixel()

Size vclcanvas::BitmapBackBuffer::getBitmapSizePixel ( ) const

◆ getOutDev() [1/2]

const OutputDevice & vclcanvas::BitmapBackBuffer::getOutDev ( ) const
overridevirtual

Implements vclcanvas::OutDevProvider.

Definition at line 57 of file bitmapbackbuffer.cxx.

References createVDev(), mpVDev, and updateVDev().

◆ getOutDev() [2/2]

OutputDevice & vclcanvas::BitmapBackBuffer::getOutDev ( )
overridevirtual

Implements vclcanvas::OutDevProvider.

Definition at line 50 of file bitmapbackbuffer.cxx.

References createVDev(), mpVDev, and updateVDev().

◆ updateVDev()

void vclcanvas::BitmapBackBuffer::updateVDev ( ) const
private

Definition at line 126 of file bitmapbackbuffer.cxx.

References maBitmap, mbBitmapContentIsCurrent, mbVDevContentIsCurrent, and mpVDev.

Referenced by getOutDev().

Member Data Documentation

◆ maBitmap

::canvas::vcltools::VCLObject<BitmapEx> vclcanvas::BitmapBackBuffer::maBitmap
private

◆ mbBitmapContentIsCurrent

bool vclcanvas::BitmapBackBuffer::mbBitmapContentIsCurrent
mutableprivate

When true, the bitmap contains the last valid content.

When false, and mbVDevContentIsCurrent is true, the VDev contains the last valid content (which must be copied back to the bitmap, when getBitmapReference() is called). When both are false, this object is just initialized.

Definition at line 78 of file bitmapbackbuffer.hxx.

Referenced by getBitmapReference(), and updateVDev().

◆ mbVDevContentIsCurrent

bool vclcanvas::BitmapBackBuffer::mbVDevContentIsCurrent
mutableprivate

When true, and mpVDev is non-NULL, the VDev contains the last valid content.

When false, and mbBitmapContentIsCurrent is true, the bitmap contains the last valid content. When both are false, this object is just initialized.

Definition at line 86 of file bitmapbackbuffer.hxx.

Referenced by getBitmapReference(), getBitmapSizePixel(), and updateVDev().

◆ mpVDev

VclPtr<VirtualDevice> vclcanvas::BitmapBackBuffer::mpVDev
mutableprivate

◆ mrRefDevice

const OutputDevice& vclcanvas::BitmapBackBuffer::mrRefDevice
private

Definition at line 69 of file bitmapbackbuffer.hxx.

Referenced by createVDev().


The documentation for this class was generated from the following files: