aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 00b118c82..90433201e 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -513,6 +513,7 @@ class SurfaceGDI : public Surface {
void BrushColor(ColourDesired back);
void SetFont(Font &font_);
+ void Clear();
public:
SurfaceGDI();
@@ -578,10 +579,10 @@ SurfaceGDI::SurfaceGDI() :
}
SurfaceGDI::~SurfaceGDI() {
- Release();
+ Clear();
}
-void SurfaceGDI::Release() {
+void SurfaceGDI::Clear() {
if (penOld) {
::SelectObject(hdc, penOld);
::DeleteObject(pen);
@@ -613,6 +614,10 @@ void SurfaceGDI::Release() {
}
}
+void SurfaceGDI::Release() {
+ Clear();
+}
+
bool SurfaceGDI::Initialised() {
return hdc != 0;
}
@@ -1066,6 +1071,7 @@ class SurfaceD2D : public Surface {
float dpiScaleX;
float dpiScaleY;
+ void Clear();
void SetFont(Font &font_);
public:
@@ -1147,10 +1153,10 @@ SurfaceD2D::SurfaceD2D() :
}
SurfaceD2D::~SurfaceD2D() {
- Release();
+ Clear();
}
-void SurfaceD2D::Release() {
+void SurfaceD2D::Clear() {
if (pBrush) {
pBrush->Release();
pBrush = 0;
@@ -1167,6 +1173,10 @@ void SurfaceD2D::Release() {
}
}
+void SurfaceD2D::Release() {
+ Clear();
+}
+
void SurfaceD2D::SetScale() {
HDC hdcMeasure = ::CreateCompatibleDC(NULL);
logPixelsY = ::GetDeviceCaps(hdcMeasure, LOGPIXELSY);