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

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

Issue 2644653003: Make OffscreenCanvas animation in sync with its placeholder canvas's parent frame rate (Closed)
Patch Set: rebase again Created 3 years, 11 months 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.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
index 67b4817b97fb74df518a102fd71c098bde45f26c..a1e03c98753948673ee011eb2f577f6c0fa29aeb 100644
--- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
@@ -17,6 +17,7 @@
#include "public/platform/Platform.h"
#include "public/platform/WebCompositorSupport.h"
#include "public/platform/WebLayer.h"
+#include "public/platform/WebLayerTreeView.h"
#include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom-blink.h"
#include "ui/gfx/geometry/size.h"
#include "wtf/Functional.h"
@@ -55,11 +56,13 @@ class OffscreenCanvasSurfaceReferenceFactory
} // namespace
CanvasSurfaceLayerBridge::CanvasSurfaceLayerBridge(
- CanvasSurfaceLayerBridgeObserver* observer)
+ CanvasSurfaceLayerBridgeObserver* observer,
+ WebLayerTreeView* layerTreeView)
: m_weakFactory(this),
m_observer(observer),
m_binding(this),
- m_frameSinkId(Platform::current()->generateFrameSinkId()) {
+ m_frameSinkId(Platform::current()->generateFrameSinkId()),
+ m_parentFrameSinkId(layerTreeView->getFrameSinkId()) {
m_refFactory =
new OffscreenCanvasSurfaceReferenceFactory(m_weakFactory.GetWeakPtr());
@@ -67,8 +70,11 @@ CanvasSurfaceLayerBridge::CanvasSurfaceLayerBridge(
mojom::blink::OffscreenCanvasSurfaceFactoryPtr serviceFactory;
Platform::current()->interfaceProvider()->getInterface(
mojo::MakeRequest(&serviceFactory));
+ // TODO(xlai): Ensure OffscreenCanvas commit() is still functional when a
+ // frame-less HTML canvas's document is reparenting under another frame.
+ // See crbug.com/683172.
serviceFactory->CreateOffscreenCanvasSurface(
- m_frameSinkId, m_binding.CreateInterfacePtrAndBind(),
+ m_parentFrameSinkId, m_frameSinkId, m_binding.CreateInterfacePtrAndBind(),
mojo::MakeRequest(&m_service));
}

Powered by Google App Engine
This is Rietveld 408576698