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

Side by Side Diff: core/fxge/dib/fx_dib_transform.cpp

Issue 2149903002: Use smart pointers for various Jbig2 decoding contexts (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 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/fxge/dib/fx_dib_main.cpp ('k') | core/fxge/include/fx_dib.h » ('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 "core/fxge/dib/dib_int.h" 7 #include "core/fxge/dib/dib_int.h"
8 8
9 #include "core/fxge/include/fx_dib.h" 9 #include "core/fxge/include/fx_dib.h"
10 10
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 if (dest_clip.IsEmpty()) { 184 if (dest_clip.IsEmpty()) {
185 return nullptr; 185 return nullptr;
186 } 186 }
187 CFX_DIBitmap* pTransBitmap = new CFX_DIBitmap; 187 CFX_DIBitmap* pTransBitmap = new CFX_DIBitmap;
188 int result_height = dest_clip.Height(), result_width = dest_clip.Width(); 188 int result_height = dest_clip.Height(), result_width = dest_clip.Width();
189 if (!pTransBitmap->Create(result_width, result_height, GetFormat())) { 189 if (!pTransBitmap->Create(result_width, result_height, GetFormat())) {
190 delete pTransBitmap; 190 delete pTransBitmap;
191 return nullptr; 191 return nullptr;
192 } 192 }
193 pTransBitmap->CopyPalette(m_pPalette); 193 pTransBitmap->CopyPalette(m_pPalette.get());
194 int dest_pitch = pTransBitmap->GetPitch(); 194 int dest_pitch = pTransBitmap->GetPitch();
195 uint8_t* dest_buf = pTransBitmap->GetBuffer(); 195 uint8_t* dest_buf = pTransBitmap->GetBuffer();
196 int row_start = bXFlip ? m_Height - dest_clip.right : dest_clip.left; 196 int row_start = bXFlip ? m_Height - dest_clip.right : dest_clip.left;
197 int row_end = bXFlip ? m_Height - dest_clip.left : dest_clip.right; 197 int row_end = bXFlip ? m_Height - dest_clip.left : dest_clip.right;
198 int col_start = bYFlip ? m_Width - dest_clip.bottom : dest_clip.top; 198 int col_start = bYFlip ? m_Width - dest_clip.bottom : dest_clip.top;
199 int col_end = bYFlip ? m_Width - dest_clip.top : dest_clip.bottom; 199 int col_end = bYFlip ? m_Width - dest_clip.top : dest_clip.bottom;
200 if (GetBPP() == 1) { 200 if (GetBPP() == 1) {
201 FXSYS_memset(dest_buf, 0xff, dest_pitch * result_height); 201 FXSYS_memset(dest_buf, 0xff, dest_pitch * result_height);
202 for (int row = row_start; row < row_end; row++) { 202 for (int row = row_start; row < row_end; row++) {
203 const uint8_t* src_scan = GetScanline(row); 203 const uint8_t* src_scan = GetScanline(row);
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 } 946 }
947 } 947 }
948 } 948 }
949 m_Storer.Replace(std::move(pTransformed)); 949 m_Storer.Replace(std::move(pTransformed));
950 return FALSE; 950 return FALSE;
951 } 951 }
952 952
953 std::unique_ptr<CFX_DIBitmap> CFX_ImageTransformer::DetachBitmap() { 953 std::unique_ptr<CFX_DIBitmap> CFX_ImageTransformer::DetachBitmap() {
954 return m_Storer.Detach(); 954 return m_Storer.Detach();
955 } 955 }
OLDNEW
« no previous file with comments | « core/fxge/dib/fx_dib_main.cpp ('k') | core/fxge/include/fx_dib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698