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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp

Issue 801913002: Simplify PDFium by removing code that's not used in the open source repo. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years 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_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_pageobj.h" 8 #include "../../../include/fpdfapi/fpdf_pageobj.h"
9 #include "pageint.h" 9 #include "pageint.h"
10 CPDF_ImageObject::CPDF_ImageObject() 10 CPDF_ImageObject::CPDF_ImageObject()
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 m_bInline = FALSE; 70 m_bInline = FALSE;
71 m_pInlineDict = NULL; 71 m_pInlineDict = NULL;
72 m_pDIBSource = NULL; 72 m_pDIBSource = NULL;
73 m_pMask = NULL; 73 m_pMask = NULL;
74 m_MatteColor = 0; 74 m_MatteColor = 0;
75 } 75 }
76 CPDF_Image::~CPDF_Image() 76 CPDF_Image::~CPDF_Image()
77 { 77 {
78 if (m_bInline) { 78 if (m_bInline) {
79 if (m_pStream) { 79 if (m_pStream) {
80 #ifndef FOXIT_CHROME_BUILD
81 CPDF_Dictionary* pDict = m_pStream->GetDict();
82 if (pDict) {
83 CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpac e"));
84 if (pCSObj && m_pDocument) {
85 m_pDocument->RemoveColorSpaceFromPageData(pCSObj);
86 }
87 }
88 #endif
89 m_pStream->Release(); 80 m_pStream->Release();
90 } 81 }
91 if (m_pInlineDict) { 82 if (m_pInlineDict) {
92 m_pInlineDict->Release(); 83 m_pInlineDict->Release();
93 } 84 }
94 } 85 }
95 } 86 }
96 FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline) 87 FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline)
97 { 88 {
98 m_pStream = pStream; 89 m_pStream = pStream;
99 if (m_bInline && m_pInlineDict) { 90 if (m_bInline && m_pInlineDict) {
100 m_pInlineDict->Release(); 91 m_pInlineDict->Release();
101 m_pInlineDict = NULL; 92 m_pInlineDict = NULL;
102 } 93 }
103 m_bInline = bInline; 94 m_bInline = bInline;
104 CPDF_Dictionary* pDict = pStream->GetDict(); 95 CPDF_Dictionary* pDict = pStream->GetDict();
105 if (m_bInline) { 96 if (m_bInline) {
106 m_pInlineDict = (CPDF_Dictionary*)pDict->Clone(); 97 m_pInlineDict = (CPDF_Dictionary*)pDict->Clone();
107 } 98 }
108 m_pOC = pDict->GetDict(FX_BSTRC("OC")); 99 m_pOC = pDict->GetDict(FX_BSTRC("OC"));
109 m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) || pDict->GetInteger(FX _BSTRC("ImageMask")); 100 m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) || pDict->GetInteger(FX _BSTRC("ImageMask"));
110 #ifndef _FPDFAPI_MINI_
111 m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate")); 101 m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate"));
112 #endif
113 m_Height = pDict->GetInteger(FX_BSTRC("Height")); 102 m_Height = pDict->GetInteger(FX_BSTRC("Height"));
114 m_Width = pDict->GetInteger(FX_BSTRC("Width")); 103 m_Width = pDict->GetInteger(FX_BSTRC("Width"));
115 return TRUE; 104 return TRUE;
116 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698