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 ImageBitmapRenderingContext_h | 5 #ifndef ImageBitmapRenderingContext_h |
6 #define ImageBitmapRenderingContext_h | 6 #define ImageBitmapRenderingContext_h |
7 | 7 |
8 #include "core/html/canvas/CanvasRenderingContext.h" | 8 #include "core/html/canvas/CanvasRenderingContext.h" |
9 #include "core/html/canvas/CanvasRenderingContextFactory.h" | 9 #include "core/html/canvas/CanvasRenderingContextFactory.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // Script API | 31 // Script API |
32 void transferImageBitmap(ImageBitmap*); | 32 void transferImageBitmap(ImageBitmap*); |
33 | 33 |
34 // CanvasRenderingContext implementation | 34 // CanvasRenderingContext implementation |
35 ContextType getContextType() const override { return CanvasRenderingContext:
:ContextImageBitmap; } | 35 ContextType getContextType() const override { return CanvasRenderingContext:
:ContextImageBitmap; } |
36 bool hasAlpha() const override { return m_hasAlpha; } | 36 bool hasAlpha() const override { return m_hasAlpha; } |
37 void setIsHidden(bool) override { } | 37 void setIsHidden(bool) override { } |
38 bool isContextLost() const override { return false; } | 38 bool isContextLost() const override { return false; } |
39 bool paint(GraphicsContext&, const IntRect&) override; | 39 bool paint(GraphicsContext&, const IntRect&) override; |
| 40 void setCanvasGetContextResult(RenderingContext&) final; |
40 | 41 |
41 // TODO(junov): Implement GPU accelerated rendering using a layer bridge | 42 // TODO(junov): Implement GPU accelerated rendering using a layer bridge |
42 WebLayer* platformLayer() const override { return nullptr; } | 43 WebLayer* platformLayer() const override { return nullptr; } |
43 // TODO(junov): handle lost contexts when content is GPU-backed | 44 // TODO(junov): handle lost contexts when content is GPU-backed |
44 void loseContext(LostContextMode) override { } | 45 void loseContext(LostContextMode) override { } |
45 | 46 |
46 void stop() override; | 47 void stop() override; |
47 | 48 |
48 virtual ~ImageBitmapRenderingContext(); | 49 virtual ~ImageBitmapRenderingContext(); |
49 | 50 |
50 private: | 51 private: |
51 ImageBitmapRenderingContext(HTMLCanvasElement*, CanvasContextCreationAttribu
tes, Document&); | 52 ImageBitmapRenderingContext(HTMLCanvasElement*, CanvasContextCreationAttribu
tes, Document&); |
52 | 53 |
53 bool m_hasAlpha; | 54 bool m_hasAlpha; |
54 RefPtr<Image> m_image; | 55 RefPtr<Image> m_image; |
55 }; | 56 }; |
56 | 57 |
57 } // blink | 58 } // blink |
58 | 59 |
59 #endif | 60 #endif |
OLD | NEW |