diff options
author | weili <weili@chromium.org> | 2016-07-21 14:44:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-21 14:44:17 -0700 |
commit | c38cd6eb274429a5755e04d2e22a606375851717 (patch) | |
tree | 158c1e58b7d66a715cd7ba1459c55d329f08c49d /core/fxge/skia | |
parent | 1d3348ce0092d6d2a40de5f8433c0d0c16a1e12e (diff) | |
download | pdfium-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/skia')
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 55fe580086..5f874e5ffb 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; } |