OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 String color() const { ASSERT(m_type == ColorRGBA); return Color(m_rgba)
.serialized(); } | 49 String color() const { ASSERT(m_type == ColorRGBA); return Color(m_rgba)
.serialized(); } |
50 CanvasGradient* canvasGradient() const { return m_gradient.get(); } | 50 CanvasGradient* canvasGradient() const { return m_gradient.get(); } |
51 CanvasPattern* canvasPattern() const { return m_pattern.get(); } | 51 CanvasPattern* canvasPattern() const { return m_pattern.get(); } |
52 | 52 |
53 void applyFillColor(GraphicsContext*); | 53 void applyFillColor(GraphicsContext*); |
54 void applyStrokeColor(GraphicsContext*); | 54 void applyStrokeColor(GraphicsContext*); |
55 | 55 |
56 bool isEquivalentRGBA(RGBA32 rgba) const { return m_type == ColorRGBA &&
m_rgba == rgba; } | 56 bool isEquivalentRGBA(RGBA32 rgba) const { return m_type == ColorRGBA &&
m_rgba == rgba; } |
57 | 57 |
58 void trace(Visitor*); | 58 DECLARE_TRACE(); |
59 | 59 |
60 private: | 60 private: |
61 enum Type { ColorRGBA, Gradient, ImagePattern }; | 61 enum Type { ColorRGBA, Gradient, ImagePattern }; |
62 | 62 |
63 CanvasStyle(RGBA32 rgba); | 63 CanvasStyle(RGBA32 rgba); |
64 CanvasStyle(PassRefPtrWillBeRawPtr<CanvasGradient>); | 64 CanvasStyle(PassRefPtrWillBeRawPtr<CanvasGradient>); |
65 CanvasStyle(PassRefPtrWillBeRawPtr<CanvasPattern>); | 65 CanvasStyle(PassRefPtrWillBeRawPtr<CanvasPattern>); |
66 | 66 |
67 Type m_type; | 67 Type m_type; |
68 RGBA32 m_rgba; | 68 RGBA32 m_rgba; |
69 | 69 |
70 RefPtrWillBeMember<CanvasGradient> m_gradient; | 70 RefPtrWillBeMember<CanvasGradient> m_gradient; |
71 RefPtrWillBeMember<CanvasPattern> m_pattern; | 71 RefPtrWillBeMember<CanvasPattern> m_pattern; |
72 }; | 72 }; |
73 | 73 |
74 bool parseColorOrCurrentColor(RGBA32& parsedColor, const String& colorString
, HTMLCanvasElement*); | 74 bool parseColorOrCurrentColor(RGBA32& parsedColor, const String& colorString
, HTMLCanvasElement*); |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
77 | 77 |
78 #endif | 78 #endif |
OLD | NEW |