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

Side by Side Diff: Source/core/paint/SVGClipPainter.h

Issue 979883002: [S.P.] Move clip painting to SVGClipPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: code shuffling Created 5 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SVGClipPainter_h
6 #define SVGClipPainter_h
7
8 #include "platform/geometry/FloatRect.h"
9 #include "platform/graphics/paint/DisplayItem.h"
10
11 namespace blink {
12
13 class AffineTransform;
14 class GraphicsContext;
15 class LayoutObject;
16 class LayoutSVGResourceClipper;
17
18 class SVGClipPainter {
19 public:
20 enum ClipperState {
21 ClipperNotApplied,
22 ClipperAppliedPath,
23 ClipperAppliedMask
24 };
25
26 SVGClipPainter(LayoutSVGResourceClipper& clip) : m_clip(clip) { }
27
28 // FIXME: Filters are also stateful resources that could benefit from having their state managed
29 // on the caller stack instead of the current hashmap. We should look at refactoring these
30 // into a general interface that can be shared.
31 bool applyStatefulResource(LayoutObject*, GraphicsContext*&, ClipperState&);
pdr. 2015/03/05 22:21:16 Not your fault but can you switch these pointer re
Erik Dahlström (inactive) 2015/03/06 11:55:50 Made them pointers for now.
32 void postApplyStatefulResource(LayoutObject*, GraphicsContext*&, ClipperStat e&);
33
34 // clipPath can be clipped too, but don't have a boundingBox or paintInvalid ationRect. So we can't call
35 // applyResource directly and use the rects from the object, since they are empty for LayoutSVGResources
36 // FIXME: We made applyClippingToContext public because we cannot call apply Resource on HTML elements (it asserts on LayoutObject::objectBoundingBox)
37 bool applyClippingToContext(LayoutObject*, const FloatRect&, const FloatRect &, GraphicsContext*, ClipperState&);
38
39 private:
40 void drawClipMaskContent(GraphicsContext*, DisplayItemClient, const FloatRec t&);
41
42 LayoutSVGResourceClipper& m_clip;
43 };
44
45 } // namespace blink
46
47 #endif // SVGShapePainter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698