OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef Canvas2DImageBufferSurface_h | 31 #ifndef Canvas2DImageBufferSurface_h |
32 #define Canvas2DImageBufferSurface_h | 32 #define Canvas2DImageBufferSurface_h |
33 | 33 |
34 #include "Image.h" | |
Justin Novosad
2014/07/29 14:56:52
Avoid unnecessary dependency in header -> use forw
Rémi Piotaix
2014/07/29 17:18:22
Done.
| |
34 #include "platform/graphics/Canvas2DLayerBridge.h" | 35 #include "platform/graphics/Canvas2DLayerBridge.h" |
35 #include "platform/graphics/ImageBufferSurface.h" | 36 #include "platform/graphics/ImageBufferSurface.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 // This shim necessary because ImageBufferSurfaces are not allowed to be RefCoun ted | 40 // This shim necessary because ImageBufferSurfaces are not allowed to be RefCoun ted |
40 class Canvas2DImageBufferSurface FINAL : public ImageBufferSurface { | 41 class Canvas2DImageBufferSurface FINAL : public ImageBufferSurface { |
41 public: | 42 public: |
42 Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = No nOpaque, int msaaSampleCount = 1) | 43 Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = No nOpaque, int msaaSampleCount = 1) |
43 : ImageBufferSurface(size, opacityMode) | 44 : ImageBufferSurface(size, opacityMode) |
(...skipping 13 matching lines...) Expand all Loading... | |
57 virtual void willReadback() OVERRIDE { m_layerBridge->willReadback(); } | 58 virtual void willReadback() OVERRIDE { m_layerBridge->willReadback(); } |
58 virtual SkCanvas* canvas() const OVERRIDE { return m_layerBridge->canvas(); } | 59 virtual SkCanvas* canvas() const OVERRIDE { return m_layerBridge->canvas(); } |
59 virtual bool isValid() const OVERRIDE { return m_layerBridge && m_layerBridg e->checkSurfaceValid(); } | 60 virtual bool isValid() const OVERRIDE { return m_layerBridge && m_layerBridg e->checkSurfaceValid(); } |
60 virtual bool restore() OVERRIDE { return m_layerBridge->restoreSurface(); } | 61 virtual bool restore() OVERRIDE { return m_layerBridge->restoreSurface(); } |
61 virtual blink::WebLayer* layer() const OVERRIDE { return m_layerBridge->laye r(); } | 62 virtual blink::WebLayer* layer() const OVERRIDE { return m_layerBridge->laye r(); } |
62 virtual Platform3DObject getBackingTexture() const OVERRIDE { return m_layer Bridge->getBackingTexture(); } | 63 virtual Platform3DObject getBackingTexture() const OVERRIDE { return m_layer Bridge->getBackingTexture(); } |
63 virtual bool isAccelerated() const OVERRIDE { return m_layerBridge->isAccele rated(); } | 64 virtual bool isAccelerated() const OVERRIDE { return m_layerBridge->isAccele rated(); } |
64 virtual void setIsHidden(bool hidden) OVERRIDE { m_layerBridge->setIsHidden( hidden); } | 65 virtual void setIsHidden(bool hidden) OVERRIDE { m_layerBridge->setIsHidden( hidden); } |
65 virtual void setImageBuffer(ImageBuffer* imageBuffer) OVERRIDE { m_layerBrid ge->setImageBuffer(imageBuffer); } | 66 virtual void setImageBuffer(ImageBuffer* imageBuffer) OVERRIDE { m_layerBrid ge->setImageBuffer(imageBuffer); } |
66 | 67 |
68 virtual PassRefPtr<SkImage> newImageSnapshot() const OVERRIDE { return m_lay erBridge->newImageSnapshot(); } | |
Justin Novosad
2014/07/29 14:56:52
You will have to move implementation to .cpp if Im
Rémi Piotaix
2014/07/29 17:18:22
Canvas2DLayerBridge already include SkImage
| |
67 private: | 69 private: |
68 RefPtr<Canvas2DLayerBridge> m_layerBridge; | 70 RefPtr<Canvas2DLayerBridge> m_layerBridge; |
69 }; | 71 }; |
70 | 72 |
71 } | 73 } |
72 | 74 |
73 #endif | 75 #endif |
OLD | NEW |