PaintSurface Class Referenceabstract

#include <Pt/Gfx/PaintSurface.h>

Target for drawing operations. More...

Inherits NonCopyable.

Inherited by PaintSurface, and Bitmap.

Public Member Functions

virtual ~PaintSurface ()
 Destructor.
const Gfx::ImageFormatformat () const
 Returns the image format.
const Gfx::SizeF & size () const
 Returns the size in physical pixels.
const Scalingscaling () const
 Returns the scaling from logical to physical pixels.
Canvas * getCanvas (Canvas *canvas)
 Returns a canvas for backend drawing.
void sync ()
 Synchronizes pending operations to the surface.
void finish ()
 Finishes painting to the surface.

Protected Member Functions

 PaintSurface ()
 Default constructor.
void invalidate ()
 Invalidates the currently active paint canvas.
virtual const Gfx::ImageFormatonGetFormat () const =0
 Returns the image format.
virtual const Gfx::SizeF & onGetSize () const =0
 Returns the size in physical pixel.
virtual const ScalingonGetScaling () const =0
 Returns the scaling fro logical to physical pixels.
virtual Gfx::CanvasonGetCanvas (Gfx::Canvas *reuse)
 Returns a reusable canvas instance.
virtual Gfx::CanvasonCreateCanvas (Gfx::Canvas *reuse)=0
 Creates a Canvas.
virtual void onReleaseCanvas ()=0
 Releases the current Canvas.
virtual void onSync ()=0
 Synchronizes pending operations to the surface.
virtual void onFinish ()=0
 Finishes painting to the surface.

Detailed Description

PaintSurface is the abstract render target a Painter paints on. It reports the pixel format(), the physical size(), and the scaling() from logical units to device pixels. A backend creates a Canvas while painting is active. Ordinary callers do not call getCanvas().

Bitmap is the in-memory surface in this module. Forms provides surfaces for windows and controls. The surface does not own the painter or the context attached to it. It must outlive both.

This type is not constructed by application code. Construct a Bitmap, or receive a surface from the host that owns the display.