| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 SkCanvas* drawingCanvas() const final; | 60 SkCanvas* drawingCanvas() const final; |
| 61 SkCanvas* existingDrawingCanvas() const final; | 61 SkCanvas* existingDrawingCanvas() const final; |
| 62 void disableDeferral(DisableDeferralReason) final; | 62 void disableDeferral(DisableDeferralReason) final; |
| 63 | 63 |
| 64 AffineTransform baseTransform() const final; | 64 AffineTransform baseTransform() const final; |
| 65 void didDraw(const SkIRect& dirtyRect) final; | 65 void didDraw(const SkIRect& dirtyRect) final; |
| 66 | 66 |
| 67 bool stateHasFilter() final; | 67 bool stateHasFilter() final; |
| 68 SkImageFilter* stateGetFilter() final; | 68 SkImageFilter* stateGetFilter() final; |
| 69 void snapshotStateForFilter() final { } | 69 void snapshotStateForFilter() final { } |
| 70 void setFilter(const String&); |
| 70 | 71 |
| 71 void validateStateStack() final; | 72 void validateStateStack() final; |
| 72 | 73 |
| 73 bool hasAlpha() const final { return creationAttributes().alpha(); } | 74 bool hasAlpha() const final { return creationAttributes().alpha(); } |
| 74 bool isContextLost() const override; | 75 bool isContextLost() const override; |
| 75 | 76 |
| 76 ImageBitmap* transferToImageBitmap(ExceptionState&) final; | 77 ImageBitmap* transferToImageBitmap(ExceptionState&) final; |
| 77 | 78 |
| 78 protected: | 79 protected: |
| 79 OffscreenCanvasRenderingContext2D(ScriptState*, OffscreenCanvas*, const Canv
asContextCreationAttributes& attrs); | 80 OffscreenCanvasRenderingContext2D(ScriptState*, OffscreenCanvas*, const Canv
asContextCreationAttributes& attrs); |
| 80 DECLARE_VIRTUAL_TRACE(); | 81 DECLARE_VIRTUAL_TRACE(); |
| 81 | 82 |
| 82 private: | 83 private: |
| 83 bool m_needsMatrixClipRestore = false; | 84 bool m_needsMatrixClipRestore = false; |
| 84 std::unique_ptr<ImageBuffer> m_imageBuffer; | 85 std::unique_ptr<ImageBuffer> m_imageBuffer; |
| 85 | 86 |
| 86 bool isPaintable() const final; | 87 bool isPaintable() const final; |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 DEFINE_TYPE_CASTS(OffscreenCanvasRenderingContext2D, CanvasRenderingContext, con
text, | 90 DEFINE_TYPE_CASTS(OffscreenCanvasRenderingContext2D, CanvasRenderingContext, con
text, |
| 90 context->is2d() && context->getOffscreenCanvas(), | 91 context->is2d() && context->getOffscreenCanvas(), |
| 91 context.is2d() && context.getOffscreenCanvas()); | 92 context.is2d() && context.getOffscreenCanvas()); |
| 92 | 93 |
| 93 } // namespace blink | 94 } // namespace blink |
| 94 | 95 |
| 95 #endif // OffscreenCanvasRenderingContext2D_h | 96 #endif // OffscreenCanvasRenderingContext2D_h |
| OLD | NEW |