| 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 29 matching lines...) Expand all Loading... |
| 40 // This shim is necessary because ImageBufferSurfaces are not allowed to be | 40 // This shim is necessary because ImageBufferSurfaces are not allowed to be |
| 41 // RefCounted. | 41 // RefCounted. |
| 42 class Canvas2DImageBufferSurface final : public ImageBufferSurface { | 42 class Canvas2DImageBufferSurface final : public ImageBufferSurface { |
| 43 public: | 43 public: |
| 44 Canvas2DImageBufferSurface( | 44 Canvas2DImageBufferSurface( |
| 45 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider, | 45 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider, |
| 46 const IntSize& size, | 46 const IntSize& size, |
| 47 int msaaSampleCount, | 47 int msaaSampleCount, |
| 48 OpacityMode opacityMode, | 48 OpacityMode opacityMode, |
| 49 Canvas2DLayerBridge::AccelerationMode accelerationMode, | 49 Canvas2DLayerBridge::AccelerationMode accelerationMode, |
| 50 sk_sp<SkColorSpace> colorSpace) | 50 sk_sp<SkColorSpace> colorSpace, |
| 51 : ImageBufferSurface(size, opacityMode, colorSpace), | 51 SkColorType colorType) |
| 52 : ImageBufferSurface(size, opacityMode, colorSpace, colorType), |
| 52 m_layerBridge( | 53 m_layerBridge( |
| 53 adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), | 54 adoptRef(new Canvas2DLayerBridge(std::move(contextProvider), |
| 54 size, | 55 size, |
| 55 msaaSampleCount, | 56 msaaSampleCount, |
| 56 opacityMode, | 57 opacityMode, |
| 57 accelerationMode, | 58 accelerationMode, |
| 58 colorSpace))) { | 59 std::move(colorSpace), |
| 60 colorType))) { |
| 59 init(); | 61 init(); |
| 60 } | 62 } |
| 61 | 63 |
| 62 Canvas2DImageBufferSurface(PassRefPtr<Canvas2DLayerBridge> bridge, | 64 Canvas2DImageBufferSurface(PassRefPtr<Canvas2DLayerBridge> bridge, |
| 63 const IntSize& size) | 65 const IntSize& size) |
| 64 : ImageBufferSurface(size, bridge->opacityMode(), bridge->colorSpace()), | 66 : ImageBufferSurface(size, |
| 67 bridge->opacityMode(), |
| 68 bridge->colorSpace(), |
| 69 bridge->colorType()), |
| 65 m_layerBridge(std::move(bridge)) { | 70 m_layerBridge(std::move(bridge)) { |
| 66 init(); | 71 init(); |
| 67 } | 72 } |
| 68 | 73 |
| 69 ~Canvas2DImageBufferSurface() override { m_layerBridge->beginDestruction(); } | 74 ~Canvas2DImageBufferSurface() override { m_layerBridge->beginDestruction(); } |
| 70 | 75 |
| 71 // ImageBufferSurface implementation | 76 // ImageBufferSurface implementation |
| 72 void finalizeFrame(const FloatRect& dirtyRect) override { | 77 void finalizeFrame(const FloatRect& dirtyRect) override { |
| 73 m_layerBridge->finalizeFrame(dirtyRect); | 78 m_layerBridge->finalizeFrame(dirtyRect); |
| 74 } | 79 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (isValid()) | 118 if (isValid()) |
| 114 m_layerBridge->flush(); | 119 m_layerBridge->flush(); |
| 115 } | 120 } |
| 116 | 121 |
| 117 RefPtr<Canvas2DLayerBridge> m_layerBridge; | 122 RefPtr<Canvas2DLayerBridge> m_layerBridge; |
| 118 }; | 123 }; |
| 119 | 124 |
| 120 } // namespace blink | 125 } // namespace blink |
| 121 | 126 |
| 122 #endif | 127 #endif |
| OLD | NEW |