29 #include YFM_YSLib_UI_YRenderer
30 #include YFM_YSLib_UI_YControl
31 #include YFM_YSLib_Service_YGDI
42 YAssert(&e.GetSender().GetRenderer() ==
this,
"Invalid widget found.");
43 if(
YB_LIKELY(!e.ClipArea.IsUnstrictlyEmpty()))
44 CallEvent<UI::Paint>(
wgt, e);
51 rInvalidated(), pImageBuffer(p ? std::move(p)
57 r.pImageBuffer)), IgnoreBackground(r.IgnoreBackground)
61 BufferedRenderer::RequiresRefresh()
const
69 pImageBuffer = p ? std::move(p) : make_unique<Drawing::CompactPixmap>();
80 BufferedRenderer::CommitInvalidation(
const Rect&
r)
88 YAssert(&e.GetSender().GetRenderer() ==
this,
"Invalid widget found.");
99 const auto&
g(pc.Target);
100 const Rect&
r(pc.ClipArea);
102 CopyTo(
g.GetBufferPtr(), GetContext(),
g.GetSize(), r.GetPoint(),
103 r.GetPoint() - pc.Location, r.GetSize());
108 const PaintContext& pc)
110 if(RequiresRefresh())
119 if(!clip.IsUnstrictlyEmpty())
123 const auto&
g(GetContext());
125 CopyTo(
g.GetBufferPtr(), pc.Target,
g.GetSize(), clip.GetPoint()
126 - pc.Location, clip.GetPoint(), clip.GetSize());
131 CallEvent<UI::Paint>(
wgt, e);
h void SetSize(const Size &) override
重新设置缓冲区大小。
pt pt Y const IWidget &wgt GetLocationOf
auto ClonePolymorphic(const _type &p) -> decltype(&*p)
使用 clone 成员函数复制指定指针指向的多态类类型对象。
YF_API void Invalidate(IWidget &, const Rect &)
无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。
bool IgnoreBackground
指定验证时忽略上层缓冲区背景。
void UpdateTo(const PaintContext &) const
更新至指定图形设备上下文的指定点。
sizeof(AlphaType)*GetAreaOf(GetSize())) using CompactPixmap void SetSize(const Size &) override
重新设置缓冲区大小。
GBinaryGroup< SPos > Point
屏幕二维点(直角坐标表示)。
Rect rInvalidated
无效区域:包含所有新绘制请求的区域(不一定是最小的)。
Rect Validate(IWidget &wgt, IWidget &sender, const PaintContext &)
验证并按需绘制。
BufferedRenderer(bool={}, unique_ptr< Drawing::IImage >={})
构造:指定是否忽略上层缓冲区背景。
unique_ptr< Drawing::IImage > pImageBuffer
显示图像缓冲区指针。
virtual Rect Paint(IWidget &wgt, PaintEventArgs &&)
按参数绘制。
void SetImageBuffer(unique_ptr< Drawing::IImage >)
YF_API bool CopyTo(BitmapPtr, const CompactPixmapEx &, const Size &, const Point &, const Point &, const Size &, Rotation=RDeg0)
位图缓冲区向指针指定的缓冲区复制。
Rect Paint(IWidget &wgt, PaintEventArgs &&) override
按参数绘制。
enable_if_t<!is_array< _type >::value, std::unique_ptr< _type > > make_unique(_tParams &&...args)
使用 new 和指定参数构造指定类型的 std::unique_ptr 实例。
#define YAssert(_expr, _msg)