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

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

Issue 2453163002: Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « core/fpdfapi/page/fpdf_page_func.cpp ('k') | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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 }
OLDNEW
« no previous file with comments | « core/fpdfapi/page/fpdf_page_func.cpp ('k') | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698