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