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 "../../../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 "../../../include/fpdfapi/fpdf_module.h" | 9 #include "../../../include/fpdfapi/fpdf_module.h" |
10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
| 11 #include "../fpdf_render/render_int.h" |
11 #include "pageint.h" | 12 #include "pageint.h" |
12 #include "../fpdf_render/render_int.h" | 13 |
13 void CPDF_GraphicStates::DefaultStates() | 14 void CPDF_GraphicStates::DefaultStates() |
14 { | 15 { |
15 m_ColorState.New()->Default(); | 16 m_ColorState.New()->Default(); |
16 } | 17 } |
17 void CPDF_GraphicStates::CopyStates(const CPDF_GraphicStates& src) | 18 void CPDF_GraphicStates::CopyStates(const CPDF_GraphicStates& src) |
18 { | 19 { |
19 m_ClipPath = src.m_ClipPath; | 20 m_ClipPath = src.m_ClipPath; |
20 m_GraphState = src.m_GraphState; | 21 m_GraphState = src.m_GraphState; |
21 m_ColorState = src.m_ColorState; | 22 m_ColorState = src.m_ColorState; |
22 m_TextState = src.m_TextState; | 23 m_TextState = src.m_TextState; |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 break; | 538 break; |
538 case FXBSTR_ID('B', 'M', 0, 0): { | 539 case FXBSTR_ID('B', 'M', 0, 0): { |
539 CFX_ByteString mode; | 540 CFX_ByteString mode; |
540 if (pObject->GetType() == PDFOBJ_ARRAY) { | 541 if (pObject->GetType() == PDFOBJ_ARRAY) { |
541 mode = ((CPDF_Array*)pObject)->GetString(0); | 542 mode = ((CPDF_Array*)pObject)->GetString(0); |
542 } else { | 543 } else { |
543 mode = pObject->GetString(); | 544 mode = pObject->GetString(); |
544 } | 545 } |
545 pGeneralState->SetBlendMode(mode); | 546 pGeneralState->SetBlendMode(mode); |
546 if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) { | 547 if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) { |
547 pParser->m_pObjectList->m_bBackgroundAlphaNeeded = TRUE; | 548 pParser->GetObjectList()->m_bBackgroundAlphaNeeded = TRU
E; |
548 } | 549 } |
549 break; | 550 break; |
550 } | 551 } |
551 case FXBSTR_ID('S', 'M', 'a', 's'): | 552 case FXBSTR_ID('S', 'M', 'a', 's'): |
552 if (pObject && pObject->GetType() == PDFOBJ_DICTIONARY) { | 553 if (pObject && pObject->GetType() == PDFOBJ_DICTIONARY) { |
553 pGeneralState->m_pSoftMask = pObject; | 554 pGeneralState->m_pSoftMask = pObject; |
554 FXSYS_memcpy(pGeneralState->m_SMaskMatrix, &pParser->m_pCurS
tates->m_CTM, sizeof(CPDF_Matrix)); | 555 FXSYS_memcpy(pGeneralState->m_SMaskMatrix, &pParser->GetCurS
tates()->m_CTM, sizeof(CPDF_Matrix)); |
555 } else { | 556 } else { |
556 pGeneralState->m_pSoftMask = NULL; | 557 pGeneralState->m_pSoftMask = NULL; |
557 } | 558 } |
558 break; | 559 break; |
559 case FXBSTR_ID('C', 'A', 0, 0): | 560 case FXBSTR_ID('C', 'A', 0, 0): |
560 pGeneralState->m_StrokeAlpha = PDF_ClipFloat(pObject->GetNumber(
)); | 561 pGeneralState->m_StrokeAlpha = PDF_ClipFloat(pObject->GetNumber(
)); |
561 break; | 562 break; |
562 case FXBSTR_ID('c', 'a', 0, 0): | 563 case FXBSTR_ID('c', 'a', 0, 0): |
563 pGeneralState->m_FillAlpha = PDF_ClipFloat(pObject->GetNumber())
; | 564 pGeneralState->m_FillAlpha = PDF_ClipFloat(pObject->GetNumber())
; |
564 break; | 565 break; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 pDict = NULL; | 700 pDict = NULL; |
700 if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict || | 701 if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict || |
701 item.GetParamType() == CPDF_ContentMarkItem::DirectDict) { | 702 item.GetParamType() == CPDF_ContentMarkItem::DirectDict) { |
702 pDict = (CPDF_Dictionary*)item.GetParam(); | 703 pDict = (CPDF_Dictionary*)item.GetParam(); |
703 } | 704 } |
704 return TRUE; | 705 return TRUE; |
705 } | 706 } |
706 } | 707 } |
707 return FALSE; | 708 return FALSE; |
708 } | 709 } |
OLD | NEW |