1 #ifndef _GRAPHICS_CONTEXT_H
2 #define _GRAPHICS_CONTEXT_H
9 class GraphicsContext
{
15 inline const Region
& ClipRegion();
16 inline void SetClipRegion(const Region
&);
17 inline void SetRenderer(Renderer
*);
18 inline Renderer
* GetRenderer();
19 inline void SetOrigin(int x
, int y
);
21 void DrawLine(int, int, int, int);
22 void FillRect(int, int, int, int);
23 void Blit(int x
, int y
, color888 image
[], int image_width
,
24 int image_height
, int imageStrideWidth
);
25 void StretchBlit(Rect imageRect
, Rect screenRect
, color888 image
[],
26 int imageStrideWidth
);
27 void CopyRect(Rect src
, Rect dest
, const Region
&inCleanRegion
,
28 Region
&outNotCopied
);
30 void SetColor(color888 color
);
31 void DrawString(int x
, int y
, const char *string
);
37 color888 fCurrentColor
;
43 inline const Region
& GraphicsContext::ClipRegion()
48 inline void GraphicsContext::SetClipRegion(const Region
®ion
)
51 fClipRegion
.ConstrainTo(fRenderer
->Bounds());
54 inline void GraphicsContext::SetRenderer(Renderer
*renderer
)
59 inline Renderer
* GraphicsContext::GetRenderer()
64 inline void GraphicsContext::SetOrigin(int x
, int y
)
70 inline void GraphicsContext::SetColor(color888 color
)
72 fCurrentColor
= color
;