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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 1783023002: Re-enable MSVC warning 4800 for compiling with chromium_code (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: remove cast change on security_handler file Created 4 years, 9 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/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp ('k') | core/src/fpdfdoc/doc_formfield.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 "core/src/fpdfapi/fpdf_render/render_int.h" 7 #include "core/src/fpdfapi/fpdf_render/render_int.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam(); 621 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam();
622 if (decoder == "CCITTFaxDecode") { 622 if (decoder == "CCITTFaxDecode") {
623 m_pDecoder.reset(FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, 623 m_pDecoder.reset(FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width,
624 m_Height, pParams)); 624 m_Height, pParams));
625 } else if (decoder == "DCTDecode") { 625 } else if (decoder == "DCTDecode") {
626 m_pDecoder.reset(CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder( 626 m_pDecoder.reset(CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
627 src_data, src_size, m_Width, m_Height, m_nComponents, 627 src_data, src_size, m_Width, m_Height, m_nComponents,
628 pParams ? pParams->GetIntegerBy("ColorTransform", 1) : 1)); 628 pParams ? pParams->GetIntegerBy("ColorTransform", 1) : 1));
629 if (!m_pDecoder) { 629 if (!m_pDecoder) {
630 FX_BOOL bTransform = FALSE; 630 FX_BOOL bTransform = FALSE;
631 int comps, bpc; 631 int comps;
632 int bpc;
632 ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule(); 633 ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
633 if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, 634 if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps,
634 bpc, bTransform)) { 635 bpc, bTransform)) {
635 if (m_nComponents != comps) { 636 if (m_nComponents != static_cast<FX_DWORD>(comps)) {
636 FX_Free(m_pCompData); 637 FX_Free(m_pCompData);
637 m_nComponents = comps; 638 m_nComponents = static_cast<FX_DWORD>(comps);
638 if (m_Family == PDFCS_LAB && m_nComponents != 3) { 639 if (m_Family == PDFCS_LAB && m_nComponents != 3) {
639 m_pCompData = nullptr; 640 m_pCompData = nullptr;
640 return 0; 641 return 0;
641 } 642 }
642 m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey); 643 m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey);
643 if (!m_pCompData) { 644 if (!m_pCompData) {
644 return 0; 645 return 0;
645 } 646 }
646 } 647 }
647 m_bpc = bpc; 648 m_bpc = bpc;
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 1434
1434 void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp, 1435 void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp,
1435 int dest_Bpp, 1436 int dest_Bpp,
1436 FX_DWORD src_width, 1437 FX_DWORD src_width,
1437 const uint8_t* pSrcLine, 1438 const uint8_t* pSrcLine,
1438 uint8_t* dest_scan, 1439 uint8_t* dest_scan,
1439 int dest_width, 1440 int dest_width,
1440 FX_BOOL bFlipX, 1441 FX_BOOL bFlipX,
1441 int clip_left, 1442 int clip_left,
1442 int clip_width) const { 1443 int clip_width) const {
1443 int last_src_x = -1; 1444 // last_src_x used to store the last seen src_x position which should be
1445 // in [0, src_width). Set the initial value to be an invalid src_x value.
1446 FX_DWORD last_src_x = src_width;
1444 FX_ARGB last_argb = FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF); 1447 FX_ARGB last_argb = FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF);
1445 FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1); 1448 FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1);
1446 for (int i = 0; i < clip_width; i++) { 1449 for (int i = 0; i < clip_width; i++) {
1447 int dest_x = clip_left + i; 1450 int dest_x = clip_left + i;
1448 FX_DWORD src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) * 1451 FX_DWORD src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) *
1449 (int64_t)src_width / dest_width; 1452 (int64_t)src_width / dest_width;
1450 src_x %= src_width; 1453 src_x %= src_width;
1451 1454
1452 uint8_t* pDestPixel = dest_scan + i * dest_Bpp; 1455 uint8_t* pDestPixel = dest_scan + i * dest_Bpp;
1453 FX_ARGB argb; 1456 FX_ARGB argb;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 IFX_Pause* pPause) { 1647 IFX_Pause* pPause) {
1645 return LoadHandle->Continue(pPause); 1648 return LoadHandle->Continue(pPause);
1646 } 1649 }
1647 1650
1648 CPDF_ImageLoader::~CPDF_ImageLoader() { 1651 CPDF_ImageLoader::~CPDF_ImageLoader() {
1649 if (!m_bCached) { 1652 if (!m_bCached) {
1650 delete m_pBitmap; 1653 delete m_pBitmap;
1651 delete m_pMask; 1654 delete m_pMask;
1652 } 1655 }
1653 } 1656 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp ('k') | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698