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

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

Issue 638933002: Introduce SVGPaintServer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean away stuff again. Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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 SVGPaintServer_h
6 #define SVGPaintServer_h
7
8 #include "core/rendering/svg/RenderSVGResource.h"
9 #include "platform/graphics/Gradient.h"
10 #include "platform/graphics/Pattern.h"
11
12 namespace blink {
13
14 class GraphicsContext;
15 class GraphicsContextStateSaver;
16
17 class SVGPaintServer {
18 public:
19 explicit SVGPaintServer(Color);
20 explicit SVGPaintServer(PassRefPtr<Gradient>);
21 explicit SVGPaintServer(PassRefPtr<Pattern>);
22
23 static SVGPaintServer invalid() { return SVGPaintServer(Color::transparent); }
24
25 // Update the GC state (on |stateSaver.context()|) for painting |renderer|
26 // using |style|. |resourceModeFlags| is used to decide between fill/stroke.
27 // Previous state will be saved (if needed) using |stateSaver|.
28 static bool updateGraphicsContext(GraphicsContextStateSaver&, RenderStyle*, RenderObject&, RenderSVGResourceModeFlags);
29
30 void apply(GraphicsContext&, RenderSVGResourceMode, GraphicsContextStateSave r* = 0);
31
32 bool isValid() const { return m_color != Color::transparent; }
33
34 private:
35 static SVGPaintServer requestForRenderer(RenderObject&, RenderStyle*, Render SVGResourceModeFlags);
36
37 RefPtr<Gradient> m_gradient;
38 RefPtr<Pattern> m_pattern;
39 Color m_color;
40 };
41
42 } // namespace blink
43
44 #endif // SVGPaintServer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698