| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 class HitRegionOptions; | 57 class HitRegionOptions; |
| 58 class HitRegionManager; | 58 class HitRegionManager; |
| 59 class Path2D; | 59 class Path2D; |
| 60 class SVGMatrixTearOff; | 60 class SVGMatrixTearOff; |
| 61 class TextMetrics; | 61 class TextMetrics; |
| 62 | 62 |
| 63 typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmap Canva
sImageSourceUnion; | 63 typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrImageBitmap Canva
sImageSourceUnion; |
| 64 | 64 |
| 65 class MODULES_EXPORT CanvasRenderingContext2D final : public CanvasRenderingCont
ext, public BaseRenderingContext2D, public WebThread::TaskObserver, public SVGRe
sourceClient { | 65 class MODULES_EXPORT CanvasRenderingContext2D final : public CanvasRenderingCont
ext, public BaseRenderingContext2D, public WebThread::TaskObserver, public SVGRe
sourceClient { |
| 66 DEFINE_WRAPPERTYPEINFO(); | 66 DEFINE_WRAPPERTYPEINFO(); |
| 67 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2D); | 67 USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2D); |
| 68 WILL_BE_USING_PRE_FINALIZER(CanvasRenderingContext2D, dispose); | 68 USING_PRE_FINALIZER(CanvasRenderingContext2D, dispose); |
| 69 public: | 69 public: |
| 70 class Factory : public CanvasRenderingContextFactory { | 70 class Factory : public CanvasRenderingContextFactory { |
| 71 WTF_MAKE_NONCOPYABLE(Factory); | 71 WTF_MAKE_NONCOPYABLE(Factory); |
| 72 public: | 72 public: |
| 73 Factory() {} | 73 Factory() {} |
| 74 ~Factory() override {} | 74 ~Factory() override {} |
| 75 | 75 |
| 76 PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement*
canvas, const CanvasContextCreationAttributes& attrs, Document& document) overr
ide | 76 RawPtr<CanvasRenderingContext> create(HTMLCanvasElement* canvas, const C
anvasContextCreationAttributes& attrs, Document& document) override |
| 77 { | 77 { |
| 78 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs
, document)); | 78 return new CanvasRenderingContext2D(canvas, attrs, document); |
| 79 } | 79 } |
| 80 CanvasRenderingContext::ContextType getContextType() const override { re
turn CanvasRenderingContext::Context2d; } | 80 CanvasRenderingContext::ContextType getContextType() const override { re
turn CanvasRenderingContext::Context2d; } |
| 81 void onError(HTMLCanvasElement*, const String& error) override { } | 81 void onError(HTMLCanvasElement*, const String& error) override { } |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 ~CanvasRenderingContext2D() override; | 84 ~CanvasRenderingContext2D() override; |
| 85 | 85 |
| 86 void setCanvasGetContextResult(RenderingContext&) final; | 86 void setCanvasGetContextResult(RenderingContext&) final; |
| 87 | 87 |
| 88 bool isContextLost() const override; | 88 bool isContextLost() const override; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 bool isAccelerated() const override; | 198 bool isAccelerated() const override; |
| 199 bool hasAlpha() const override { return m_hasAlpha; } | 199 bool hasAlpha() const override { return m_hasAlpha; } |
| 200 void setIsHidden(bool) override; | 200 void setIsHidden(bool) override; |
| 201 void stop() final; | 201 void stop() final; |
| 202 DECLARE_VIRTUAL_TRACE(); | 202 DECLARE_VIRTUAL_TRACE(); |
| 203 | 203 |
| 204 virtual bool isTransformInvertible() const; | 204 virtual bool isTransformInvertible() const; |
| 205 | 205 |
| 206 WebLayer* platformLayer() const override; | 206 WebLayer* platformLayer() const override; |
| 207 | 207 |
| 208 PersistentWillBeMember<HitRegionManager> m_hitRegionManager; | 208 Member<HitRegionManager> m_hitRegionManager; |
| 209 bool m_hasAlpha; | 209 bool m_hasAlpha; |
| 210 LostContextMode m_contextLostMode; | 210 LostContextMode m_contextLostMode; |
| 211 bool m_contextRestorable; | 211 bool m_contextRestorable; |
| 212 unsigned m_tryRestoreContextAttemptCount; | 212 unsigned m_tryRestoreContextAttemptCount; |
| 213 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; | 213 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
| 214 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; | 214 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
| 215 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; | 215 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; |
| 216 | 216 |
| 217 HashMap<String, Font> m_fontsResolvedUsingCurrentStyle; | 217 HashMap<String, Font> m_fontsResolvedUsingCurrentStyle; |
| 218 bool m_pruneLocalFontCacheScheduled; | 218 bool m_pruneLocalFontCacheScheduled; |
| 219 ListHashSet<String> m_fontLRUList; | 219 ListHashSet<String> m_fontLRUList; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 222 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
| 223 | 223 |
| 224 } // namespace blink | 224 } // namespace blink |
| 225 | 225 |
| 226 #endif // CanvasRenderingContext2D_h | 226 #endif // CanvasRenderingContext2D_h |
| OLD | NEW |