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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class ExceptionState; | 56 class ExceptionState; |
57 class FloatRect; | 57 class FloatRect; |
58 class GraphicsContext; | 58 class GraphicsContext; |
59 class HTMLCanvasElement; | 59 class HTMLCanvasElement; |
60 class HTMLImageElement; | 60 class HTMLImageElement; |
61 class HTMLVideoElement; | 61 class HTMLVideoElement; |
62 class ImageBitmap; | 62 class ImageBitmap; |
63 class ImageData; | 63 class ImageData; |
64 class TextMetrics; | 64 class TextMetrics; |
65 | 65 |
66 typedef WillBePersistentHeapHashMap<String, RefPtrWillBeMember<MutableStylePrope
rtySet> > MutableStylePropertyMap; | 66 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<MutableStylePropertySet> >
MutableStylePropertyMap; |
67 | 67 |
68 class CanvasRenderingContext2D FINAL: public ScriptWrappable, public CanvasRende
ringContext, public CanvasPathMethods { | 68 class CanvasRenderingContext2D FINAL: public CanvasRenderingContext, public Scri
ptWrappable, public CanvasPathMethods { |
69 public: | 69 public: |
70 static PassOwnPtr<CanvasRenderingContext2D> create(HTMLCanvasElement* canvas
, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityParseMode) | 70 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2D> create(HTMLCanvasEle
ment* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityP
arseMode) |
71 { | 71 { |
72 return adoptPtr(new CanvasRenderingContext2D(canvas, attrs, usesCSSCompa
tibilityParseMode)); | 72 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, us
esCSSCompatibilityParseMode)); |
73 } | 73 } |
74 virtual ~CanvasRenderingContext2D(); | 74 virtual ~CanvasRenderingContext2D(); |
75 | 75 |
76 CanvasStyle* strokeStyle() const; | 76 CanvasStyle* strokeStyle() const; |
77 void setStrokeStyle(PassRefPtr<CanvasStyle>); | 77 void setStrokeStyle(PassRefPtr<CanvasStyle>); |
78 | 78 |
79 CanvasStyle* fillStyle() const; | 79 CanvasStyle* fillStyle() const; |
80 void setFillStyle(PassRefPtr<CanvasStyle>); | 80 void setFillStyle(PassRefPtr<CanvasStyle>); |
81 | 81 |
82 float lineWidth() const; | 82 float lineWidth() const; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 PassRefPtr<Canvas2DContextAttributes> getContextAttributes() const; | 227 PassRefPtr<Canvas2DContextAttributes> getContextAttributes() const; |
228 | 228 |
229 void drawFocusIfNeeded(Element*); | 229 void drawFocusIfNeeded(Element*); |
230 void drawFocusIfNeeded(Path2D*, Element*); | 230 void drawFocusIfNeeded(Path2D*, Element*); |
231 bool drawCustomFocusRing(Element*); | 231 bool drawCustomFocusRing(Element*); |
232 | 232 |
233 void loseContext(); | 233 void loseContext(); |
234 void restoreContext(); | 234 void restoreContext(); |
235 | 235 |
| 236 virtual void trace(Visitor*) OVERRIDE; |
| 237 |
236 private: | 238 private: |
237 class State FINAL : public CSSFontSelectorClient { | 239 class State FINAL : public CSSFontSelectorClient { |
238 public: | 240 public: |
239 State(); | 241 State(); |
240 virtual ~State(); | 242 virtual ~State(); |
241 | 243 |
242 State(const State&); | 244 State(const State&); |
243 State& operator=(const State&); | 245 State& operator=(const State&); |
244 | 246 |
245 // CSSFontSelectorClient implementation | 247 // CSSFontSelectorClient implementation |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 void drawFocusRing(const Path&); | 338 void drawFocusRing(const Path&); |
337 | 339 |
338 virtual bool is2d() const OVERRIDE { return true; } | 340 virtual bool is2d() const OVERRIDE { return true; } |
339 virtual bool isAccelerated() const OVERRIDE; | 341 virtual bool isAccelerated() const OVERRIDE; |
340 virtual bool hasAlpha() const OVERRIDE { return m_hasAlpha; } | 342 virtual bool hasAlpha() const OVERRIDE { return m_hasAlpha; } |
341 | 343 |
342 virtual bool isTransformInvertible() const OVERRIDE { return state().m_inver
tibleCTM; } | 344 virtual bool isTransformInvertible() const OVERRIDE { return state().m_inver
tibleCTM; } |
343 | 345 |
344 virtual blink::WebLayer* platformLayer() const OVERRIDE; | 346 virtual blink::WebLayer* platformLayer() const OVERRIDE; |
345 | 347 |
346 // FIXME: Oilpan: Make this a vector of embedded State objects rather than p
ointers | 348 WillBeHeapVector<OwnPtrWillBeMember<State> > m_stateStack; |
347 // once we support having vectors with objects using a vtable in oilpan. | |
348 WillBePersistentHeapVector<OwnPtrWillBeMember<State> > m_stateStack; | |
349 bool m_usesCSSCompatibilityParseMode; | 349 bool m_usesCSSCompatibilityParseMode; |
350 bool m_hasAlpha; | 350 bool m_hasAlpha; |
351 bool m_isContextLost; | 351 bool m_isContextLost; |
352 bool m_contextRestorable; | 352 bool m_contextRestorable; |
353 Canvas2DContextStorage m_storageMode; | 353 Canvas2DContextStorage m_storageMode; |
354 MutableStylePropertyMap m_fetchedFonts; | 354 MutableStylePropertyMap m_fetchedFonts; |
355 unsigned m_tryRestoreContextAttemptCount; | 355 unsigned m_tryRestoreContextAttemptCount; |
356 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; | 356 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
357 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; | 357 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
358 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; | 358 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; |
359 }; | 359 }; |
360 | 360 |
361 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 361 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
362 | 362 |
363 } // namespace WebCore | 363 } // namespace WebCore |
364 | 364 |
365 #endif | 365 #endif |
OLD | NEW |