summaryrefslogtreecommitdiff
path: root/core/fxge/ge/cfx_renderdevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/ge/cfx_renderdevice.cpp')
-rw-r--r--core/fxge/ge/cfx_renderdevice.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp
index f9153d1cdb..4404833758 100644
--- a/core/fxge/ge/cfx_renderdevice.cpp
+++ b/core/fxge/ge/cfx_renderdevice.cpp
@@ -1120,3 +1120,12 @@ bool CFX_RenderDevice::DrawTextPath(int nChars,
}
return true;
}
+
+CFX_RenderDevice::StateRestorer::StateRestorer(CFX_RenderDevice* pDevice)
+ : m_pDevice(pDevice) {
+ m_pDevice->SaveState();
+}
+
+CFX_RenderDevice::StateRestorer::~StateRestorer() {
+ m_pDevice->RestoreState(false);
+}