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

Side by Side Diff: core/src/fxge/skia/fx_skia_device.cpp

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | core/src/fxge/win32/fx_win32_dib.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "../../../include/fxge/fx_ge.h" 5 #include "../../../include/fxge/fx_ge.h"
6 //#define _SKIA_SUPPORT_ 6 //#define _SKIA_SUPPORT_
7 #if defined(_SKIA_SUPPORT_) 7 #if defined(_SKIA_SUPPORT_)
8 #include "../../../include/fxcodec/fx_codec.h" 8 #include "../../../include/fxcodec/fx_codec.h"
9 9
10 10
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 FX_Free(intervals); 234 FX_Free(intervals);
235 } 235 }
236 } 236 }
237 237
238 CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bit s, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout) 238 CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bit s, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
239 { 239 {
240 m_pAggDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrd er, pOriDevice, bGroupKnockout); 240 m_pAggDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrd er, pOriDevice, bGroupKnockout);
241 } 241 }
242 CFX_SkiaDeviceDriver::~CFX_SkiaDeviceDriver() 242 CFX_SkiaDeviceDriver::~CFX_SkiaDeviceDriver()
243 { 243 {
244 » if (m_pAggDriver) delete m_pAggDriver; 244 delete m_pAggDriver;
245 } 245 }
246 FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* p CharPos, CFX_Font* pFont, 246 FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* p CharPos, CFX_Font* pFont,
247 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, F X_FIXFLOAT font_size, FX_DWORD color, 247 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, F X_FIXFLOAT font_size, FX_DWORD color,
248 int alpha_flag, void* pIccTransform) 248 int alpha_flag, void* pIccTransform)
249 { 249 {
250 return m_pAggDriver->DrawDeviceText(nChars, pCharPos, pFont,pCache, pObj ect2Device, font_size, color, 250 return m_pAggDriver->DrawDeviceText(nChars, pCharPos, pFont,pCache, pObj ect2Device, font_size, color,
251 alpha_flag, pIccTransform); 251 alpha_flag, pIccTransform);
252 } 252 }
253 int CFX_SkiaDeviceDriver::GetDeviceCaps(int caps_id) 253 int CFX_SkiaDeviceDriver::GetDeviceCaps(int caps_id)
254 { 254 {
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dithe r_bits, FALSE, pOriDevice, FALSE); 522 CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dithe r_bits, FALSE, pOriDevice, FALSE);
523 SetDeviceDriver(pDriver); 523 SetDeviceDriver(pDriver);
524 return TRUE; 524 return TRUE;
525 } 525 }
526 CFX_SkiaDevice::~CFX_SkiaDevice() 526 CFX_SkiaDevice::~CFX_SkiaDevice()
527 { 527 {
528 if (m_bOwnedBitmap && GetBitmap()) delete GetBitmap(); 528 if (m_bOwnedBitmap && GetBitmap()) delete GetBitmap();
529 } 529 }
530 530
531 #endif 531 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | core/src/fxge/win32/fx_win32_dib.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698