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

Side by Side Diff: core/src/fxge/win32/fx_win32_dwrite.cpp

Issue 1195363002: Cleanup: Do not check pointers before deleting them, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: nits Created 5 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 unified diff | Download patch
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | fpdfsdk/src/formfiller/FFL_ComboBox.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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ 8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_
9 #include "../../../include/fxge/fx_ge_win32.h" 9 #include "../../../include/fxge/fx_ge_win32.h"
10 #include "dwrite_int.h" 10 #include "dwrite_int.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 pMatrix ? &transform : NULL, 255 pMatrix ? &transform : NULL,
256 baselineOriginX, baselineOriginY, 256 baselineOriginX, baselineOriginY,
257 DWRITE_MEASURING_MODE_NATURAL, 257 DWRITE_MEASURING_MODE_NATURAL,
258 &glyphRun, 258 &glyphRun,
259 RGB(FXARGB_R(text_color), FXARGB_G(text_color), FXARGB_B(text_color )) 259 RGB(FXARGB_R(text_color), FXARGB_G(text_color), FXARGB_B(text_color ))
260 ); 260 );
261 return SUCCEEDED(hr) ? TRUE : FALSE; 261 return SUCCEEDED(hr) ? TRUE : FALSE;
262 } 262 }
263 void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget) 263 void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget)
264 { 264 {
265 if (renderTarget) { 265 delete (CDwGdiTextRenderer*)renderTarget;
266 delete (CDwGdiTextRenderer*)renderTarget;
267 }
268 } 266 }
269 void CDWriteExt::DwDeleteFont(void* pFont) 267 void CDWriteExt::DwDeleteFont(void* pFont)
270 { 268 {
271 if (pFont) { 269 if (pFont) {
272 SafeRelease((IDWriteFontFace**)&pFont); 270 SafeRelease((IDWriteFontFace**)&pFont);
273 } 271 }
274 } 272 }
275 CDwFontFileStream::CDwFontFileStream(void const* fontFileReferenceKey, UINT32 fo ntFileReferenceKeySize) 273 CDwFontFileStream::CDwFontFileStream(void const* fontFileReferenceKey, UINT32 fo ntFileReferenceKeySize)
276 { 274 {
277 refCount_ = 0; 275 refCount_ = 0;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 text_bbox.Height(), 462 text_bbox.Height(),
465 &dib, 463 &dib,
466 text_bbox.left, 464 text_bbox.left,
467 text_bbox.top, 465 text_bbox.top,
468 FXDIB_BLEND_NORMAL, 466 FXDIB_BLEND_NORMAL,
469 pClipRgn 467 pClipRgn
470 ); 468 );
471 return hr; 469 return hr;
472 } 470 }
473 #endif 471 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | fpdfsdk/src/formfiller/FFL_ComboBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698