| OLD | NEW |
| 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 "public/fpdf_edit.h" | 7 #include "public/fpdf_edit.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h" | 9 #include "core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h" |
| 10 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 204 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
| 205 return pPage && pPage->BackgroundAlphaNeeded(); | 205 return pPage && pPage->BackgroundAlphaNeeded(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 DLLEXPORT FPDF_BOOL STDCALL | 208 DLLEXPORT FPDF_BOOL STDCALL |
| 209 FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject) { | 209 FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject) { |
| 210 if (!pageObject) | 210 if (!pageObject) |
| 211 return FALSE; | 211 return FALSE; |
| 212 CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject; | 212 CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject; |
| 213 | 213 |
| 214 const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState; | 214 const CPDF_GeneralStateData* pGeneralState = |
| 215 pPageObj->m_GeneralState.GetObject(); |
| 215 int blend_type = | 216 int blend_type = |
| 216 pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL; | 217 pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL; |
| 217 if (blend_type != FXDIB_BLEND_NORMAL) | 218 if (blend_type != FXDIB_BLEND_NORMAL) |
| 218 return TRUE; | 219 return TRUE; |
| 219 | 220 |
| 220 CPDF_Dictionary* pSMaskDict = | 221 CPDF_Dictionary* pSMaskDict = |
| 221 pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : nullptr; | 222 pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : nullptr; |
| 222 if (pSMaskDict) | 223 if (pSMaskDict) |
| 223 return TRUE; | 224 return TRUE; |
| 224 | 225 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 !pPage->m_pFormDict->GetObjectBy("Type")->GetDirect() || | 312 !pPage->m_pFormDict->GetObjectBy("Type")->GetDirect() || |
| 312 pPage->m_pFormDict->GetObjectBy("Type")->GetDirect()->GetString().Compare( | 313 pPage->m_pFormDict->GetObjectBy("Type")->GetDirect()->GetString().Compare( |
| 313 "Page")) { | 314 "Page")) { |
| 314 return; | 315 return; |
| 315 } | 316 } |
| 316 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 317 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
| 317 rotate %= 4; | 318 rotate %= 4; |
| 318 | 319 |
| 319 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); | 320 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); |
| 320 } | 321 } |
| OLD | NEW |