OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 OffscreenCanvasRenderingContext2D_h | 5 #ifndef OffscreenCanvasRenderingContext2D_h |
6 #define OffscreenCanvasRenderingContext2D_h | 6 #define OffscreenCanvasRenderingContext2D_h |
7 | 7 |
8 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 8 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
9 #include "modules/canvas2d/BaseRenderingContext2D.h" | 9 #include "modules/canvas2d/BaseRenderingContext2D.h" |
10 #include "modules/offscreencanvas/OffscreenCanvasRenderingContext.h" | 10 #include "modules/offscreencanvas/OffscreenCanvasRenderingContext.h" |
11 #include "modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h" | 11 #include "modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class MODULES_EXPORT OffscreenCanvasRenderingContext2D final : public OffscreenC
anvasRenderingContext, public BaseRenderingContext2D { | 15 class MODULES_EXPORT OffscreenCanvasRenderingContext2D final : public OffscreenC
anvasRenderingContext, public BaseRenderingContext2D { |
16 DEFINE_WRAPPERTYPEINFO(); | 16 DEFINE_WRAPPERTYPEINFO(); |
17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OffscreenCanvasRenderingContext2D); | 17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OffscreenCanvasRenderingContext2D); |
18 public: | 18 public: |
19 class Factory : public OffscreenCanvasRenderingContextFactory { | 19 class Factory : public OffscreenCanvasRenderingContextFactory { |
20 public: | 20 public: |
21 Factory() {} | 21 Factory() {} |
22 ~Factory() override {} | 22 ~Factory() override {} |
23 | 23 |
24 OffscreenCanvasRenderingContext* create(OffscreenCanvas* canvas, const C
anvasContextCreationAttributes& attrs) override | 24 OffscreenCanvasRenderingContext* create(OffscreenCanvas* canvas, const C
anvasContextCreationAttributes& attrs) override |
25 { | 25 { |
26 return new OffscreenCanvasRenderingContext2D(canvas, attrs); | 26 return new OffscreenCanvasRenderingContext2D(canvas, attrs); |
27 } | 27 } |
28 | 28 |
29 OffscreenCanvasRenderingContext::ContextType contextType() const overrid
e | 29 OffscreenCanvasRenderingContext::ContextType getContextType() const over
ride |
30 { | 30 { |
31 return OffscreenCanvasRenderingContext::Context2d; | 31 return OffscreenCanvasRenderingContext::Context2d; |
32 } | 32 } |
33 | 33 |
34 void onError(OffscreenCanvas* canvas, const String& error) override {} | 34 void onError(OffscreenCanvas* canvas, const String& error) override {} |
35 }; | 35 }; |
36 | 36 |
37 // OffscreenCanvasRenderingContext implementation | 37 // OffscreenCanvasRenderingContext implementation |
38 ~OffscreenCanvasRenderingContext2D() override; | 38 ~OffscreenCanvasRenderingContext2D() override; |
39 ContextType contextType() const override { return Context2d; } | 39 ContextType getContextType() const override { return Context2d; } |
40 bool is2d() const override { return true; } | 40 bool is2d() const override { return true; } |
41 | 41 |
42 // BaseRenderingContext2D implementation | 42 // BaseRenderingContext2D implementation |
43 bool originClean() const final; | 43 bool originClean() const final; |
44 void setOriginTainted() final; | 44 void setOriginTainted() final; |
45 bool wouldTaintOrigin(CanvasImageSource*) final; | 45 bool wouldTaintOrigin(CanvasImageSource*) final; |
46 | 46 |
47 int width() const final; | 47 int width() const final; |
48 int height() const final; | 48 int height() const final; |
49 | 49 |
(...skipping 21 matching lines...) Expand all Loading... |
71 OffscreenCanvasRenderingContext2D(OffscreenCanvas*, const CanvasContextCreat
ionAttributes& attrs); | 71 OffscreenCanvasRenderingContext2D(OffscreenCanvas*, const CanvasContextCreat
ionAttributes& attrs); |
72 DECLARE_VIRTUAL_TRACE(); | 72 DECLARE_VIRTUAL_TRACE(); |
73 | 73 |
74 private: | 74 private: |
75 bool m_hasAlpha; | 75 bool m_hasAlpha; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace blink | 78 } // namespace blink |
79 | 79 |
80 #endif // OffscreenCanvasRenderingContext2D_h | 80 #endif // OffscreenCanvasRenderingContext2D_h |
OLD | NEW |