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

Side by Side Diff: core/src/fxge/dib/fx_dib_engine.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/apple/fx_quartz_device.cpp ('k') | core/src/fxge/dib/fx_dib_main.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_dib.h" 7 #include "../../../include/fxge/fx_dib.h"
8 #include "../../../include/fxge/fx_ge.h" 8 #include "../../../include/fxge/fx_ge.h"
9 #include "dib_int.h" 9 #include "dib_int.h"
10 #include <limits.h> 10 #include <limits.h>
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 { 672 {
673 m_pScanline = NULL; 673 m_pScanline = NULL;
674 m_pStretchEngine = NULL; 674 m_pStretchEngine = NULL;
675 m_pMaskScanline = NULL; 675 m_pMaskScanline = NULL;
676 } 676 }
677 CFX_ImageStretcher::~CFX_ImageStretcher() 677 CFX_ImageStretcher::~CFX_ImageStretcher()
678 { 678 {
679 if (m_pScanline) { 679 if (m_pScanline) {
680 FX_Free(m_pScanline); 680 FX_Free(m_pScanline);
681 } 681 }
682 if (m_pStretchEngine) { 682 delete m_pStretchEngine;
683 delete m_pStretchEngine;
684 }
685 if (m_pMaskScanline) { 683 if (m_pMaskScanline) {
686 FX_Free(m_pMaskScanline); 684 FX_Free(m_pMaskScanline);
687 } 685 }
688 } 686 }
689 FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc) 687 FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc)
690 { 688 {
691 FXDIB_Format format = pSrc->GetFormat(); 689 FXDIB_Format format = pSrc->GetFormat();
692 if (format == FXDIB_1bppMask) { 690 if (format == FXDIB_1bppMask) {
693 format = FXDIB_8bppMask; 691 format = FXDIB_8bppMask;
694 } else if (format == FXDIB_1bppRgb) { 692 } else if (format == FXDIB_1bppRgb) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 return TRUE; 829 return TRUE;
832 } 830 }
833 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth , m_bFlipX, m_ClipRect.left, result_width); 831 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth , m_bFlipX, m_ClipRect.left, result_width);
834 if (m_pMaskScanline) { 832 if (m_pMaskScanline) {
835 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); 833 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
836 } 834 }
837 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); 835 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline);
838 } 836 }
839 return FALSE; 837 return FALSE;
840 } 838 }
OLDNEW
« no previous file with comments | « core/src/fxge/apple/fx_quartz_device.cpp ('k') | core/src/fxge/dib/fx_dib_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698