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

Unified Diff: content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc

Issue 2644653003: Make OffscreenCanvas animation in sync with its placeholder canvas's parent frame rate (Closed)
Patch Set: safeguard 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: content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc
diff --git a/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc b/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc
index 5717d03773b2bb1f13af95819701a97a1cee8a5e..0c2ddfbefce685152e1faf52a24c6bc92be46d3e 100644
--- a/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc
+++ b/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc
@@ -8,6 +8,7 @@
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_manager.h"
#include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_provider_impl.h"
+#include "content/browser/renderer_host/offscreen_canvas_surface_manager.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
namespace content {
@@ -28,9 +29,15 @@ OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink(
binding_.set_connection_error_handler(
base::Bind(&OffscreenCanvasCompositorFrameSink::OnClientConnectionLost,
base::Unretained(this)));
+
+ OffscreenCanvasSurfaceManager::GetInstance()->RegisterFrameSinkToItsParent(
Fady Samuel 2017/01/19 04:05:43 Maybe move this to OffscreenCanvasCompositorFrameS
xlai (Olivia) 2017/01/19 16:43:56 Done.
+ frame_sink_id);
}
-OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {}
+OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {
+ OffscreenCanvasSurfaceManager::GetInstance()
+ ->UnregisterFrameSinkFromItsParent(support_.frame_sink_id());
Fady Samuel 2017/01/19 04:05:43 Maybe move this to OffscreenCanvasCompositorFrameS
xlai (Olivia) 2017/01/19 16:43:56 Simply moving this to OnCompositorFrameSinkClientC
+}
void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame(
bool needs_begin_frame) {

Powered by Google App Engine
This is Rietveld 408576698