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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cc refactors to reduce duplication Created 7 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
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 7fe1f565106808b68952ba9866a608188f381b81..001b93639515f2ad2d9d81de61e596e5c9a039cf 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -26,6 +26,7 @@ SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layer_tree_host)
: Proxy(scoped_ptr<Thread>(NULL)),
layer_tree_host_(layer_tree_host),
created_offscreen_context_provider_(false),
+ initializing_new_output_surface_(false),
next_frame_is_newly_committed_frame_(false),
inside_draw_(false) {
TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
@@ -138,20 +139,33 @@ void SingleThreadProxy::CreateAndInitializeOutputSurface() {
DCHECK(output_surface);
initialized = layer_tree_host_impl_->InitializeRenderer(
output_surface.Pass());
- if (initialized) {
- renderer_capabilities_for_main_thread_ =
- layer_tree_host_impl_->GetRendererCapabilities();
-
- layer_tree_host_impl_->resource_provider()->
- set_offscreen_context_provider(offscreen_context_provider);
- } else if (offscreen_context_provider) {
- offscreen_context_provider->VerifyContexts();
- }
+ initializing_new_output_surface_ = true;
danakj 2013/05/24 19:02:30 You can use base::AutoReset<bool> for a bit more c
+ DidUpdateCapabilitiesOnImplThread(initialized, offscreen_context_provider);
+ initializing_new_output_surface_ = false;
}
OnOutputSurfaceInitializeAttempted(initialized);
}
+void SingleThreadProxy::DidUpdateCapabilitiesOnImplThread(
+ bool success,
+ scoped_refptr<ContextProvider> offscreen_context_provider) {
+ if (success) {
+ renderer_capabilities_for_main_thread_ =
+ layer_tree_host_impl_->GetRendererCapabilities();
+
+ layer_tree_host_impl_->resource_provider()->
+ set_offscreen_context_provider(offscreen_context_provider);
+
+ if (!initializing_new_output_surface_) {
+ DebugScopedSetMainThread main(this);
+ layer_tree_host_->DidUpdateCapabilities();
+ }
+ } else if (offscreen_context_provider) {
+ offscreen_context_provider->VerifyContexts();
+ }
+}
+
void SingleThreadProxy::OnOutputSurfaceInitializeAttempted(bool success) {
LayerTreeHost::CreateResult result =
layer_tree_host_->OnCreateAndInitializeOutputSurfaceAttempted(success);

Powered by Google App Engine
This is Rietveld 408576698