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_render.h" | 7 #include "../../../include/fpdfapi/fpdf_render.h" |
8 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
9 #include "../../../include/fxge/fx_ge.h" | 9 #include "../../../include/fxge/fx_ge.h" |
10 #include "../fpdf_page/pageint.h" | 10 #include "../fpdf_page/pageint.h" |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 FX_RECT rect = pShadingObj->GetBBox(pObj2Device); | 874 FX_RECT rect = pShadingObj->GetBBox(pObj2Device); |
875 FX_RECT clip_box = m_pDevice->GetClipBox(); | 875 FX_RECT clip_box = m_pDevice->GetClipBox(); |
876 rect.Intersect(clip_box); | 876 rect.Intersect(clip_box); |
877 if (rect.IsEmpty()) { | 877 if (rect.IsEmpty()) { |
878 return TRUE; | 878 return TRUE; |
879 } | 879 } |
880 CFX_AffineMatrix matrix = pShadingObj->m_Matrix; | 880 CFX_AffineMatrix matrix = pShadingObj->m_Matrix; |
881 matrix.Concat(*pObj2Device); | 881 matrix.Concat(*pObj2Device); |
882 DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralSt
ate.GetAlpha(FALSE), | 882 DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralSt
ate.GetAlpha(FALSE), |
883 m_Options.m_ColorMode == RENDER_COLOR_ALPHA); | 883 m_Options.m_ColorMode == RENDER_COLOR_ALPHA); |
884 #ifdef _FPDFAPI_MINI_ | |
885 if (m_DitherBits) { | |
886 DitherObjectArea(pShadingObj, pObj2Device); | |
887 } | |
888 #endif | |
889 return TRUE; | 884 return TRUE; |
890 } | 885 } |
891 static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache
* pCache, | 886 static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache
* pCache, |
892 CPDF_TilingPattern* pPattern, const CFX_A
ffineMatrix* pObject2Device, | 887 CPDF_TilingPattern* pPattern, const CFX_A
ffineMatrix* pObject2Device, |
893 int width, int height, int flags) | 888 int width, int height, int flags) |
894 { | 889 { |
895 CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; | 890 CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; |
896 if (!pBitmap->Create(width, height, pPattern->m_bColored ? FXDIB_Argb : FXDI
B_8bppMask)) { | 891 if (!pBitmap->Create(width, height, pPattern->m_bColored ? FXDIB_Argb : FXDI
B_8bppMask)) { |
897 delete pBitmap; | 892 delete pBitmap; |
898 return NULL; | 893 return NULL; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 } | 1105 } |
1111 } | 1106 } |
1112 if(bStroke) { | 1107 if(bStroke) { |
1113 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); | 1108 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); |
1114 if(StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN)
{ | 1109 if(StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN)
{ |
1115 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); | 1110 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); |
1116 bStroke = FALSE; | 1111 bStroke = FALSE; |
1117 bPattern = TRUE; | 1112 bPattern = TRUE; |
1118 } | 1113 } |
1119 } | 1114 } |
1120 #ifdef _FPDFAPI_MINI_ | |
1121 if (bPattern && m_DitherBits) { | |
1122 DitherObjectArea(pPathObj, pObj2Device); | |
1123 } | |
1124 #endif | |
1125 } | 1115 } |
OLD | NEW |