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 16 matching lines...) Expand all Loading... |
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 "platform/graphics/Canvas2DLayerBridge.h" | 34 #include "platform/graphics/Canvas2DLayerBridge.h" |
35 #include "platform/graphics/ImageBufferSurface.h" | 35 #include "platform/graphics/ImageBufferSurface.h" |
36 | 36 |
| 37 class SkImage; |
| 38 |
37 namespace blink { | 39 namespace blink { |
38 | 40 |
39 // This shim necessary because ImageBufferSurfaces are not allowed to be RefCoun
ted | 41 // This shim necessary because ImageBufferSurfaces are not allowed to be RefCoun
ted |
40 class Canvas2DImageBufferSurface FINAL : public ImageBufferSurface { | 42 class Canvas2DImageBufferSurface FINAL : public ImageBufferSurface { |
41 public: | 43 public: |
42 Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = No
nOpaque, int msaaSampleCount = 1) | 44 Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = No
nOpaque, int msaaSampleCount = 1) |
43 : ImageBufferSurface(size, opacityMode) | 45 : ImageBufferSurface(size, opacityMode) |
44 , m_layerBridge(Canvas2DLayerBridge::create(size, opacityMode, msaaSampl
eCount)) | 46 , m_layerBridge(Canvas2DLayerBridge::create(size, opacityMode, msaaSampl
eCount)) |
45 { | 47 { |
46 clear(); | 48 clear(); |
(...skipping 10 matching lines...) Expand all Loading... |
57 virtual void willReadback() OVERRIDE { m_layerBridge->willReadback(); } | 59 virtual void willReadback() OVERRIDE { m_layerBridge->willReadback(); } |
58 virtual SkCanvas* canvas() const OVERRIDE { return m_layerBridge->canvas();
} | 60 virtual SkCanvas* canvas() const OVERRIDE { return m_layerBridge->canvas();
} |
59 virtual bool isValid() const OVERRIDE { return m_layerBridge && m_layerBridg
e->checkSurfaceValid(); } | 61 virtual bool isValid() const OVERRIDE { return m_layerBridge && m_layerBridg
e->checkSurfaceValid(); } |
60 virtual bool restore() OVERRIDE { return m_layerBridge->restoreSurface(); } | 62 virtual bool restore() OVERRIDE { return m_layerBridge->restoreSurface(); } |
61 virtual blink::WebLayer* layer() const OVERRIDE { return m_layerBridge->laye
r(); } | 63 virtual blink::WebLayer* layer() const OVERRIDE { return m_layerBridge->laye
r(); } |
62 virtual Platform3DObject getBackingTexture() const OVERRIDE { return m_layer
Bridge->getBackingTexture(); } | 64 virtual Platform3DObject getBackingTexture() const OVERRIDE { return m_layer
Bridge->getBackingTexture(); } |
63 virtual bool isAccelerated() const OVERRIDE { return m_layerBridge->isAccele
rated(); } | 65 virtual bool isAccelerated() const OVERRIDE { return m_layerBridge->isAccele
rated(); } |
64 virtual void setIsHidden(bool hidden) OVERRIDE { m_layerBridge->setIsHidden(
hidden); } | 66 virtual void setIsHidden(bool hidden) OVERRIDE { m_layerBridge->setIsHidden(
hidden); } |
65 virtual void setImageBuffer(ImageBuffer* imageBuffer) OVERRIDE { m_layerBrid
ge->setImageBuffer(imageBuffer); } | 67 virtual void setImageBuffer(ImageBuffer* imageBuffer) OVERRIDE { m_layerBrid
ge->setImageBuffer(imageBuffer); } |
66 | 68 |
| 69 virtual PassRefPtr<SkImage> newImageSnapshot() const OVERRIDE { return m_lay
erBridge->newImageSnapshot(); } |
67 private: | 70 private: |
68 RefPtr<Canvas2DLayerBridge> m_layerBridge; | 71 RefPtr<Canvas2DLayerBridge> m_layerBridge; |
69 }; | 72 }; |
70 | 73 |
71 } | 74 } |
72 | 75 |
73 #endif | 76 #endif |
OLD | NEW |