| Index: third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h
|
| diff --git a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h
|
| index de6d5c82e871e0d7d510089d5f3fa163c9938213..92565e250083aafe6eec554a1b5b55d8e0587104 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h
|
| +++ b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h
|
| @@ -7,12 +7,13 @@
|
|
|
| #include "base/memory/ref_counted.h"
|
| #include "cc/surfaces/surface_id.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
| #include "platform/PlatformExport.h"
|
| #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom-blink.h"
|
| #include <memory>
|
|
|
| namespace cc {
|
| -class SurfaceLayer;
|
| +class Layer;
|
| struct SurfaceSequence;
|
| } // namespace cc
|
|
|
| @@ -20,22 +21,43 @@ namespace blink {
|
|
|
| class WebLayer;
|
|
|
| -class PLATFORM_EXPORT CanvasSurfaceLayerBridge {
|
| +class PLATFORM_EXPORT CanvasSurfaceLayerBridgeObserver {
|
| public:
|
| - explicit CanvasSurfaceLayerBridge(mojom::blink::OffscreenCanvasSurfacePtr);
|
| + CanvasSurfaceLayerBridgeObserver() {}
|
| + virtual ~CanvasSurfaceLayerBridgeObserver() {}
|
| +
|
| + virtual void OnWebLayerReplaced() = 0;
|
| +};
|
| +
|
| +class PLATFORM_EXPORT CanvasSurfaceLayerBridge
|
| + : NON_EXPORTED_BASE(public mojom::blink::OffscreenCanvasSurfaceClient) {
|
| + public:
|
| + explicit CanvasSurfaceLayerBridge(CanvasSurfaceLayerBridgeObserver*);
|
| ~CanvasSurfaceLayerBridge();
|
| - bool createSurfaceLayer(int canvasWidth, int canvasHeight);
|
| + void createSolidColorLayer();
|
| WebLayer* getWebLayer() const { return m_webLayer.get(); }
|
| - const cc::SurfaceId& getSurfaceId() const { return m_surfaceId; }
|
| + const cc::FrameSinkId& getFrameSinkId() const { return m_frameSinkId; }
|
| +
|
| + // Implementation of mojom::blink::OffscreenCanvasSurfaceClient
|
| + void OnSurfaceCreated(const cc::SurfaceId&,
|
| + int32_t width,
|
| + int32_t height,
|
| + float deviceScaleFactor) override;
|
|
|
| void satisfyCallback(const cc::SurfaceSequence&);
|
| void requireCallback(const cc::SurfaceId&, const cc::SurfaceSequence&);
|
|
|
| private:
|
| - scoped_refptr<cc::SurfaceLayer> m_surfaceLayer;
|
| + scoped_refptr<cc::Layer> m_CCLayer;
|
| std::unique_ptr<WebLayer> m_webLayer;
|
| +
|
| + CanvasSurfaceLayerBridgeObserver* m_observer;
|
| +
|
| mojom::blink::OffscreenCanvasSurfacePtr m_service;
|
| - cc::SurfaceId m_surfaceId;
|
| + mojo::Binding<mojom::blink::OffscreenCanvasSurfaceClient> m_binding;
|
| +
|
| + cc::FrameSinkId m_frameSinkId;
|
| + cc::SurfaceId m_currentSurfaceId;
|
| };
|
|
|
| } // namespace blink
|
|
|