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

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

Issue 1243953004: Re-land else-after-returns (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
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/fpdfapi/fpdf_module.h" 7 #include "../../../include/fpdfapi/fpdf_module.h"
8 #include "../../../include/fpdfapi/fpdf_pageobj.h" 8 #include "../../../include/fpdfapi/fpdf_pageobj.h"
9 #include "../../../include/fpdfapi/fpdf_render.h" 9 #include "../../../include/fpdfapi/fpdf_render.h"
10 #include "../../../include/fxcodec/fx_codec.h" 10 #include "../../../include/fxcodec/fx_codec.h"
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 if (m_pQuickStretcher->Continue(pPause)) { 754 if (m_pQuickStretcher->Continue(pPause)) {
755 return TRUE; 755 return TRUE;
756 } 756 }
757 if (m_pQuickStretcher->m_pBitmap->IsAlphaMask()) 757 if (m_pQuickStretcher->m_pBitmap->IsAlphaMask())
758 m_pRenderStatus->m_pDevice->SetBitMask(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft, 758 m_pRenderStatus->m_pDevice->SetBitMask(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
759 m_pQuickStretcher->m_ResultTo p, m_FillArgb); 759 m_pQuickStretcher->m_ResultTo p, m_FillArgb);
760 else 760 else
761 m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft, 761 m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
762 m_pQuickStretcher->m_ResultTop , m_BlendType); 762 m_pQuickStretcher->m_ResultTop , m_BlendType);
763 return FALSE; 763 return FALSE;
764 } else if (m_Status == 2) { 764 }
765 if (m_Status == 2) {
765 if (m_pTransformer->Continue(pPause)) { 766 if (m_pTransformer->Continue(pPause)) {
766 return TRUE; 767 return TRUE;
767 } 768 }
768 CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach(); 769 CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
769 if (pBitmap == NULL) { 770 if (pBitmap == NULL) {
770 return FALSE; 771 return FALSE;
771 } 772 }
772 if (pBitmap->IsAlphaMask()) { 773 if (pBitmap->IsAlphaMask()) {
773 if (m_BitmapAlpha != 255) { 774 if (m_BitmapAlpha != 255) {
774 m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha); 775 m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
775 } 776 }
776 m_Result = m_pRenderStatus->m_pDevice->SetBitMask(pBitmap, 777 m_Result = m_pRenderStatus->m_pDevice->SetBitMask(pBitmap,
777 m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop , m_FillArgb); 778 m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop , m_FillArgb);
778 } else { 779 } else {
779 if (m_BitmapAlpha != 255) { 780 if (m_BitmapAlpha != 255) {
780 pBitmap->MultiplyAlpha(m_BitmapAlpha); 781 pBitmap->MultiplyAlpha(m_BitmapAlpha);
781 } 782 }
782 m_Result = m_pRenderStatus->m_pDevice->SetDIBits(pBitmap, 783 m_Result = m_pRenderStatus->m_pDevice->SetDIBits(pBitmap,
783 m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop , m_BlendType); 784 m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop , m_BlendType);
784 } 785 }
785 delete pBitmap; 786 delete pBitmap;
786 return FALSE; 787 return FALSE;
787 } else if (m_Status == 3) { 788 }
789 if (m_Status == 3) {
788 return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause ); 790 return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause );
789 } else if (m_Status == 4) { 791 }
792 if (m_Status == 4) {
790 if (m_Loader.Continue(m_LoadHandle, pPause)) { 793 if (m_Loader.Continue(m_LoadHandle, pPause)) {
791 return TRUE; 794 return TRUE;
792 } 795 }
793 if (StartRenderDIBSource()) { 796 if (StartRenderDIBSource()) {
794 return Continue(pPause); 797 return Continue(pPause);
795 } 798 }
796 return FALSE;
797 } 799 }
798 return FALSE; 800 return FALSE;
799 } 801 }
800 CPDF_QuickStretcher::CPDF_QuickStretcher() 802 CPDF_QuickStretcher::CPDF_QuickStretcher()
801 { 803 {
802 m_pBitmap = NULL; 804 m_pBitmap = NULL;
803 m_pDecoder = NULL; 805 m_pDecoder = NULL;
804 m_pCS = NULL; 806 m_pCS = NULL;
805 } 807 }
806 CPDF_QuickStretcher::~CPDF_QuickStretcher() 808 CPDF_QuickStretcher::~CPDF_QuickStretcher()
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 for (int i = 0; i < size; i ++) { 1072 for (int i = 0; i < size; i ++) {
1071 dest_buf[i] = pTransfer[src_buf[i]]; 1073 dest_buf[i] = pTransfer[src_buf[i]];
1072 } 1074 }
1073 } else { 1075 } else {
1074 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); 1076 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height);
1075 } 1077 }
1076 delete pFunc; 1078 delete pFunc;
1077 FX_Free(pTransfer); 1079 FX_Free(pTransfer);
1078 return pMask; 1080 return pMask;
1079 } 1081 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698