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

Side by Side Diff: core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp

Issue 2010813003: Remove default arguments from CFX_FxgeDevice. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@fxgeclean2_textrenderer
Patch Set: rebase Created 4 years, 6 months 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 "core/fpdfapi/fpdf_render/render_int.h" 7 #include "core/fpdfapi/fpdf_render/render_int.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 CFX_DIBitmap* pBitmap, 745 CFX_DIBitmap* pBitmap,
746 CFX_Matrix* pObject2Bitmap, 746 CFX_Matrix* pObject2Bitmap,
747 CPDF_Stream* pShadingStream, 747 CPDF_Stream* pShadingStream,
748 const std::vector<std::unique_ptr<CPDF_Function>>& funcs, 748 const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
749 CPDF_ColorSpace* pCS, 749 CPDF_ColorSpace* pCS,
750 int fill_mode, 750 int fill_mode,
751 int alpha) { 751 int alpha) {
752 ASSERT(pBitmap->GetFormat() == FXDIB_Argb); 752 ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
753 753
754 CFX_FxgeDevice device; 754 CFX_FxgeDevice device;
755 device.Attach(pBitmap); 755 device.Attach(pBitmap, false, nullptr, false);
756 CPDF_MeshStream stream(funcs, pCS); 756 CPDF_MeshStream stream(funcs, pCS);
757 if (!stream.Load(pShadingStream)) 757 if (!stream.Load(pShadingStream))
758 return; 758 return;
759 if (!CheckCoonTensorPara(stream)) 759 if (!CheckCoonTensorPara(stream))
760 return; 760 return;
761 761
762 CPDF_PatchDrawer patch; 762 CPDF_PatchDrawer patch;
763 patch.alpha = alpha; 763 patch.alpha = alpha;
764 patch.pDevice = &device; 764 patch.pDevice = &device;
765 patch.fill_mode = fill_mode; 765 patch.fill_mode = fill_mode;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 const CFX_Matrix* pObject2Device, 823 const CFX_Matrix* pObject2Device,
824 int width, 824 int width,
825 int height, 825 int height,
826 int flags) { 826 int flags) {
827 std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap); 827 std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap);
828 if (!pBitmap->Create(width, height, 828 if (!pBitmap->Create(width, height,
829 pPattern->colored() ? FXDIB_Argb : FXDIB_8bppMask)) { 829 pPattern->colored() ? FXDIB_Argb : FXDIB_8bppMask)) {
830 return std::unique_ptr<CFX_DIBitmap>(); 830 return std::unique_ptr<CFX_DIBitmap>();
831 } 831 }
832 CFX_FxgeDevice bitmap_device; 832 CFX_FxgeDevice bitmap_device;
833 bitmap_device.Attach(pBitmap.get()); 833 bitmap_device.Attach(pBitmap.get(), false, nullptr, false);
834 pBitmap->Clear(0); 834 pBitmap->Clear(0);
835 CFX_FloatRect cell_bbox = pPattern->bbox(); 835 CFX_FloatRect cell_bbox = pPattern->bbox();
836 pPattern->pattern_to_form()->TransformRect(cell_bbox); 836 pPattern->pattern_to_form()->TransformRect(cell_bbox);
837 pObject2Device->TransformRect(cell_bbox); 837 pObject2Device->TransformRect(cell_bbox);
838 CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height); 838 CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height);
839 CFX_Matrix mtAdjust; 839 CFX_Matrix mtAdjust;
840 mtAdjust.MatchRect(bitmap_rect, cell_bbox); 840 mtAdjust.MatchRect(bitmap_rect, cell_bbox);
841 CFX_Matrix mtPattern2Bitmap = *pObject2Device; 841 CFX_Matrix mtPattern2Bitmap = *pObject2Device;
842 mtPattern2Bitmap.Concat(mtAdjust); 842 mtPattern2Bitmap.Concat(mtAdjust);
843 CPDF_RenderOptions options; 843 CPDF_RenderOptions options;
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 } 1207 }
1208 } 1208 }
1209 if (bStroke) { 1209 if (bStroke) {
1210 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); 1210 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor();
1211 if (StrokeColor.IsPattern()) { 1211 if (StrokeColor.IsPattern()) {
1212 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); 1212 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE);
1213 bStroke = FALSE; 1213 bStroke = FALSE;
1214 } 1214 }
1215 } 1215 }
1216 } 1216 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698