Chromium Code Reviews| 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..276797d776f535bd1632b2b489d46358b74e3bb2 |
| --- /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&); |
|
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.
|
| + 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 |