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

Side by Side Diff: Source/core/paint/SVGMaskPainter.cpp

Issue 1087893004: Change SkPictureBuilder strategy to not create nested recorders (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 8 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
« no previous file with comments | « no previous file | Source/platform/graphics/paint/SkPictureBuilder.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium 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 #include "config.h" 5 #include "config.h"
6 #include "core/paint/SVGMaskPainter.h" 6 #include "core/paint/SVGMaskPainter.h"
7 7
8 #include "core/layout/PaintInfo.h" 8 #include "core/layout/PaintInfo.h"
9 #include "core/layout/svg/LayoutSVGResourceMasker.h" 9 #include "core/layout/svg/LayoutSVGResourceMasker.h"
10 #include "core/paint/CompositingRecorder.h" 10 #include "core/paint/CompositingRecorder.h"
11 #include "core/paint/LayoutObjectDrawingRecorder.h"
11 #include "core/paint/TransformRecorder.h" 12 #include "core/paint/TransformRecorder.h"
12 #include "platform/graphics/paint/CompositingDisplayItem.h" 13 #include "platform/graphics/paint/CompositingDisplayItem.h"
13 #include "platform/graphics/paint/DisplayItemList.h" 14 #include "platform/graphics/paint/DisplayItemList.h"
14 #include "platform/graphics/paint/DrawingDisplayItem.h" 15 #include "platform/graphics/paint/DrawingDisplayItem.h"
15 16
16 namespace blink { 17 namespace blink {
17 18
18 bool SVGMaskPainter::prepareEffect(const LayoutObject& object, GraphicsContext* context) 19 bool SVGMaskPainter::prepareEffect(const LayoutObject& object, GraphicsContext* context)
19 { 20 {
20 ASSERT(context); 21 ASSERT(context);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 64
64 void SVGMaskPainter::drawMaskForLayoutObject(GraphicsContext* context, const Lay outObject& layoutObject, const FloatRect& targetBoundingBox) 65 void SVGMaskPainter::drawMaskForLayoutObject(GraphicsContext* context, const Lay outObject& layoutObject, const FloatRect& targetBoundingBox)
65 { 66 {
66 ASSERT(context); 67 ASSERT(context);
67 68
68 AffineTransform contentTransformation; 69 AffineTransform contentTransformation;
69 RefPtr<const SkPicture> maskContentPicture = m_mask.createContentPicture(con tentTransformation, targetBoundingBox); 70 RefPtr<const SkPicture> maskContentPicture = m_mask.createContentPicture(con tentTransformation, targetBoundingBox);
70 71
71 TransformRecorder recorder(*context, layoutObject, contentTransformation); 72 TransformRecorder recorder(*context, layoutObject, contentTransformation);
72 73
73 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 74 LayoutObjectDrawingRecorder drawingRecorder(*context, layoutObject, DisplayI tem::SVGMask, LayoutRect::infiniteIntRect());
74 ASSERT(context->displayItemList()); 75 if (!drawingRecorder.canUseCachedDrawing())
75 context->displayItemList()->add(DrawingDisplayItem::create(layoutObject, DisplayItem::SVGMask, maskContentPicture)); 76 context->drawPicture(maskContentPicture.get());
76 } else {
77 DrawingDisplayItem maskPicture(layoutObject, DisplayItem::SVGMask, maskC ontentPicture);
78 maskPicture.replay(*context);
79 }
80 } 77 }
81 78
82 } 79 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/paint/SkPictureBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698