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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 2769823002: Add decode() functionality to image elements. (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 1769c19fe60d303b082519dcf7c9103d3ad8ea25..7dc16da471575153429cc0c6bef0e46ebff53860 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -207,12 +207,7 @@ void SingleThreadProxy::DoCommit() {
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->DidCommit();
- // Issue decode callbacks.
- auto completed_decode_callbacks =
- layer_tree_host_impl_->TakeCompletedImageDecodeCallbacks();
- for (auto& callback : completed_decode_callbacks)
- callback.Run();
-
+ IssueImageDecodeFinishedCallbacks();
layer_tree_host_impl_->CommitComplete();
// Commit goes directly to the active tree, but we need to synchronously
@@ -224,6 +219,15 @@ void SingleThreadProxy::DoCommit() {
}
}
+void SingleThreadProxy::IssueImageDecodeFinishedCallbacks() {
+ DCHECK(task_runner_provider_->IsImplThread());
+
+ auto completed_decode_callbacks =
+ layer_tree_host_impl_->TakeCompletedImageDecodeCallbacks();
+ for (auto& callback : completed_decode_callbacks)
+ callback.Run();
+}
+
void SingleThreadProxy::CommitComplete() {
// Commit complete happens on the main side after activate to satisfy any
// SetNextCommitWaitsForActivation calls.
@@ -446,6 +450,19 @@ void SingleThreadProxy::NeedsImplSideInvalidation() {
scheduler_on_impl_thread_->SetNeedsImplSideInvalidation();
}
+void SingleThreadProxy::NotifyImageDecodeRequestFinished() {
+ // If we don't have a scheduler, then just issue the callbacks here.
+ // Otherwise, schedule a commit.
+ if (!scheduler_on_impl_thread_) {
+ DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_);
+ DebugScopedSetImplThread impl(task_runner_provider_);
+
+ IssueImageDecodeFinishedCallbacks();
+ return;
+ }
+ SetNeedsCommitOnImplThread();
+}
+
void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
TRACE_EVENT0("cc,benchmark", "SingleThreadProxy::CompositeImmediately");
DCHECK(task_runner_provider_->IsMainThread());
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698