Chromium Code Reviews| Index: Source/core/html/canvas/CanvasRenderingContext2D.h |
| diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.h b/Source/core/html/canvas/CanvasRenderingContext2D.h |
| index 0428bdcac6fef5dd5ab1fca4e329b158c4a5ffc5..8e5b8834469f930ea11514b82726b6141d4a2834 100644 |
| --- a/Source/core/html/canvas/CanvasRenderingContext2D.h |
| +++ b/Source/core/html/canvas/CanvasRenderingContext2D.h |
| @@ -112,6 +112,8 @@ public: |
| float globalAlpha() const; |
| void setGlobalAlpha(float); |
| + bool isContextLost() const; |
| + |
| String globalCompositeOperation() const; |
| void setGlobalCompositeOperation(const String&); |
| @@ -233,6 +235,9 @@ public: |
| void drawFocusIfNeeded(Element*); |
| bool drawCustomFocusRing(Element*); |
| + void loseContext(); |
| + void restoreContext(); |
| + |
| private: |
| struct State FINAL : CSSFontSelectorClient { |
| State(); |
| @@ -285,6 +290,10 @@ private: |
| void applyShadow(); |
| bool shouldDrawShadows() const; |
| + void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*); |
| + void dispatchContextRestoredEvent(Timer<CanvasRenderingContext2D>*); |
| + void tryRestoreSurfaceEvent(Timer<CanvasRenderingContext2D>*); |
|
Stephen White
2014/03/25 23:25:04
Naming nit: does "surface" really have a meaning a
|
| + |
| bool computeDirtyRect(const FloatRect& localBounds, FloatRect*); |
| bool computeDirtyRect(const FloatRect& localBounds, const FloatRect& transformedClipBounds, FloatRect*); |
| void didDraw(const FloatRect&); |
| @@ -335,7 +344,14 @@ private: |
| Vector<State, 1> m_stateStack; |
| bool m_usesCSSCompatibilityParseMode; |
| bool m_hasAlpha; |
| + bool m_isContextLost; |
| + bool m_contextRestorable; |
| + Canvas2DContextStorage m_storageMode; |
| MutableStylePropertyMap m_fetchedFonts; |
| + unsigned m_tryRestoreSurfaceAttemptCount; |
| + Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
| + Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
| + Timer<CanvasRenderingContext2D> m_tryRestoreSurfaceEventTimer; |
| }; |
| DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, context->is2d(), context.is2d()); |