| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CanvasRenderingContext2DState_h | 5 #ifndef CanvasRenderingContext2DState_h |
| 6 #define CanvasRenderingContext2DState_h | 6 #define CanvasRenderingContext2DState_h |
| 7 | 7 |
| 8 #include "core/css/CSSFontSelectorClient.h" | 8 #include "core/css/CSSFontSelectorClient.h" |
| 9 #include "core/html/canvas/ClipList.h" | 9 #include "core/html/canvas/ClipList.h" |
| 10 #include "platform/fonts/Font.h" | 10 #include "platform/fonts/Font.h" |
| 11 #include "platform/transforms/AffineTransform.h" | 11 #include "platform/transforms/AffineTransform.h" |
| 12 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class CanvasStyle; | 16 class CanvasStyle; |
| 17 class CSSValue; |
| 18 class Element; |
| 17 | 19 |
| 18 class CanvasRenderingContext2DState final : public NoBaseWillBeGarbageCollectedF
inalized<CanvasRenderingContext2DState>, public CSSFontSelectorClient { | 20 class CanvasRenderingContext2DState final : public NoBaseWillBeGarbageCollectedF
inalized<CanvasRenderingContext2DState>, public CSSFontSelectorClient { |
| 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2DState); | 21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2DState); |
| 20 public: | 22 public: |
| 21 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2DState> create() | 23 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2DState> create() |
| 22 { | 24 { |
| 23 return adoptPtrWillBeNoop(new CanvasRenderingContext2DState); | 25 return adoptPtrWillBeNoop(new CanvasRenderingContext2DState); |
| 24 } | 26 } |
| 25 | 27 |
| 26 virtual ~CanvasRenderingContext2DState(); | 28 virtual ~CanvasRenderingContext2DState(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 bool hasClip() const { return m_hasClip; } | 73 bool hasClip() const { return m_hasClip; } |
| 72 bool hasComplexClip() const { return m_hasComplexClip; } | 74 bool hasComplexClip() const { return m_hasComplexClip; } |
| 73 void playbackClips(SkCanvas* canvas) const { m_clipList.playback(canvas); } | 75 void playbackClips(SkCanvas* canvas) const { m_clipList.playback(canvas); } |
| 74 | 76 |
| 75 void setFont(const Font&, CSSFontSelector*); | 77 void setFont(const Font&, CSSFontSelector*); |
| 76 const Font& font() const; | 78 const Font& font() const; |
| 77 bool hasRealizedFont() const { return m_realizedFont; } | 79 bool hasRealizedFont() const { return m_realizedFont; } |
| 78 void setUnparsedFont(const String& font) { m_unparsedFont = font; } | 80 void setUnparsedFont(const String& font) { m_unparsedFont = font; } |
| 79 const String& unparsedFont() const { return m_unparsedFont; } | 81 const String& unparsedFont() const { return m_unparsedFont; } |
| 80 | 82 |
| 83 void setFilter(PassRefPtrWillBeRawPtr<CSSValue>); |
| 84 void setUnparsedFilter(const String& filterString) { m_unparsedFilter = filt
erString; } |
| 85 const String& unparsedFilter() const { return m_unparsedFilter; } |
| 86 SkImageFilter* filter(Element*, const Font&) const; |
| 87 |
| 81 void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); | 88 void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); |
| 82 CanvasStyle* strokeStyle() const { return m_strokeStyle.get(); } | 89 CanvasStyle* strokeStyle() const { return m_strokeStyle.get(); } |
| 83 | 90 |
| 84 void setFillStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); | 91 void setFillStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); |
| 85 CanvasStyle* fillStyle() const { return m_fillStyle.get(); } | 92 CanvasStyle* fillStyle() const { return m_fillStyle.get(); } |
| 86 | 93 |
| 87 CanvasStyle* style(PaintType) const; | 94 CanvasStyle* style(PaintType) const; |
| 88 | 95 |
| 89 enum Direction { | 96 enum Direction { |
| 90 DirectionInherit, | 97 DirectionInherit, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 mutable RefPtr<SkImageFilter> m_shadowAndForegroundImageFilter; | 191 mutable RefPtr<SkImageFilter> m_shadowAndForegroundImageFilter; |
| 185 | 192 |
| 186 float m_globalAlpha; | 193 float m_globalAlpha; |
| 187 AffineTransform m_transform; | 194 AffineTransform m_transform; |
| 188 Vector<float> m_lineDash; | 195 Vector<float> m_lineDash; |
| 189 float m_lineDashOffset; | 196 float m_lineDashOffset; |
| 190 | 197 |
| 191 String m_unparsedFont; | 198 String m_unparsedFont; |
| 192 Font m_font; | 199 Font m_font; |
| 193 | 200 |
| 201 String m_unparsedFilter; |
| 202 RefPtrWillBeRawPtr<CSSValue> m_filterValue; |
| 203 mutable RefPtr<SkImageFilter> m_resolvedFilter; |
| 204 |
| 194 // Text state. | 205 // Text state. |
| 195 TextAlign m_textAlign; | 206 TextAlign m_textAlign; |
| 196 TextBaseline m_textBaseline; | 207 TextBaseline m_textBaseline; |
| 197 Direction m_direction; | 208 Direction m_direction; |
| 198 | 209 |
| 199 bool m_realizedFont : 1; | 210 bool m_realizedFont : 1; |
| 200 bool m_isTransformInvertible : 1; | 211 bool m_isTransformInvertible : 1; |
| 201 bool m_hasClip : 1; | 212 bool m_hasClip : 1; |
| 202 bool m_hasComplexClip : 1; | 213 bool m_hasComplexClip : 1; |
| 203 mutable bool m_fillStyleDirty : 1; | 214 mutable bool m_fillStyleDirty : 1; |
| 204 mutable bool m_strokeStyleDirty : 1; | 215 mutable bool m_strokeStyleDirty : 1; |
| 205 mutable bool m_lineDashDirty : 1; | 216 mutable bool m_lineDashDirty : 1; |
| 206 | 217 |
| 207 ClipList m_clipList; | 218 ClipList m_clipList; |
| 208 }; | 219 }; |
| 209 | 220 |
| 210 } // blink | 221 } // blink |
| 211 | 222 |
| 212 #endif | 223 #endif |
| OLD | NEW |