10 #include "tb_geometry.h"
12 #include "tb_linklist.h"
16 class TBBitmapFragment;
43 virtual int Width() = 0;
44 virtual int Height() = 0;
49 virtual void SetData(uint32_t *data) = 0;
62 virtual void BeginPaint(
int render_target_w,
int render_target_h) = 0;
63 virtual void EndPaint() = 0;
66 virtual void Translate(
int dx,
int dy) = 0;
70 virtual float GetOpacity() = 0;
152 #endif // TB_RENDERER_H
TBLinkListOf is a double linked linklist.
Definition: tb_linklist.h:122
void InvokeContextLost()
Invoke OnContextLost on all listeners.
Definition: tb_renderer.cpp:12
virtual void DrawBitmap(const TBRect &dst_rect, const TBRect &src_rect, TBBitmapFragment *bitmap_fragment)=0
Draw the src_rect part of the fragment stretched to dst_rect.
void AddListener(TBRendererListener *listener)
Add a listener to this renderer.
Definition: tb_renderer.h:117
virtual void Translate(int dx, int dy)=0
Translate all drawing with the given offset.
virtual void OnContextRestored()=0
Called when the context has been restored again, and new TBBitmaps can be created again...
virtual void FlushBitmapFragment(TBBitmapFragment *bitmap_fragment)=0
Make sure the given bitmap fragment is flushed from any batching, because it may be changed or delete...
virtual void DrawBitmapColored(const TBRect &dst_rect, const TBRect &src_rect, const TBColor &color, TBBitmapFragment *bitmap_fragment)=0
Draw the src_rect part of the fragment stretched to dst_rect.
virtual TBBitmap * CreateBitmap(int width, int height, uint32_t *data)=0
Create a new TBBitmap from the given data (in BGRA32 format).
virtual void BeginBatchHint(BATCH_HINT)
A hint to batching renderers that the following set of draw calls are of the same type so batching mi...
Definition: tb_renderer.h:142
TBRendererListener is a listener for TBRenderer.
Definition: tb_renderer.h:19
virtual TBRect SetClipRect(const TBRect &rect, bool add_to_current)=0
Set a clip rect to the renderer.
TBBitmapFragment represents a sub part of a TBBitmap.
Definition: tb_bitmap_fragment.h:140
virtual TBRect GetClipRect()=0
Get the current clip rect.
TBBitmap is a minimal interface for bitmap to be painted by TBRenderer.
Definition: tb_renderer.h:36
All calls are either DrawBitmap or DrawBitmapColored with the same bitmap fragment.
Definition: tb_renderer.h:134
virtual void SetOpacity(float opacity)=0
Set the current opacity that should apply to all drawing (0.f-1.f).
Simple rectangle class.
Definition: tb_geometry.h:25
virtual ~TBBitmap()
Note: Implementations for batched renderers should call TBRenderer::FlushBitmap to make sure any acti...
Definition: tb_renderer.h:41
virtual void BeginPaint(int render_target_w, int render_target_h)=0
Should be called before invoking paint on any widget.
Definition: tb_linklist.h:83
virtual void EndBatchHint()
End the hint scope started with BeginBatchHint.
Definition: tb_renderer.h:145
TBColor contains a 32bit color.
Definition: tb_color.h:21
virtual void SetData(uint32_t *data)=0
Update the bitmap with the given data (in BGRA32 format).
virtual void DrawBitmapTile(const TBRect &dst_rect, TBBitmap *bitmap)=0
Draw the bitmap tiled into dst_rect.
void RemoveListener(TBRendererListener *listener)
Remove a listener from this renderer.
Definition: tb_renderer.h:120
virtual void DrawBitmapTileColored(const TBRect &dst_rect, const TBColor &color, TBBitmap *bitmap)=0
Draw the bitmap tiled into dst_rect.
BATCH_HINT
Defines the hint given to BeginBatchHint.
Definition: tb_renderer.h:131
virtual void OnContextLost()=0
Called when the context has been lost and all TBBitmaps need to be deleted.
void InvokeContextRestored()
Invoke OnContextRestored on all listeners.
Definition: tb_renderer.cpp:19
TBRenderer is a minimal interface for painting strings and bitmaps.
Definition: tb_renderer.h:54