29#ifndef Pt_Gfx_PaintContext_h
30#define Pt_Gfx_PaintContext_h
32#include <Pt/Gfx/Api.h>
33#include <Pt/Gfx/ImageFormat.h>
34#include <Pt/Gfx/Rect.h>
35#include <Pt/Gfx/Scaling.h>
36#include <Pt/NonCopyable.h>
62 friend class PainterBase;
63 friend class PaintSurface;
84 const Gfx::SizeF&
size()
const;
120 PaintSurface* surface();
122 void attachPainter(PainterBase& painter);
124 void detachPainter(PainterBase& painter);
127 PaintSurface* _surface;
128 PainterBase* _painter;
Backend that executes drawing commands.
Definition Canvas.h:66
Canvas * getCanvas(Canvas *canvas)
Returns a canvas for backend drawing.
PaintContext(PaintSurface &surface)
Constructs a context using the paint surface.
void setClip(const RectF &clip)
Sets the default clip rect for painters on this context.
PaintContext(PaintSurface &surface, const RectF &clip)
Constructs a context using the paint surface and an initial clip rect.
const RectF * clip() const
Returns the default clip rect or null if clipping is disabled.
void finish()
Finishes painting on the surface.
virtual ~PaintContext()
Destructor.
const Gfx::ImageFormat & format() const
Returns the image format.
const Scaling & scaling() const
Returns the scaling from logical to physical pixels.
void resetClip()
Resets the default clip rect.
const Gfx::SizeF & size() const
Returns the size in physical pixels.
virtual void onDetachSurface(PaintSurface &surface)
Handles detachment from the surface.
void sync()
Synchronizes pending drawing operations.
Target for drawing operations.
Definition PaintSurface.h:66
Drawing commands and paint state.
Definition PainterBase.h:85
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