diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/PlatWin.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 014c09793..18cf7bca7 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -513,6 +513,7 @@ public: XYPOSITION AverageCharWidth(const Font *font_) override; void SetClip(PRectangle rc) override; + void PopClip() override; void FlushCachedState() override; void SetUnicodeMode(bool unicodeMode_) override; @@ -1091,10 +1092,15 @@ XYPOSITION SurfaceGDI::AverageCharWidth(const Font *font_) { } void SurfaceGDI::SetClip(PRectangle rc) { + ::SaveDC(hdc); ::IntersectClipRect(hdc, static_cast<int>(rc.left), static_cast<int>(rc.top), static_cast<int>(rc.right), static_cast<int>(rc.bottom)); } +void SurfaceGDI::PopClip() { + ::RestoreDC(hdc, -1); +} + void SurfaceGDI::FlushCachedState() { pen = {}; brush = {}; @@ -1207,6 +1213,7 @@ public: XYPOSITION AverageCharWidth(const Font *font_) override; void SetClip(PRectangle rc) override; + void PopClip() override; void FlushCachedState() override; void SetUnicodeMode(bool unicodeMode_) override; @@ -2250,6 +2257,14 @@ void SurfaceD2D::SetClip(PRectangle rc) { } } +void SurfaceD2D::PopClip() { + if (pRenderTarget) { + PLATFORM_ASSERT(clipsActive > 0); + pRenderTarget->PopAxisAlignedClip(); + clipsActive--; + } +} + void SurfaceD2D::FlushCachedState() { } |