Chromium Code Reviews| Index: Source/core/paint/SVGPaintServer.h |
| diff --git a/Source/core/paint/SVGPaintServer.h b/Source/core/paint/SVGPaintServer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..de1f8b5ab13526eac7d8fcde8e0267175a5cfceb |
| --- /dev/null |
| +++ b/Source/core/paint/SVGPaintServer.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2014 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 SVGPaintServer_h |
| +#define SVGPaintServer_h |
| + |
| +#include "core/rendering/svg/RenderSVGResource.h" |
| +#include "platform/graphics/Gradient.h" |
| +#include "platform/graphics/Pattern.h" |
| + |
| +namespace blink { |
| + |
| +class GraphicsContext; |
| +class GraphicsContextStateSaver; |
| + |
| +class SVGPaintServer { |
| +public: |
| + SVGPaintServer(); |
|
pdr.
2014/10/09 01:00:50
This can be private.
|
| + |
| + static bool existsForRenderer(RenderObject&, const RenderStyle*, RenderSVGResourceMode); |
| + |
| + // Update the GC state (on |context|) for painting |renderer| |
| + // using |style|. |resourceModeFlags| is used to decide between fill/stroke. |
| + // Previous state will be saved (if needed) using |stateSaver|. |
| + static bool updateGraphicsContext(GraphicsContext*, RenderStyle*, RenderObject&, RenderSVGResourceModeFlags, GraphicsContextStateSaver&); |
|
pdr.
2014/10/09 01:00:50
Passing in both a context and a statesaver that ho
fs
2014/10/09 07:23:08
It's already exposed, I just don't find it particu
fs
2014/10/10 13:08:59
Dropped GC*, moved GCSS in the argument list. (I h
|
| + |
| + void setColor(Color); |
| + void setGradient(const PassRefPtr<Gradient>); |
| + void setPattern(const PassRefPtr<Pattern>); |
| + |
| + void apply(GraphicsContext&, RenderSVGResourceMode, GraphicsContextStateSaver* = 0); |
| + |
| +private: |
| + static bool requestForRenderer(RenderObject&, RenderStyle*, RenderSVGResourceModeFlags, SVGPaintServer&); |
| + |
| + RefPtr<Gradient> m_gradient; |
| + RefPtr<Pattern> m_pattern; |
| + Color m_color; |
|
pdr.
2014/10/09 01:00:50
This makes me a little sad because a paint server
fs
2014/10/09 07:23:08
I'm glad you asked =). It'd be possible to add a c
fs
2014/10/10 13:08:58
I haven't done anything about this. If "people" fi
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // SVGPaintServer_h |