Fixed layer management in Direct2D renderer.

ID2D1RenderTarget::PushAxisAlignedClip/PopAxisAlignedClip used to clip the region (with wxGraphicsRenderer::Clip) and ID2D1RenderTarget::PushLayer/PopLayer used to rendering to the transparent layer (with wxGraphicsRenderer::BeginLayer) are non independent but have to be used in the controlled sequences: "A PushAxisAlignedClip and PopAxisAlignedClip pair can occur around or within a PushLayer and PopLayer, but cannot overlap" (and of course finally each Push* call must have a matching Pop* call).
To control the sequence of access to the AxisAlignedClips and Layers there is implemented a wxStack data member holding Clips/Layers parameters which reflects a physical stack of respective Clips/Layers in ID2D1RenderTarget. This way we know in which order to pop and what to pop from ID2D1RenderTarget stack if there is a need to do so.

Closes #17590
This commit is contained in:
Artur Wieczorek
2016-07-05 21:21:18 +02:00
parent 6b7ae05e3f
commit 832db47346
3 changed files with 200 additions and 63 deletions

View File

@@ -110,9 +110,9 @@ struct wxFontMetrics
abstract API for drawing on any of them.
wxWidgets offers an alternative drawing API based on the modern drawing
backends GDI+, CoreGraphics and Cairo. See wxGraphicsContext, wxGraphicsRenderer
and related classes. There is also a wxGCDC linking the APIs by offering
the wxDC API on top of a wxGraphicsContext.
backends GDI+, CoreGraphics, Cairo and Direct2D. See wxGraphicsContext,
wxGraphicsRenderer and related classes. There is also a wxGCDC linking
the APIs by offering the wxDC API on top of a wxGraphicsContext.
wxDC is an abstract base class and cannot be created directly.
Use wxPaintDC, wxClientDC, wxWindowDC, wxScreenDC, wxMemoryDC or
@@ -770,10 +770,10 @@ public:
window redraws when only a known area of the screen is damaged.
@remarks
- Calling GetClippingBox() can only make the clipping region smaller,
- Calling this function can only make the clipping region smaller,
never larger.
- You need to call DestroyClippingRegion() if you want to set
- You need to call DestroyClippingRegion() first if you want to set
the clipping region exactly to the region specified.
- If resulting clipping region is empty, then all drawing on the DC is