summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_renderdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/cfx_renderdevice.h')
-rw-r--r--core/fxge/cfx_renderdevice.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 4d8b407b35..f33da57cc9 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -9,6 +9,7 @@
#include <memory>
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxge/fx_dib.h"
#include "core/fxge/fx_font.h"
@@ -84,13 +85,11 @@ class CFX_RenderDevice {
public:
class StateRestorer {
public:
- explicit StateRestorer(CFX_RenderDevice* pDevice) : m_pDevice(pDevice) {
- m_pDevice->SaveState();
- }
- ~StateRestorer() { m_pDevice->RestoreState(false); }
+ explicit StateRestorer(CFX_RenderDevice* pDevice);
+ ~StateRestorer();
private:
- CFX_RenderDevice* m_pDevice;
+ CFX_UnownedPtr<CFX_RenderDevice> m_pDevice;
};
CFX_RenderDevice();