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

Unified 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: codereview fixes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/LayerPainter.cpp ('k') | Source/core/paint/SVGClipPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGClipPainter.h
diff --git a/Source/core/paint/SVGClipPainter.h b/Source/core/paint/SVGClipPainter.h
new file mode 100644
index 0000000000000000000000000000000000000000..36c246aaae9d41a098ce241d3768f94460cae899
--- /dev/null
+++ b/Source/core/paint/SVGClipPainter.h
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SVGClipPainter_h
+#define SVGClipPainter_h
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/paint/DisplayItem.h"
+
+namespace blink {
+
+class AffineTransform;
+class GraphicsContext;
+class LayoutObject;
+class LayoutSVGResourceClipper;
+
+class SVGClipPainter {
+public:
+ enum ClipperState {
+ ClipperNotApplied,
+ ClipperAppliedPath,
+ ClipperAppliedMask
+ };
+
+ SVGClipPainter(LayoutSVGResourceClipper& clip) : m_clip(clip) { }
+
+ // FIXME: Filters are also stateful resources that could benefit from having their state managed
+ // on the caller stack instead of the current hashmap. We should look at refactoring these
+ // into a general interface that can be shared.
+ bool applyStatefulResource(LayoutObject*, GraphicsContext*, ClipperState&);
+ void postApplyStatefulResource(LayoutObject*, GraphicsContext*, ClipperState&);
+
+ // clipPath can be clipped too, but don't have a boundingBox or paintInvalidationRect. So we can't call
+ // applyResource directly and use the rects from the object, since they are empty for LayoutSVGResources
+ // FIXME: We made applyClippingToContext public because we cannot call applyResource on HTML elements (it asserts on LayoutObject::objectBoundingBox)
+ bool applyClippingToContext(LayoutObject*, const FloatRect&, const FloatRect&, GraphicsContext*, ClipperState&);
+
+private:
+ void drawClipMaskContent(GraphicsContext*, DisplayItemClient, const FloatRect&);
+
+ LayoutSVGResourceClipper& m_clip;
+};
+
+} // namespace blink
+
+#endif // SVGShapePainter_h
« no previous file with comments | « Source/core/paint/LayerPainter.cpp ('k') | Source/core/paint/SVGClipPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698