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

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

Issue 1420583003: Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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_render/fpdf_render.cpp ('k') | core/src/fpdfdoc/doc_action.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/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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 int width = pClipRect->right - pClipRect->left; 1049 int width = pClipRect->right - pClipRect->left;
1050 int height = pClipRect->bottom - pClipRect->top; 1050 int height = pClipRect->bottom - pClipRect->top;
1051 FX_BOOL bLuminosity = FALSE; 1051 FX_BOOL bLuminosity = FALSE;
1052 bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha"); 1052 bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha");
1053 CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G")); 1053 CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G"));
1054 if (pGroup == NULL) { 1054 if (pGroup == NULL) {
1055 return NULL; 1055 return NULL;
1056 } 1056 }
1057 CPDF_Function* pFunc = NULL; 1057 CPDF_Function* pFunc = NULL;
1058 CPDF_Object* pFuncObj = pSMaskDict->GetElementValue(FX_BSTRC("TR")); 1058 CPDF_Object* pFuncObj = pSMaskDict->GetElementValue(FX_BSTRC("TR"));
1059 if (pFuncObj && (pFuncObj->GetType() == PDFOBJ_DICTIONARY || 1059 if (pFuncObj &&
1060 pFuncObj->GetType() == PDFOBJ_STREAM)) { 1060 (pFuncObj->IsDictionary() || pFuncObj->GetType() == PDFOBJ_STREAM)) {
1061 pFunc = CPDF_Function::Load(pFuncObj); 1061 pFunc = CPDF_Function::Load(pFuncObj);
1062 } 1062 }
1063 CFX_AffineMatrix matrix = *pMatrix; 1063 CFX_AffineMatrix matrix = *pMatrix;
1064 matrix.TranslateI(-pClipRect->left, -pClipRect->top); 1064 matrix.TranslateI(-pClipRect->left, -pClipRect->top);
1065 CPDF_Form form(m_pContext->m_pDocument, m_pContext->m_pPageResources, pGroup); 1065 CPDF_Form form(m_pContext->m_pDocument, m_pContext->m_pPageResources, pGroup);
1066 form.ParseContent(NULL, NULL, NULL, NULL); 1066 form.ParseContent(NULL, NULL, NULL, NULL);
1067 CFX_FxgeDevice bitmap_device; 1067 CFX_FxgeDevice bitmap_device;
1068 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 1068 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
1069 if (!bitmap_device.Create(width, height, 1069 if (!bitmap_device.Create(width, height,
1070 bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) { 1070 bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 for (int i = 0; i < size; i++) { 1167 for (int i = 0; i < size; i++) {
1168 dest_buf[i] = pTransfer[src_buf[i]]; 1168 dest_buf[i] = pTransfer[src_buf[i]];
1169 } 1169 }
1170 } else { 1170 } else {
1171 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); 1171 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height);
1172 } 1172 }
1173 delete pFunc; 1173 delete pFunc;
1174 FX_Free(pTransfer); 1174 FX_Free(pTransfer);
1175 return pMask; 1175 return pMask;
1176 } 1176 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/src/fpdfdoc/doc_action.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698