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

Unified Diff: core/fxge/skia/fx_skia_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/include/fx_ge.h ('k') | core/fxge/win32/fx_win32_device.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/skia/fx_skia_device.cpp
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 55fe580086ea2e3dca15b9871fe199af5a7e4a90..5f874e5ffb28becd2eca5cb600ebd3b66b1c81bd 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -7,6 +7,7 @@
#include <vector>
#include "core/fxcodec/include/fx_codec.h"
+#include "core/fxcrt/include/fx_memory.h"
#include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h"
#include "core/fpdfapi/fpdf_page/pageint.h"
@@ -1461,8 +1462,7 @@ CFX_FxgeDevice::CFX_FxgeDevice() {
}
SkPictureRecorder* CFX_FxgeDevice::CreateRecorder(int size_x, int size_y) {
- CFX_SkiaDeviceDriver* skDriver = new CFX_SkiaDeviceDriver(size_x, size_y);
- SetDeviceDriver(skDriver);
+ SetDeviceDriver(WrapUnique(new CFX_SkiaDeviceDriver(size_x, size_y)));
return skDriver->GetRecorder();
}
@@ -1473,8 +1473,8 @@ bool CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap,
if (!pBitmap)
return false;
SetBitmap(pBitmap);
- SetDeviceDriver(new CFX_SkiaDeviceDriver(pBitmap, bRgbByteOrder, pOriDevice,
- bGroupKnockout));
+ SetDeviceDriver(WrapUnique(new CFX_SkiaDeviceDriver(
+ pBitmap, bRgbByteOrder, pOriDevice, bGroupKnockout)));
return true;
}
« no previous file with comments | « core/fxge/include/fx_ge.h ('k') | core/fxge/win32/fx_win32_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698