Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1235)

Unified Diff: core/fxge/include/fx_ge.h

Issue 2163103002: Use smart pointers for graphics device classes (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix all platforms Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxge/include/fx_dib.h ('k') | core/fxge/skia/fx_skia_device.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/include/fx_ge.h
diff --git a/core/fxge/include/fx_ge.h b/core/fxge/include/fx_ge.h
index dbc4fd0a430df06984dd2db2e9f4b0feb6932711..aceaa76a943cf59fe713e33f2f4538bd983a9e96 100644
--- a/core/fxge/include/fx_ge.h
+++ b/core/fxge/include/fx_ge.h
@@ -214,9 +214,11 @@ class CFX_RenderDevice {
CFX_RenderDevice();
virtual ~CFX_RenderDevice();
- void Flush();
- void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver);
- IFX_RenderDeviceDriver* GetDeviceDriver() const { return m_pDeviceDriver; }
+ // Take ownership of |pDriver|.
+ void SetDeviceDriver(std::unique_ptr<IFX_RenderDeviceDriver> pDriver);
+ IFX_RenderDeviceDriver* GetDeviceDriver() const {
+ return m_pDeviceDriver.get();
+ }
FX_BOOL StartRendering();
void EndRendering();
@@ -400,7 +402,7 @@ class CFX_RenderDevice {
int m_RenderCaps;
int m_DeviceClass;
FX_RECT m_ClipBox;
- IFX_RenderDeviceDriver* m_pDeviceDriver;
+ std::unique_ptr<IFX_RenderDeviceDriver> m_pDeviceDriver;
};
class CFX_FxgeDevice : public CFX_RenderDevice {
« no previous file with comments | « core/fxge/include/fx_dib.h ('k') | core/fxge/skia/fx_skia_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698