22#include <kiwano/core/Time.h>
23#include <kiwano/render/Brush.h>
24#include <kiwano/render/Shape.h>
25#include <kiwano/render/Layer.h>
26#include <kiwano/render/TextLayout.h>
27#include <kiwano/render/Texture.h>
72 virtual void BeginDraw();
76 virtual void EndDraw();
90 const Rect* dest_rect =
nullptr) = 0;
125 virtual void DrawCircle(
const Point& center,
float radius);
153 virtual void FillCircle(
const Point& center,
float radius);
194 virtual float GetBrushOpacity()
const;
202 virtual const Matrix3x2& GetGlobalTransform()
const;
206 virtual void SetBrushOpacity(
float opacity);
242 virtual void SetGlobalTransform(
const Matrix3x2& matrix);
246 virtual void SetGlobalTransform(
const Matrix3x2* matrix);
266 void SetCollectingStatus(
bool enable);
270 const Status& GetStatus()
const;
277 void IncreasePrimitivesCount(uint32_t increase = 1)
const;
281 bool fast_global_transform_;
282 mutable bool collecting_status_;
283 float brush_opacity_;
294inline RenderContext::Status::Status()
含有本地指针的对象
Definition: NativeObject.hpp:32
引用计数智能指针
Definition: RefBasePtr.hpp:35
渲染上下文
Definition: RenderContext.h:62
virtual void FillShape(const Shape &shape)=0
填充形状
virtual void SetTransform(const Matrix3x2 &matrix)=0
设置上下文的二维变换
virtual void DrawTexture(const Texture &texture, const Rect *src_rect=nullptr, const Rect *dest_rect=nullptr)=0
绘制纹理
virtual void FillRectangle(const Rect &rect)=0
填充矩形
virtual void DrawShape(const Shape &shape)=0
绘制形状轮廓
virtual RefPtr< Texture > GetTarget() const =0
获取渲染目标
virtual void FillEllipse(const Point ¢er, const Vec2 &radius)=0
填充椭圆
virtual void Resize(const Size &size)=0
重设渲染上下文大小
virtual void PopLayer()=0
取消上一次设置的图层区域
virtual void DrawEllipse(const Point ¢er, const Vec2 &radius)=0
绘制椭圆边框
virtual void DrawRoundedRectangle(const Rect &rect, const Vec2 &radius)=0
绘制圆角矩形边框
virtual void PushClipRect(const Rect &clip_rect)=0
设置绘制的裁剪区域
virtual void Clear()=0
清空渲染内容
virtual void DrawRectangle(const Rect &rect)=0
绘制矩形边框
virtual Size GetSize() const =0
获取渲染区域大小
virtual void PushLayer(Layer &layer)=0
设置图层区域
virtual void DrawLine(const Point &point1, const Point &point2)=0
绘制线段
virtual bool CheckVisibility(const Rect &bounds, const Matrix3x2 &transform)=0
检查边界是否在视区内
virtual void SetBlendMode(BlendMode blend)=0
设置混合模式
virtual void SetAntialiasMode(bool enabled)=0
设置抗锯齿模式
virtual void Clear(const Color &clear_color)=0
使用纯色清空渲染内容
virtual void SetTextAntialiasMode(TextAntialiasMode mode)=0
设置文字抗锯齿模式
const Status & GetStatus() const
获取渲染上下文状态
Definition: RenderContext.h:299
virtual void PopClipRect()=0
取消上一次设置的绘制裁剪区域
virtual void DrawTextLayout(const TextLayout &layout, const Point &offset, RefPtr< Brush > outline_brush)=0
绘制文本布局
virtual void FillRoundedRectangle(const Rect &rect, const Vec2 &radius)=0
填充圆角矩形
virtual void CreateTexture(Texture &texture, const PixelSize &size)=0
创建空纹理
文本布局
Definition: TextLayout.h:37
纹理
Definition: Texture.h:64
TextAntialiasMode
文字抗锯齿模式
Definition: RenderContext.h:40
BlendMode
混合模式
Definition: RenderContext.h:50
时间段
Definition: Duration.h:48
渲染上下文状态
Definition: RenderContext.h:256
Duration duration
渲染时长
Definition: RenderContext.h:259
uint32_t primitives
渲染图元数量
Definition: RenderContext.h:257
Time start
渲染起始时间
Definition: RenderContext.h:258