| 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 "core/fpdfapi/render/render_int.h" | 7 #include "core/fpdfapi/render/render_int.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 CPDF_Document* pDoc, | 812 CPDF_Document* pDoc, |
| 813 CPDF_PageRenderCache* pCache, | 813 CPDF_PageRenderCache* pCache, |
| 814 CPDF_TilingPattern* pPattern, | 814 CPDF_TilingPattern* pPattern, |
| 815 const CFX_Matrix* pObject2Device, | 815 const CFX_Matrix* pObject2Device, |
| 816 int width, | 816 int width, |
| 817 int height, | 817 int height, |
| 818 int flags) { | 818 int flags) { |
| 819 std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap); | 819 std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap); |
| 820 if (!pBitmap->Create(width, height, | 820 if (!pBitmap->Create(width, height, |
| 821 pPattern->colored() ? FXDIB_Argb : FXDIB_8bppMask)) { | 821 pPattern->colored() ? FXDIB_Argb : FXDIB_8bppMask)) { |
| 822 return std::unique_ptr<CFX_DIBitmap>(); | 822 return nullptr; |
| 823 } | 823 } |
| 824 CFX_FxgeDevice bitmap_device; | 824 CFX_FxgeDevice bitmap_device; |
| 825 bitmap_device.Attach(pBitmap.get(), false, nullptr, false); | 825 bitmap_device.Attach(pBitmap.get(), false, nullptr, false); |
| 826 pBitmap->Clear(0); | 826 pBitmap->Clear(0); |
| 827 CFX_FloatRect cell_bbox = pPattern->bbox(); | 827 CFX_FloatRect cell_bbox = pPattern->bbox(); |
| 828 pPattern->pattern_to_form()->TransformRect(cell_bbox); | 828 pPattern->pattern_to_form()->TransformRect(cell_bbox); |
| 829 pObject2Device->TransformRect(cell_bbox); | 829 pObject2Device->TransformRect(cell_bbox); |
| 830 CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height); | 830 CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height); |
| 831 CFX_Matrix mtAdjust; | 831 CFX_Matrix mtAdjust; |
| 832 mtAdjust.MatchRect(bitmap_rect, cell_bbox); | 832 mtAdjust.MatchRect(bitmap_rect, cell_bbox); |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 } | 1210 } |
| 1211 } | 1211 } |
| 1212 if (bStroke) { | 1212 if (bStroke) { |
| 1213 const CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); | 1213 const CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); |
| 1214 if (StrokeColor.IsPattern()) { | 1214 if (StrokeColor.IsPattern()) { |
| 1215 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); | 1215 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); |
| 1216 bStroke = FALSE; | 1216 bStroke = FALSE; |
| 1217 } | 1217 } |
| 1218 } | 1218 } |
| 1219 } | 1219 } |
| OLD | NEW |