Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/VideoSurfaceLayerBridge.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h b/third_party/WebKit/Source/platform/graphics/VideoSurfaceLayerBridge.h |
| similarity index 58% |
| copy from third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h |
| copy to third_party/WebKit/Source/platform/graphics/VideoSurfaceLayerBridge.h |
| index c82436cc6d369947339ce6f063595d1ff85a9b98..cb5beeeba98684c7315f3d55b47bdffa4041976a 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h |
| +++ b/third_party/WebKit/Source/platform/graphics/VideoSurfaceLayerBridge.h |
| @@ -1,9 +1,9 @@ |
| -// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| // 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 VideoSurfaceLayerBridge_h |
| +#define VideoSurfaceLayerBridge_h |
| #include <memory> |
| #include "base/memory/ref_counted.h" |
| @@ -12,6 +12,8 @@ |
| #include "cc/surfaces/surface_reference_factory.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| #include "platform/PlatformExport.h" |
| +#include "platform/graphics/SurfaceLayerBridge.h" |
| +#include "public/platform/WebVideoSurfaceLayerBridge.h" |
| #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom-blink.h" |
| namespace cc { |
| @@ -21,42 +23,32 @@ class SurfaceInfo; |
| namespace blink { |
| -class WebLayer; |
| -class WebLayerTreeView; |
| - |
| -class PLATFORM_EXPORT CanvasSurfaceLayerBridgeObserver { |
| +class VideoSurfaceLayerBridge : public NON_EXPORTED_BASE(SurfaceLayerBridge), |
|
liberato (no reviews please)
2017/06/26 22:39:30
many of these classes could use a few lines of cla
CJ
2017/06/29 19:51:33
Done. Please review my wording.
|
| + public WebVideoSurfaceLayerBridge { |
| public: |
| - CanvasSurfaceLayerBridgeObserver() {} |
| - virtual ~CanvasSurfaceLayerBridgeObserver() {} |
| + explicit VideoSurfaceLayerBridge(WebSurfaceLayerBridgeObserver*); |
| + ~VideoSurfaceLayerBridge(); |
| - virtual void OnWebLayerReplaced() = 0; |
| -}; |
| + // Implementation of WebVideoLayerSurfaceBridge |
| + cc::Layer* GetLayer() { return cc_layer_.get(); } |
| -class PLATFORM_EXPORT CanvasSurfaceLayerBridge |
| - : NON_EXPORTED_BASE( |
| - public blink::mojom::blink::OffscreenCanvasSurfaceClient) { |
| - public: |
| - explicit CanvasSurfaceLayerBridge(CanvasSurfaceLayerBridgeObserver*, |
| - WebLayerTreeView*); |
| - ~CanvasSurfaceLayerBridge(); |
| + // Implemenation of SurfaceLayerBridge |
| void CreateSolidColorLayer(); |
| - WebLayer* GetWebLayer() const { return web_layer_.get(); } |
| - const cc::FrameSinkId& GetFrameSinkId() const { return frame_sink_id_; } |
| + void SatisfyCallback(const cc::SurfaceSequence&); |
| + void RequireCallback(const cc::SurfaceId&, const cc::SurfaceSequence&); |
| // 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&); |
| + const cc::FrameSinkId& GetFrameSinkId() const { return frame_sink_id_; } |
| private: |
| 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_; |
| + WebSurfaceLayerBridgeObserver* observer_; |
| mojom::blink::OffscreenCanvasSurfacePtr service_; |
| mojo::Binding<blink::mojom::blink::OffscreenCanvasSurfaceClient> binding_; |
| @@ -68,4 +60,4 @@ class PLATFORM_EXPORT CanvasSurfaceLayerBridge |
| } // namespace blink |
| -#endif // CanvasSurfaceLayerBridge_h |
| +#endif // VideoSurfaceLayerBridge_h |