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 21 matching lines...) Expand all Loading... |
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; | 37 class SkImage; |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 // 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 |
42 class Canvas2DImageBufferSurface FINAL : public ImageBufferSurface { | 42 class Canvas2DImageBufferSurface final : public ImageBufferSurface { |
43 public: | 43 public: |
44 Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = No
nOpaque, int msaaSampleCount = 1) | 44 Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = No
nOpaque, int msaaSampleCount = 1) |
45 : ImageBufferSurface(size, opacityMode) | 45 : ImageBufferSurface(size, opacityMode) |
46 , m_layerBridge(Canvas2DLayerBridge::create(size, opacityMode, msaaSampl
eCount)) | 46 , m_layerBridge(Canvas2DLayerBridge::create(size, opacityMode, msaaSampl
eCount)) |
47 { | 47 { |
48 clear(); | 48 clear(); |
49 } | 49 } |
50 | 50 |
51 virtual ~Canvas2DImageBufferSurface() | 51 virtual ~Canvas2DImageBufferSurface() |
52 { | 52 { |
(...skipping 14 matching lines...) Expand all Loading... |
67 virtual void setImageBuffer(ImageBuffer* imageBuffer) override { m_layerBrid
ge->setImageBuffer(imageBuffer); } | 67 virtual void setImageBuffer(ImageBuffer* imageBuffer) override { m_layerBrid
ge->setImageBuffer(imageBuffer); } |
68 | 68 |
69 virtual PassRefPtr<SkImage> newImageSnapshot() const override { return m_lay
erBridge->newImageSnapshot(); } | 69 virtual PassRefPtr<SkImage> newImageSnapshot() const override { return m_lay
erBridge->newImageSnapshot(); } |
70 private: | 70 private: |
71 RefPtr<Canvas2DLayerBridge> m_layerBridge; | 71 RefPtr<Canvas2DLayerBridge> m_layerBridge; |
72 }; | 72 }; |
73 | 73 |
74 } // namespace blink | 74 } // namespace blink |
75 | 75 |
76 #endif | 76 #endif |
OLD | NEW |