summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics/cfx_graphics.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-09 10:33:10 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-09 10:33:10 -0700
commit16fccc51456dbab7e392c3952cc367723f9694f6 (patch)
tree0bd44bec6b81213db9d1dc487237164cdcaa43a4 /xfa/fxgraphics/cfx_graphics.cpp
parentaf7ab33c73f58f18d0db0c90d93fa0aab0bc83f3 (diff)
downloadpdfium-16fccc51456dbab7e392c3952cc367723f9694f6.tar.xz
Use smart pointers for class owned pointers
For classes under xfa/fxfa/fm2js, and xfa/fxgraphics, use smart pointers instead of raw pointer to make memory management easier. Also fix some styling issues along the changes. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2222203002
Diffstat (limited to 'xfa/fxgraphics/cfx_graphics.cpp')
-rw-r--r--xfa/fxgraphics/cfx_graphics.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp
index 90225d4e19..0e18d65e2d 100644
--- a/xfa/fxgraphics/cfx_graphics.cpp
+++ b/xfa/fxgraphics/cfx_graphics.cpp
@@ -567,9 +567,7 @@ const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = {
} // namespace
CFX_Graphics::CFX_Graphics()
- : m_type(FX_CONTEXT_None),
- m_renderDevice(nullptr),
- m_aggGraphics(nullptr) {}
+ : m_type(FX_CONTEXT_None), m_renderDevice(nullptr) {}
FWL_Error CFX_Graphics::Create(CFX_RenderDevice* renderDevice,
FX_BOOL isAntialiasing) {
@@ -596,13 +594,11 @@ FWL_Error CFX_Graphics::Create(int32_t width,
m_type = FX_CONTEXT_Device;
m_info.isAntialiasing = isAntialiasing;
- m_aggGraphics = new CAGG_Graphics;
+ m_aggGraphics.reset(new CAGG_Graphics);
return m_aggGraphics->Create(this, width, height, format);
}
-CFX_Graphics::~CFX_Graphics() {
- delete m_aggGraphics;
-}
+CFX_Graphics::~CFX_Graphics() {}
FWL_Error CFX_Graphics::GetDeviceCap(const int32_t capID,
FX_DeviceCap& capVal) {