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

Unified Diff: cc/trees/thread_proxy.cc

Issue 151093005: cc: Update Main RendererCapabilities on DeferredInitialize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: UpdateRendererCapabilitiesOnImplThread in CreateAndSetRenderer Created 6 years, 10 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
« cc/trees/single_thread_proxy.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index cdf05c01db9d9506caf135323b967cf6855be1f7..440332d75dd9621aa941a2a985926c840e5d8884 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -338,18 +338,27 @@ void ThreadProxy::DoCreateAndInitializeOutputSurface() {
OnOutputSurfaceInitializeAttempted(success, capabilities);
}
+void ThreadProxy::SetRendererCapabilitiesMainThreadCopy(
+ const RendererCapabilities& capabilities) {
+ DCHECK(IsMainThread());
+ if (main().renderer_capabilities_main_thread_copy == capabilities)
+ return;
+
+ main().renderer_capabilities_main_thread_copy = capabilities;
+ layer_tree_host()->RendererCapabilitiesChanged();
+}
+
void ThreadProxy::OnOutputSurfaceInitializeAttempted(
bool success,
const RendererCapabilities& capabilities) {
DCHECK(IsMainThread());
DCHECK(layer_tree_host());
- if (success) {
- main().renderer_capabilities_main_thread_copy = capabilities;
- }
-
LayerTreeHost::CreateResult result =
layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(success);
+ main().renderer_capabilities_main_thread_copy = capabilities;
+ layer_tree_host()->RendererCapabilitiesChanged();
+
if (result == LayerTreeHost::CreateFailedButTryAgain) {
if (!main().output_surface_creation_callback.callback().is_null()) {
Proxy::MainThreadTaskRunner()->PostTask(
@@ -411,6 +420,17 @@ void ThreadProxy::SetNeedsCommit() {
SendCommitRequestToImplThreadIfNeeded();
}
+void ThreadProxy::UpdateRendererCapabilitiesOnImplThread() {
+ DCHECK(IsImplThread());
+ Proxy::MainThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::SetRendererCapabilitiesMainThreadCopy,
+ main_thread_weak_ptr_,
+ impl()
+ .layer_tree_host_impl->GetRendererCapabilities()
+ .MainThreadCapabilities()));
+}
+
void ThreadProxy::DidLoseOutputSurfaceOnImplThread() {
TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurfaceOnImplThread");
DCHECK(IsImplThread());
« cc/trees/single_thread_proxy.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698