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 "core/html/canvas/CanvasRenderingContext.h" | 9 #include "core/html/canvas/CanvasRenderingContext.h" |
10 #include "core/html/canvas/CanvasRenderingContextFactory.h" | 10 #include "core/html/canvas/CanvasRenderingContextFactory.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 bool stateHasFilter() final; | 75 bool stateHasFilter() final; |
76 SkImageFilter* stateGetFilter() final; | 76 SkImageFilter* stateGetFilter() final; |
77 void snapshotStateForFilter() final {} | 77 void snapshotStateForFilter() final {} |
78 | 78 |
79 void validateStateStack() const final; | 79 void validateStateStack() const final; |
80 | 80 |
81 bool hasAlpha() const final { return creationAttributes().alpha(); } | 81 bool hasAlpha() const final { return creationAttributes().alpha(); } |
82 bool isContextLost() const override; | 82 bool isContextLost() const override; |
83 | 83 |
84 ImageBitmap* transferToImageBitmap(ExceptionState&) final; | 84 ImageBitmap* transferToImageBitmap() final; |
85 | 85 |
86 protected: | 86 protected: |
87 OffscreenCanvasRenderingContext2D( | 87 OffscreenCanvasRenderingContext2D( |
88 ScriptState*, | 88 ScriptState*, |
89 OffscreenCanvas*, | 89 OffscreenCanvas*, |
90 const CanvasContextCreationAttributes& attrs); | 90 const CanvasContextCreationAttributes& attrs); |
91 DECLARE_VIRTUAL_TRACE(); | 91 DECLARE_VIRTUAL_TRACE(); |
92 | 92 |
93 private: | 93 private: |
94 bool m_needsMatrixClipRestore = false; | 94 bool m_needsMatrixClipRestore = false; |
95 std::unique_ptr<ImageBuffer> m_imageBuffer; | 95 std::unique_ptr<ImageBuffer> m_imageBuffer; |
96 | 96 |
97 bool isPaintable() const final; | 97 bool isPaintable() const final; |
98 | 98 |
99 RefPtr<StaticBitmapImage> transferToStaticBitmapImage(); | 99 RefPtr<StaticBitmapImage> transferToStaticBitmapImage(); |
100 }; | 100 }; |
101 | 101 |
102 DEFINE_TYPE_CASTS(OffscreenCanvasRenderingContext2D, | 102 DEFINE_TYPE_CASTS(OffscreenCanvasRenderingContext2D, |
103 CanvasRenderingContext, | 103 CanvasRenderingContext, |
104 context, | 104 context, |
105 context->is2d() && context->getOffscreenCanvas(), | 105 context->is2d() && context->getOffscreenCanvas(), |
106 context.is2d() && context.getOffscreenCanvas()); | 106 context.is2d() && context.getOffscreenCanvas()); |
107 | 107 |
108 } // namespace blink | 108 } // namespace blink |
109 | 109 |
110 #endif // OffscreenCanvasRenderingContext2D_h | 110 #endif // OffscreenCanvasRenderingContext2D_h |
OLD | NEW |