Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(954)

Unified Diff: third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)
Patch Set: rebase and fix conflict Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c22727c3aaa6024cd00f77b1439f23b070846da4..76364621f6abc6b7bb13f6f9389f94fcaf404c0a 100644
--- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h
+++ b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h
@@ -9,37 +9,59 @@
#include "base/memory/weak_ptr.h"
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surface_reference_factory.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;
} // namespace cc
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;
- const mojom::blink::OffscreenCanvasSurfacePtr m_service;
- cc::SurfaceId m_surfaceId;
- scoped_refptr<cc::SurfaceReferenceFactory> m_refFactory;
+ scoped_refptr<cc::SurfaceReferenceFactory> m_refFactory;
base::WeakPtrFactory<CanvasSurfaceLayerBridge> m_weakFactory;
+
+ CanvasSurfaceLayerBridgeObserver* m_observer;
+
+ mojom::blink::OffscreenCanvasSurfacePtr m_service;
+ mojo::Binding<mojom::blink::OffscreenCanvasSurfaceClient> m_binding;
+
+ cc::FrameSinkId m_frameSinkId;
+ cc::SurfaceId m_currentSurfaceId;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698