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

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

Issue 2025043002: remove some calls to dib (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 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 | « no previous file | core/fpdfapi/fpdf_render/fpdf_render_image.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/fpdfapi/fpdf_render/render_int.h" 7 #include "core/fpdfapi/fpdf_render/render_int.h"
8 8
9 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h" 9 #include "core/fpdfapi/fpdf_font/cpdf_type3char.h"
10 #include "core/fpdfapi/fpdf_font/cpdf_type3font.h" 10 #include "core/fpdfapi/fpdf_font/cpdf_type3font.h"
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 smask_matrix.Concat(*pObj2Device); 808 smask_matrix.Concat(*pObj2Device);
809 std::unique_ptr<CFX_DIBSource> pSMaskSource( 809 std::unique_ptr<CFX_DIBSource> pSMaskSource(
810 LoadSMask(pSMaskDict, &rect, &smask_matrix)); 810 LoadSMask(pSMaskDict, &rect, &smask_matrix));
811 if (pSMaskSource) 811 if (pSMaskSource)
812 bitmap->MultiplyAlpha(pSMaskSource.get()); 812 bitmap->MultiplyAlpha(pSMaskSource.get());
813 } 813 }
814 if (pTextMask) { 814 if (pTextMask) {
815 bitmap->MultiplyAlpha(pTextMask.get()); 815 bitmap->MultiplyAlpha(pTextMask.get());
816 pTextMask.reset(); 816 pTextMask.reset();
817 } 817 }
818 int32_t blitAlpha = 255;
818 if (Transparency & PDFTRANS_GROUP && group_alpha != 1.0f) { 819 if (Transparency & PDFTRANS_GROUP && group_alpha != 1.0f) {
819 bitmap->MultiplyAlpha((int32_t)(group_alpha * 255)); 820 blitAlpha = (int32_t)(group_alpha * 255);
821 #ifndef _SKIA_SUPPORT_
822 bitmap->MultiplyAlpha(blitAlpha);
823 blitAlpha = 255;
824 #endif
820 } 825 }
821 Transparency = m_Transparency; 826 Transparency = m_Transparency;
822 if (pPageObj->IsForm()) { 827 if (pPageObj->IsForm()) {
823 Transparency |= PDFTRANS_GROUP; 828 Transparency |= PDFTRANS_GROUP;
824 } 829 }
825 CompositeDIBitmap(bitmap, rect.left, rect.top, 0, 255, blend_type, 830 CompositeDIBitmap(bitmap, rect.left, rect.top, 0, blitAlpha, blend_type,
826 Transparency); 831 Transparency);
827 return TRUE; 832 return TRUE;
828 } 833 }
829 834
830 CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, 835 CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj,
831 const FX_RECT& rect, 836 const FX_RECT& rect,
832 int& left, 837 int& left,
833 int& top, 838 int& top,
834 FX_BOOL bBackAlphaRequired) { 839 FX_BOOL bBackAlphaRequired) {
835 FX_RECT bbox = rect; 840 FX_RECT bbox = rect;
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, 1271 m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions,
1267 &m_Matrix); 1272 &m_Matrix);
1268 return TRUE; 1273 return TRUE;
1269 } 1274 }
1270 void CPDF_ScaledRenderBuffer::OutputToDevice() { 1275 void CPDF_ScaledRenderBuffer::OutputToDevice() {
1271 if (m_pBitmapDevice) { 1276 if (m_pBitmapDevice) {
1272 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, 1277 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left,
1273 m_Rect.top, m_Rect.Width(), m_Rect.Height()); 1278 m_Rect.top, m_Rect.Width(), m_Rect.Height());
1274 } 1279 }
1275 } 1280 }
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_render/fpdf_render_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698