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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2DState.h

Issue 1093673002: Removing the dependency on GraphicsContext for drawing images in 2D canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 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
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"
(...skipping 12 matching lines...) Expand all
23 DECLARE_VIRTUAL_TRACE(); 23 DECLARE_VIRTUAL_TRACE();
24 24
25 enum ClipListCopyMode { 25 enum ClipListCopyMode {
26 CopyClipList, 26 CopyClipList,
27 DontCopyClipList 27 DontCopyClipList
28 }; 28 };
29 29
30 enum PaintType { 30 enum PaintType {
31 FillPaintType, 31 FillPaintType,
32 StrokePaintType, 32 StrokePaintType,
33 ImagePaintType,
33 }; 34 };
34 35
35 CanvasRenderingContext2DState(const CanvasRenderingContext2DState&, ClipList CopyMode = CopyClipList); 36 CanvasRenderingContext2DState(const CanvasRenderingContext2DState&, ClipList CopyMode = CopyClipList);
36 CanvasRenderingContext2DState& operator=(const CanvasRenderingContext2DState &); 37 CanvasRenderingContext2DState& operator=(const CanvasRenderingContext2DState &);
37 38
38 // CSSFontSelectorClient implementation 39 // CSSFontSelectorClient implementation
39 virtual void fontsNeedUpdate(CSSFontSelector*) override; 40 virtual void fontsNeedUpdate(CSSFontSelector*) override;
40 41
41 bool hasUnrealizedSaves() const { return m_unrealizedSaveCount; } 42 bool hasUnrealizedSaves() const { return m_unrealizedSaveCount; }
42 void save() { ++m_unrealizedSaveCount; } 43 void save() { ++m_unrealizedSaveCount; }
43 void restore() { --m_unrealizedSaveCount; } 44 void restore() { --m_unrealizedSaveCount; }
44 void resetUnrealizedSaveCount() { m_unrealizedSaveCount = 0; } 45 void resetUnrealizedSaveCount() { m_unrealizedSaveCount = 0; }
45 46
46 void setLineDash(const Vector<float>&); 47 void setLineDash(const Vector<float>&);
47 const Vector<float>& lineDash() const { return m_lineDash; } 48 const Vector<float>& lineDash() const { return m_lineDash; }
48 49
50 void setShouldAntialias(bool);
51 bool shouldAntialias() const;
52
49 void setLineDashOffset(float); 53 void setLineDashOffset(float);
50 float lineDashOffset() const { return m_lineDashOffset; } 54 float lineDashOffset() const { return m_lineDashOffset; }
51 55
52 // setTransform returns true iff transform is invertible; 56 // setTransform returns true iff transform is invertible;
53 void setTransform(const AffineTransform&); 57 void setTransform(const AffineTransform&);
54 void resetTransform(); 58 void resetTransform();
55 AffineTransform transform() const { return m_transform; } 59 AffineTransform transform() const { return m_transform; }
56 bool isTransformInvertible() const { return m_isTransformInvertible; } 60 bool isTransformInvertible() const { return m_isTransformInvertible; }
57 61
58 void clipPath(const SkPath&, AntiAliasingMode); 62 void clipPath(const SkPath&, AntiAliasingMode);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 154
151 unsigned m_unrealizedSaveCount; 155 unsigned m_unrealizedSaveCount;
152 156
153 String m_unparsedStrokeColor; 157 String m_unparsedStrokeColor;
154 String m_unparsedFillColor; 158 String m_unparsedFillColor;
155 RefPtrWillBeMember<CanvasStyle> m_strokeStyle; 159 RefPtrWillBeMember<CanvasStyle> m_strokeStyle;
156 RefPtrWillBeMember<CanvasStyle> m_fillStyle; 160 RefPtrWillBeMember<CanvasStyle> m_fillStyle;
157 161
158 mutable SkPaint m_strokePaint; 162 mutable SkPaint m_strokePaint;
159 mutable SkPaint m_fillPaint; 163 mutable SkPaint m_fillPaint;
164 mutable SkPaint m_imagePaint;
160 165
161 FloatSize m_shadowOffset; 166 FloatSize m_shadowOffset;
162 float m_shadowBlur; 167 float m_shadowBlur;
163 SkColor m_shadowColor; 168 SkColor m_shadowColor;
164 mutable RefPtr<SkDrawLooper> m_emptyDrawLooper; 169 mutable RefPtr<SkDrawLooper> m_emptyDrawLooper;
165 mutable RefPtr<SkDrawLooper> m_shadowOnlyDrawLooper; 170 mutable RefPtr<SkDrawLooper> m_shadowOnlyDrawLooper;
166 mutable RefPtr<SkDrawLooper> m_shadowAndForegroundDrawLooper; 171 mutable RefPtr<SkDrawLooper> m_shadowAndForegroundDrawLooper;
167 mutable RefPtr<SkImageFilter> m_shadowOnlyImageFilter; 172 mutable RefPtr<SkImageFilter> m_shadowOnlyImageFilter;
168 mutable RefPtr<SkImageFilter> m_shadowAndForegroundImageFilter; 173 mutable RefPtr<SkImageFilter> m_shadowAndForegroundImageFilter;
169 174
(...skipping 17 matching lines...) Expand all
187 mutable bool m_fillStyleDirty : 1; 192 mutable bool m_fillStyleDirty : 1;
188 mutable bool m_strokeStyleDirty : 1; 193 mutable bool m_strokeStyleDirty : 1;
189 mutable bool m_lineDashDirty : 1; 194 mutable bool m_lineDashDirty : 1;
190 195
191 ClipList m_clipList; 196 ClipList m_clipList;
192 }; 197 };
193 198
194 } // blink 199 } // blink
195 200
196 #endif 201 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698