30#ifndef Pt_Gfx_PaintSurface_h
31#define Pt_Gfx_PaintSurface_h
33#include <Pt/Gfx/Api.h>
34#include <Pt/Gfx/ImageFormat.h>
35#include <Pt/Gfx/Scaling.h>
36#include <Pt/NonCopyable.h>
37#include <Pt/System/Path.h>
67 friend class PainterBase;
68 friend class PaintContext;
87 const Gfx::SizeF&
size()
const;
147 void attachPainter(PainterBase& painter);
151 void detachPainter(PainterBase& painter);
155 void attachContext(PaintContext& context);
159 void detachContext(PaintContext& context);
164 void onDetachCanvas(Canvas& canvas);
168 PainterBase* _painter;
169 PaintContext* _context;
Backend that executes drawing commands.
Definition Canvas.h:66
Active painting session on a surface.
Definition PaintContext.h:61
Canvas * getCanvas(Canvas *canvas)
Returns a canvas for backend drawing.
virtual const Gfx::SizeF & onGetSize() const =0
Returns the size in physical pixel.
virtual Gfx::Canvas * onCreateCanvas(Gfx::Canvas *reuse)=0
Creates a Canvas.
PaintSurface()
Default constructor.
virtual void onReleaseCanvas()=0
Releases the current Canvas.
virtual const Gfx::ImageFormat & onGetFormat() const =0
Returns the image format.
virtual ~PaintSurface()
Destructor.
virtual void onSync()=0
Synchronizes pending operations to the surface.
void finish()
Finishes painting to the surface.
void invalidate()
Invalidates the currently active paint canvas.
const Gfx::ImageFormat & format() const
Returns the image format.
const Scaling & scaling() const
Returns the scaling from logical to physical pixels.
const Gfx::SizeF & size() const
Returns the size in physical pixels.
virtual const Scaling & onGetScaling() const =0
Returns the scaling fro logical to physical pixels.
virtual Gfx::Canvas * onGetCanvas(Gfx::Canvas *reuse)
Returns a reusable canvas instance.
virtual void onFinish()=0
Finishes painting to the surface.
void sync()
Synchronizes pending operations to the surface.
Conversion between logical units and pixels.
Definition Scaling.h:52
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Graphics and imaging services.
Definition Api-Argb32Image.h:12
Core module.
Definition Allocator.h:33