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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.h

Issue 1886063002: Make canvas filters use the font size in effect when the filter is set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 4 years, 8 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
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 "modules/canvas2d/ClipList.h" 9 #include "modules/canvas2d/ClipList.h"
10 #include "platform/fonts/Font.h" 10 #include "platform/fonts/Font.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool hasComplexClip() const { return m_hasComplexClip; } 75 bool hasComplexClip() const { return m_hasComplexClip; }
76 void playbackClips(SkCanvas* canvas) const { m_clipList.playback(canvas); } 76 void playbackClips(SkCanvas* canvas) const { m_clipList.playback(canvas); }
77 const SkPath& getCurrentClipPath() const { return m_clipList.getCurrentClipP ath(); } 77 const SkPath& getCurrentClipPath() const { return m_clipList.getCurrentClipP ath(); }
78 78
79 void setFont(const Font&, CSSFontSelector*); 79 void setFont(const Font&, CSSFontSelector*);
80 const Font& font() const; 80 const Font& font() const;
81 bool hasRealizedFont() const { return m_realizedFont; } 81 bool hasRealizedFont() const { return m_realizedFont; }
82 void setUnparsedFont(const String& font) { m_unparsedFont = font; } 82 void setUnparsedFont(const String& font) { m_unparsedFont = font; }
83 const String& unparsedFont() const { return m_unparsedFont; } 83 const String& unparsedFont() const { return m_unparsedFont; }
84 84
85 void setFontForFilter(const Font& font) { m_fontForFilter = font; }
86
85 void setFilter(CSSValue*); 87 void setFilter(CSSValue*);
86 void setUnparsedFilter(const String& filterString) { m_unparsedFilter = filt erString; } 88 void setUnparsedFilter(const String& filterString) { m_unparsedFilter = filt erString; }
87 const String& unparsedFilter() const { return m_unparsedFilter; } 89 const String& unparsedFilter() const { return m_unparsedFilter; }
88 SkImageFilter* getFilter(Element*, const Font&, IntSize canvasSize, CanvasRe nderingContext2D*) const; 90 SkImageFilter* getFilter(Element*, IntSize canvasSize, CanvasRenderingContex t2D*) const;
89 bool hasFilter(Element*, const Font&, IntSize canvasSize, CanvasRenderingCon text2D*) const; 91 bool hasFilter(Element*, IntSize canvasSize, CanvasRenderingContext2D*) cons t;
90 void clearResolvedFilter() const; 92 void clearResolvedFilter() const;
91 93
92 void setStrokeStyle(CanvasStyle*); 94 void setStrokeStyle(CanvasStyle*);
93 CanvasStyle* strokeStyle() const { return m_strokeStyle.get(); } 95 CanvasStyle* strokeStyle() const { return m_strokeStyle.get(); }
94 96
95 void setFillStyle(CanvasStyle*); 97 void setFillStyle(CanvasStyle*);
96 CanvasStyle* fillStyle() const { return m_fillStyle.get(); } 98 CanvasStyle* fillStyle() const { return m_fillStyle.get(); }
97 99
98 CanvasStyle* style(PaintType) const; 100 CanvasStyle* style(PaintType) const;
99 101
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 mutable sk_sp<SkImageFilter> m_shadowOnlyImageFilter; 200 mutable sk_sp<SkImageFilter> m_shadowOnlyImageFilter;
199 mutable sk_sp<SkImageFilter> m_shadowAndForegroundImageFilter; 201 mutable sk_sp<SkImageFilter> m_shadowAndForegroundImageFilter;
200 202
201 double m_globalAlpha; 203 double m_globalAlpha;
202 AffineTransform m_transform; 204 AffineTransform m_transform;
203 Vector<double> m_lineDash; 205 Vector<double> m_lineDash;
204 double m_lineDashOffset; 206 double m_lineDashOffset;
205 207
206 String m_unparsedFont; 208 String m_unparsedFont;
207 Font m_font; 209 Font m_font;
210 Font m_fontForFilter;
208 211
209 String m_unparsedFilter; 212 String m_unparsedFilter;
210 Member<CSSValue> m_filterValue; 213 Member<CSSValue> m_filterValue;
211 mutable sk_sp<SkImageFilter> m_resolvedFilter; 214 mutable sk_sp<SkImageFilter> m_resolvedFilter;
212 215
213 // Text state. 216 // Text state.
214 TextAlign m_textAlign; 217 TextAlign m_textAlign;
215 TextBaseline m_textBaseline; 218 TextBaseline m_textBaseline;
216 Direction m_direction; 219 Direction m_direction;
217 220
218 bool m_realizedFont : 1; 221 bool m_realizedFont : 1;
219 bool m_isTransformInvertible : 1; 222 bool m_isTransformInvertible : 1;
220 bool m_hasClip : 1; 223 bool m_hasClip : 1;
221 bool m_hasComplexClip : 1; 224 bool m_hasComplexClip : 1;
222 mutable bool m_fillStyleDirty : 1; 225 mutable bool m_fillStyleDirty : 1;
223 mutable bool m_strokeStyleDirty : 1; 226 mutable bool m_strokeStyleDirty : 1;
224 mutable bool m_lineDashDirty : 1; 227 mutable bool m_lineDashDirty : 1;
225 228
226 bool m_imageSmoothingEnabled; 229 bool m_imageSmoothingEnabled;
227 SkFilterQuality m_imageSmoothingQuality; 230 SkFilterQuality m_imageSmoothingQuality;
228 231
229 ClipList m_clipList; 232 ClipList m_clipList;
230 }; 233 };
231 234
232 } // namespace blink 235 } // namespace blink
233 236
234 #endif 237 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698