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

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp

Issue 2644653003: Make OffscreenCanvas animation in sync with its placeholder canvas's parent frame rate (Closed)
Patch Set: fix based on fsamuel's feedback 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/core/offscreencanvas/OffscreenCanvas.cpp
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
index 4a4755592a1d9bf6503af65551366df75341d915..43650f22b641efa62b0bad22210bec44af813432 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -236,6 +236,7 @@ OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() {
ScriptPromise OffscreenCanvas::commit(RefPtr<StaticBitmapImage> image,
bool isWebGLSoftwareRendering,
ScriptState* scriptState) {
+ getOrCreateFrameDispatcher()->setNeedsBeginFrame(true);
if (m_commitPromiseResolver) {
if (image) {
m_overdrawFrame = std::move(image);
@@ -266,6 +267,7 @@ void OffscreenCanvas::beginFrame() {
} else if (m_commitPromiseResolver) {
m_commitPromiseResolver->resolve();
m_commitPromiseResolver.clear();
+ getOrCreateFrameDispatcher()->setNeedsBeginFrame(false);
Justin Novosad 2017/01/19 18:06:49 Kudos for putting this in the right place. A comm
xlai (Olivia) 2017/01/19 19:14:34 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698