Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/SurfaceLayerBridge.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h b/third_party/WebKit/Source/platform/graphics/SurfaceLayerBridge.h |
| similarity index 66% |
| rename from third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h |
| rename to third_party/WebKit/Source/platform/graphics/SurfaceLayerBridge.h |
| index c82436cc6d369947339ce6f063595d1ff85a9b98..3d6e8f951437538afe7a9e20cc5d7a76f51c235a 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h |
| +++ b/third_party/WebKit/Source/platform/graphics/SurfaceLayerBridge.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CanvasSurfaceLayerBridge_h |
| -#define CanvasSurfaceLayerBridge_h |
| +#ifndef SurfaceLayerBridge_h |
| +#define SurfaceLayerBridge_h |
| #include <memory> |
| #include "base/memory/ref_counted.h" |
| @@ -12,6 +12,7 @@ |
| #include "cc/surfaces/surface_reference_factory.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| #include "platform/PlatformExport.h" |
| +#include "public/platform/WebSurfaceLayerBridge.h" |
| #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom-blink.h" |
| namespace cc { |
| @@ -24,41 +25,45 @@ namespace blink { |
| class WebLayer; |
| class WebLayerTreeView; |
| -class PLATFORM_EXPORT CanvasSurfaceLayerBridgeObserver { |
| +class PLATFORM_EXPORT SurfaceLayerBridgeObserver { |
| public: |
| - CanvasSurfaceLayerBridgeObserver() {} |
| - virtual ~CanvasSurfaceLayerBridgeObserver() {} |
| + SurfaceLayerBridgeObserver() {} |
| + virtual ~SurfaceLayerBridgeObserver() {} |
| virtual void OnWebLayerReplaced() = 0; |
| }; |
| -class PLATFORM_EXPORT CanvasSurfaceLayerBridge |
| - : NON_EXPORTED_BASE( |
| - public blink::mojom::blink::OffscreenCanvasSurfaceClient) { |
| +class PLATFORM_EXPORT SurfaceLayerBridge |
| + : public NON_EXPORTED_BASE( |
| + blink::mojom::blink::OffscreenCanvasSurfaceClient), |
| + public WebSurfaceLayerBridge { |
| public: |
| - explicit CanvasSurfaceLayerBridge(CanvasSurfaceLayerBridgeObserver*, |
| - WebLayerTreeView*); |
| - ~CanvasSurfaceLayerBridge(); |
| + explicit SurfaceLayerBridge(SurfaceLayerBridgeObserver*, WebLayerTreeView*); |
|
mlamouri (slow - plz ping)
2017/07/07 14:42:38
I know you are just moving this but it seems that
CJ
2017/07/07 18:50:48
Done.
|
| + ~SurfaceLayerBridge(); |
|
mlamouri (slow - plz ping)
2017/07/07 14:42:38
Could you make the dtor `virtual` or make the clas
CJ
2017/07/07 18:50:47
Done.
|
| + |
| void CreateSolidColorLayer(); |
| - WebLayer* GetWebLayer() const { return web_layer_.get(); } |
| - const cc::FrameSinkId& GetFrameSinkId() const { return frame_sink_id_; } |
| // Implementation of blink::mojom::blink::OffscreenCanvasSurfaceClient |
| void OnSurfaceCreated(const cc::SurfaceInfo&) override; |
| - |
| void SatisfyCallback(const cc::SurfaceSequence&); |
| void RequireCallback(const cc::SurfaceId&, const cc::SurfaceSequence&); |
| + // Implementation of WebVideoSurfaceLayerBridge. |
|
liberato (no reviews please)
2017/07/07 15:26:43
s/WebVideo/Web
CJ
2017/07/07 18:50:47
Done.
|
| + WebLayer* GetWebLayer() const override { return web_layer_.get(); } |
| + |
| + const cc::FrameSinkId& GetFrameSinkId() const { return frame_sink_id_; } |
| + |
| private: |
| + mojom::blink::OffscreenCanvasSurfacePtr service_; |
| + |
| scoped_refptr<cc::Layer> cc_layer_; |
| std::unique_ptr<WebLayer> web_layer_; |
| scoped_refptr<cc::SurfaceReferenceFactory> ref_factory_; |
| - base::WeakPtrFactory<CanvasSurfaceLayerBridge> weak_factory_; |
| + base::WeakPtrFactory<SurfaceLayerBridge> weak_factory_; |
| - CanvasSurfaceLayerBridgeObserver* observer_; |
| + SurfaceLayerBridgeObserver* observer_; |
| - mojom::blink::OffscreenCanvasSurfacePtr service_; |
| mojo::Binding<blink::mojom::blink::OffscreenCanvasSurfaceClient> binding_; |
| const cc::FrameSinkId frame_sink_id_; |
| @@ -68,4 +73,4 @@ class PLATFORM_EXPORT CanvasSurfaceLayerBridge |
| } // namespace blink |
| -#endif // CanvasSurfaceLayerBridge_h |
| +#endif // SurfaceLayerBridge_h |