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

Side by Side Diff: core/src/fxge/dib/fx_dib_composite.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 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/dib/dib_int.h ('k') | core/src/fxge/dib/fx_dib_convert.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 #include "../../../include/fxcodec/fx_codec.h" 8 #include "../../../include/fxcodec/fx_codec.h"
9 #include "dib_int.h" 9 #include "dib_int.h"
10 const uint8_t _color_sqrt[256] = { 10 const uint8_t _color_sqrt[256] = {
(...skipping 4175 matching lines...) Expand 10 before | Expand all | Expand 10 after
4186 } 4186 }
4187 } 4187 }
4188 CFX_ScanlineCompositor::CFX_ScanlineCompositor() { 4188 CFX_ScanlineCompositor::CFX_ScanlineCompositor() {
4189 m_pSrcPalette = NULL; 4189 m_pSrcPalette = NULL;
4190 m_pCacheScanline = NULL; 4190 m_pCacheScanline = NULL;
4191 m_CacheSize = 0; 4191 m_CacheSize = 0;
4192 m_bRgbByteOrder = FALSE; 4192 m_bRgbByteOrder = FALSE;
4193 m_BlendType = FXDIB_BLEND_NORMAL; 4193 m_BlendType = FXDIB_BLEND_NORMAL;
4194 } 4194 }
4195 CFX_ScanlineCompositor::~CFX_ScanlineCompositor() { 4195 CFX_ScanlineCompositor::~CFX_ScanlineCompositor() {
4196 if (m_pSrcPalette) { 4196 FX_Free(m_pSrcPalette);
4197 FX_Free(m_pSrcPalette); 4197 FX_Free(m_pCacheScanline);
4198 }
4199 if (m_pCacheScanline) {
4200 FX_Free(m_pCacheScanline);
4201 }
4202 } 4198 }
4203 FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, 4199 FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format,
4204 FXDIB_Format src_format, 4200 FXDIB_Format src_format,
4205 int32_t width, 4201 int32_t width,
4206 FX_DWORD* pSrcPalette, 4202 FX_DWORD* pSrcPalette,
4207 FX_DWORD mask_color, 4203 FX_DWORD mask_color,
4208 int blend_type, 4204 int blend_type,
4209 FX_BOOL bClip, 4205 FX_BOOL bClip,
4210 FX_BOOL bRgbByteOrder, 4206 FX_BOOL bRgbByteOrder,
4211 int alpha_flag, 4207 int alpha_flag,
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
5003 } 4999 }
5004 CFX_BitmapComposer::CFX_BitmapComposer() { 5000 CFX_BitmapComposer::CFX_BitmapComposer() {
5005 m_pScanlineV = NULL; 5001 m_pScanlineV = NULL;
5006 m_pScanlineAlphaV = NULL; 5002 m_pScanlineAlphaV = NULL;
5007 m_pClipScanV = NULL; 5003 m_pClipScanV = NULL;
5008 m_pAddClipScan = NULL; 5004 m_pAddClipScan = NULL;
5009 m_bRgbByteOrder = FALSE; 5005 m_bRgbByteOrder = FALSE;
5010 m_BlendType = FXDIB_BLEND_NORMAL; 5006 m_BlendType = FXDIB_BLEND_NORMAL;
5011 } 5007 }
5012 CFX_BitmapComposer::~CFX_BitmapComposer() { 5008 CFX_BitmapComposer::~CFX_BitmapComposer() {
5013 if (m_pScanlineV) { 5009 FX_Free(m_pScanlineV);
5014 FX_Free(m_pScanlineV); 5010 FX_Free(m_pScanlineAlphaV);
5015 } 5011 FX_Free(m_pClipScanV);
5016 if (m_pScanlineAlphaV) { 5012 FX_Free(m_pAddClipScan);
5017 FX_Free(m_pScanlineAlphaV);
5018 }
5019 if (m_pClipScanV) {
5020 FX_Free(m_pClipScanV);
5021 }
5022 if (m_pAddClipScan) {
5023 FX_Free(m_pAddClipScan);
5024 }
5025 } 5013 }
5026 void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, 5014 void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest,
5027 const CFX_ClipRgn* pClipRgn, 5015 const CFX_ClipRgn* pClipRgn,
5028 int bitmap_alpha, 5016 int bitmap_alpha,
5029 FX_DWORD mask_color, 5017 FX_DWORD mask_color,
5030 FX_RECT& dest_rect, 5018 FX_RECT& dest_rect,
5031 FX_BOOL bVertical, 5019 FX_BOOL bVertical,
5032 FX_BOOL bFlipX, 5020 FX_BOOL bFlipX,
5033 FX_BOOL bFlipY, 5021 FX_BOOL bFlipY,
5034 FX_BOOL bRgbByteOrder, 5022 FX_BOOL bRgbByteOrder,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
5201 } 5189 }
5202 src_alpha_scan = m_pScanlineAlphaV; 5190 src_alpha_scan = m_pScanlineAlphaV;
5203 dest_alpha_scan = dest_alpha_buf; 5191 dest_alpha_scan = dest_alpha_buf;
5204 if (dest_alpha_scan) { 5192 if (dest_alpha_scan) {
5205 for (i = 0; i < m_DestHeight; i++) { 5193 for (i = 0; i < m_DestHeight; i++) {
5206 *dest_alpha_scan = *src_alpha_scan++; 5194 *dest_alpha_scan = *src_alpha_scan++;
5207 dest_alpha_scan += y_alpha_step; 5195 dest_alpha_scan += y_alpha_step;
5208 } 5196 }
5209 } 5197 }
5210 } 5198 }
OLDNEW
« no previous file with comments | « core/src/fxge/dib/dib_int.h ('k') | core/src/fxge/dib/fx_dib_convert.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698