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

Unified Diff: core/fxge/win32/fx_win32_device.cpp

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/skia/fx_skia_device.cpp ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/win32/fx_win32_device.cpp
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 0b08bba8df679b2112e0593e98e114cae341e964..78abd5da1d2d0aeb12e1c6c03389d9fc21ff0974 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -14,6 +14,7 @@
#include <crtdbg.h>
#include "core/fxcodec/include/fx_codec.h"
+#include "core/fxcrt/include/fx_memory.h"
#ifndef _SKIA_SUPPORT_
#include "core/fxge/agg/fx_agg_driver.h"
@@ -1253,7 +1254,7 @@ FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource,
return SetDIBits(&bitmap, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL);
}
CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
+ CFX_DIBitmap* pBitmap = temp.GetBitmap();
if (!pBitmap)
return FALSE;
return GDI_SetDIBits(pBitmap, pSrcRect, left, top);
@@ -1335,7 +1336,7 @@ FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource,
(CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
if (pPlatform->m_GdiplusExt.IsAvailable() && !pSource->IsCmykImage()) {
CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
+ CFX_DIBitmap* pBitmap = temp.GetBitmap();
if (!pBitmap)
return FALSE;
return pPlatform->m_GdiplusExt.StretchDIBits(
@@ -1346,7 +1347,7 @@ FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource,
dest_width, dest_height, pClipRect, flags);
}
CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
+ CFX_DIBitmap* pBitmap = temp.GetBitmap();
if (!pBitmap)
return FALSE;
return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width,
@@ -1364,7 +1365,7 @@ FX_BOOL CGdiDisplayDriver::StartDIBits(const CFX_DIBSource* pBitmap,
}
CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) {
- SetDeviceDriver(CreateDriver(hDC));
+ SetDeviceDriver(WrapUnique(CreateDriver(hDC)));
}
CFX_WindowsDevice::~CFX_WindowsDevice() {}
@@ -1407,8 +1408,7 @@ CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width,
SetBitmap(pBitmap);
m_hDC = ::CreateCompatibleDC(nullptr);
m_hOldBitmap = (HBITMAP)SelectObject(m_hDC, m_hBitmap);
- IFX_RenderDeviceDriver* pDriver = new CGdiDisplayDriver(m_hDC);
- SetDeviceDriver(pDriver);
+ SetDeviceDriver(WrapUnique(new CGdiDisplayDriver(m_hDC)));
}
CFX_WinBitmapDevice::~CFX_WinBitmapDevice() {
« no previous file with comments | « core/fxge/skia/fx_skia_device.cpp ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698