summaryrefslogtreecommitdiff
path: root/core/fxge/ge
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-07-21 14:44:17 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-21 14:44:17 -0700
commitc38cd6eb274429a5755e04d2e22a606375851717 (patch)
tree158c1e58b7d66a715cd7ba1459c55d329f08c49d /core/fxge/ge
parent1d3348ce0092d6d2a40de5f8433c0d0c16a1e12e (diff)
downloadpdfium-c38cd6eb274429a5755e04d2e22a606375851717.tar.xz
Use smart pointers for graphics device classes
Use unique_ptr for class owned member variables. Also clean up some style issues such as removing unused functions and casting to raw pointer. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2163103002
Diffstat (limited to 'core/fxge/ge')
-rw-r--r--core/fxge/ge/fx_ge_device.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp
index 9bb950beed..571f90cfa1 100644
--- a/core/fxge/ge/fx_ge_device.cpp
+++ b/core/fxge/ge/fx_ge_device.cpp
@@ -17,21 +17,13 @@ CFX_RenderDevice::CFX_RenderDevice()
m_Height(0),
m_bpp(0),
m_RenderCaps(0),
- m_DeviceClass(0),
- m_pDeviceDriver(nullptr) {}
+ m_DeviceClass(0) {}
-CFX_RenderDevice::~CFX_RenderDevice() {
- delete m_pDeviceDriver;
-}
-
-void CFX_RenderDevice::Flush() {
- delete m_pDeviceDriver;
- m_pDeviceDriver = nullptr;
-}
+CFX_RenderDevice::~CFX_RenderDevice() {}
-void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) {
- delete m_pDeviceDriver;
- m_pDeviceDriver = pDriver;
+void CFX_RenderDevice::SetDeviceDriver(
+ std::unique_ptr<IFX_RenderDeviceDriver> pDriver) {
+ m_pDeviceDriver = std::move(pDriver);
InitDeviceInfo();
}