OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv
ed. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 class FloatRect; | 59 class FloatRect; |
60 class GraphicsContext; | 60 class GraphicsContext; |
61 class HTMLCanvasElement; | 61 class HTMLCanvasElement; |
62 class HTMLImageElement; | 62 class HTMLImageElement; |
63 class HTMLVideoElement; | 63 class HTMLVideoElement; |
64 class ImageData; | 64 class ImageData; |
65 class TextMetrics; | 65 class TextMetrics; |
66 | 66 |
67 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<MutableStylePropertySet> >
MutableStylePropertyMap; | 67 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<MutableStylePropertySet> >
MutableStylePropertyMap; |
68 | 68 |
69 class CanvasRenderingContext2D FINAL: public CanvasRenderingContext, public Scri
ptWrappable, public CanvasPathMethods { | 69 class CanvasRenderingContext2D final: public CanvasRenderingContext, public Scri
ptWrappable, public CanvasPathMethods { |
70 DEFINE_WRAPPERTYPEINFO(); | 70 DEFINE_WRAPPERTYPEINFO(); |
71 public: | 71 public: |
72 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2D> create(HTMLCanvasEle
ment* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityP
arseMode) | 72 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2D> create(HTMLCanvasEle
ment* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityP
arseMode) |
73 { | 73 { |
74 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, us
esCSSCompatibilityParseMode)); | 74 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, us
esCSSCompatibilityParseMode)); |
75 } | 75 } |
76 virtual ~CanvasRenderingContext2D(); | 76 virtual ~CanvasRenderingContext2D(); |
77 | 77 |
78 CanvasStyle* strokeStyle() const; | 78 CanvasStyle* strokeStyle() const; |
79 void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); | 79 void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 void addHitRegion(const HitRegionOptions&, ExceptionState&); | 235 void addHitRegion(const HitRegionOptions&, ExceptionState&); |
236 void removeHitRegion(const String& id); | 236 void removeHitRegion(const String& id); |
237 void clearHitRegions(); | 237 void clearHitRegions(); |
238 HitRegion* hitRegionAtPoint(const LayoutPoint&); | 238 HitRegion* hitRegionAtPoint(const LayoutPoint&); |
239 unsigned hitRegionsCount() const; | 239 unsigned hitRegionsCount() const; |
240 | 240 |
241 void loseContext(); | 241 void loseContext(); |
242 void restoreContext(); | 242 void restoreContext(); |
243 | 243 |
244 virtual void trace(Visitor*) OVERRIDE; | 244 virtual void trace(Visitor*) override; |
245 | 245 |
246 private: | 246 private: |
247 enum Direction { | 247 enum Direction { |
248 DirectionInherit, | 248 DirectionInherit, |
249 DirectionRTL, | 249 DirectionRTL, |
250 DirectionLTR | 250 DirectionLTR |
251 }; | 251 }; |
252 | 252 |
253 class State FINAL : public CSSFontSelectorClient { | 253 class State final : public CSSFontSelectorClient { |
254 public: | 254 public: |
255 State(); | 255 State(); |
256 virtual ~State(); | 256 virtual ~State(); |
257 | 257 |
258 State(const State&); | 258 State(const State&); |
259 State& operator=(const State&); | 259 State& operator=(const State&); |
260 | 260 |
261 // CSSFontSelectorClient implementation | 261 // CSSFontSelectorClient implementation |
262 virtual void fontsNeedUpdate(CSSFontSelector*) OVERRIDE; | 262 virtual void fontsNeedUpdate(CSSFontSelector*) override; |
263 | 263 |
264 virtual void trace(Visitor*) OVERRIDE; | 264 virtual void trace(Visitor*) override; |
265 | 265 |
266 unsigned m_unrealizedSaveCount; | 266 unsigned m_unrealizedSaveCount; |
267 | 267 |
268 String m_unparsedStrokeColor; | 268 String m_unparsedStrokeColor; |
269 String m_unparsedFillColor; | 269 String m_unparsedFillColor; |
270 RefPtrWillBeMember<CanvasStyle> m_strokeStyle; | 270 RefPtrWillBeMember<CanvasStyle> m_strokeStyle; |
271 RefPtrWillBeMember<CanvasStyle> m_fillStyle; | 271 RefPtrWillBeMember<CanvasStyle> m_fillStyle; |
272 float m_lineWidth; | 272 float m_lineWidth; |
273 LineCap m_lineCap; | 273 LineCap m_lineCap; |
274 LineJoin m_lineJoin; | 274 LineJoin m_lineJoin; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 template<class T> void fullCanvasCompositedDrawImage(T*, const FloatRect&, c
onst FloatRect&, CompositeOperator); | 350 template<class T> void fullCanvasCompositedDrawImage(T*, const FloatRect&, c
onst FloatRect&, CompositeOperator); |
351 | 351 |
352 void drawFocusIfNeededInternal(const Path&, Element*); | 352 void drawFocusIfNeededInternal(const Path&, Element*); |
353 bool focusRingCallIsValid(const Path&, Element*); | 353 bool focusRingCallIsValid(const Path&, Element*); |
354 void drawFocusRing(const Path&); | 354 void drawFocusRing(const Path&); |
355 | 355 |
356 bool hasClip() { return state().m_hasClip; } | 356 bool hasClip() { return state().m_hasClip; } |
357 | 357 |
358 void validateStateStack(); | 358 void validateStateStack(); |
359 | 359 |
360 virtual bool is2d() const OVERRIDE { return true; } | 360 virtual bool is2d() const override { return true; } |
361 virtual bool isAccelerated() const OVERRIDE; | 361 virtual bool isAccelerated() const override; |
362 virtual bool hasAlpha() const OVERRIDE { return m_hasAlpha; } | 362 virtual bool hasAlpha() const override { return m_hasAlpha; } |
363 virtual void setIsHidden(bool) OVERRIDE; | 363 virtual void setIsHidden(bool) override; |
364 | 364 |
365 virtual bool isTransformInvertible() const OVERRIDE { return state().m_inver
tibleCTM; } | 365 virtual bool isTransformInvertible() const override { return state().m_inver
tibleCTM; } |
366 | 366 |
367 virtual blink::WebLayer* platformLayer() const OVERRIDE; | 367 virtual blink::WebLayer* platformLayer() const override; |
368 TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullp
tr) const; | 368 TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullp
tr) const; |
369 | 369 |
370 WillBeHeapVector<OwnPtrWillBeMember<State> > m_stateStack; | 370 WillBeHeapVector<OwnPtrWillBeMember<State> > m_stateStack; |
371 OwnPtrWillBeMember<HitRegionManager> m_hitRegionManager; | 371 OwnPtrWillBeMember<HitRegionManager> m_hitRegionManager; |
372 bool m_usesCSSCompatibilityParseMode; | 372 bool m_usesCSSCompatibilityParseMode; |
373 bool m_hasAlpha; | 373 bool m_hasAlpha; |
374 bool m_isContextLost; | 374 bool m_isContextLost; |
375 bool m_contextRestorable; | 375 bool m_contextRestorable; |
376 Canvas2DContextStorage m_storageMode; | 376 Canvas2DContextStorage m_storageMode; |
377 MutableStylePropertyMap m_fetchedFonts; | 377 MutableStylePropertyMap m_fetchedFonts; |
378 ListHashSet<String> m_fetchedFontsLRUList; | 378 ListHashSet<String> m_fetchedFontsLRUList; |
379 unsigned m_tryRestoreContextAttemptCount; | 379 unsigned m_tryRestoreContextAttemptCount; |
380 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; | 380 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
381 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; | 381 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
382 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; | 382 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; |
383 }; | 383 }; |
384 | 384 |
385 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 385 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
386 | 386 |
387 } // namespace blink | 387 } // namespace blink |
388 | 388 |
389 #endif // CanvasRenderingContext2D_h | 389 #endif // CanvasRenderingContext2D_h |
OLD | NEW |