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 64% |
rename from third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h |
rename to third_party/WebKit/Source/platform/graphics/SurfaceLayerBridge.h |
index c82436cc6d369947339ce6f063595d1ff85a9b98..42394aff3bfed4da9156ce5c3589aa11cc5c1cf6 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/WebVideoSurfaceLayerBridge.h" |
#include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom-blink.h" |
namespace cc { |
@@ -24,41 +25,46 @@ 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 WebVideoSurfaceLayerBridge { |
liberato (no reviews please)
2017/07/06 16:56:18
not sure that SurfaceLayerBridge should implement
CJ
2017/07/06 20:45:19
Done.
|
public: |
- explicit CanvasSurfaceLayerBridge(CanvasSurfaceLayerBridgeObserver*, |
- WebLayerTreeView*); |
- ~CanvasSurfaceLayerBridge(); |
+ explicit SurfaceLayerBridge(SurfaceLayerBridgeObserver*, WebLayerTreeView*); |
+ ~SurfaceLayerBridge(); |
+ |
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. |
+ WebLayer* GetWebLayer() const override { return web_layer_.get(); } |
+ cc::Layer* GetCCLayer() const override { return cc_layer_.get(); } |
liberato (no reviews please)
2017/07/06 16:56:18
is there any case where this isn't the same as web
CJ
2017/07/06 20:45:19
For some reason I thought it was available on WebL
|
+ |
+ 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 +74,4 @@ class PLATFORM_EXPORT CanvasSurfaceLayerBridge |
} // namespace blink |
-#endif // CanvasSurfaceLayerBridge_h |
+#endif // SurfaceLayerBridge_h |