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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dedup and refactor code 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/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 367a84758691e0c35123ee287630b2f8557b9e7c..d82727f78dae79e12a0e3b191baebe077d3fa4c3 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -165,29 +165,7 @@ LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
DCHECK(output_surface_lost_);
if (success) {
output_surface_lost_ = false;
-
- // Update settings_ based on capabilities that we got back from the
- // renderer.
- settings_.accelerate_painting =
- proxy_->GetRendererCapabilities().using_accelerated_painting;
-
- // Update settings_ based on partial update capability.
- size_t max_partial_texture_updates = 0;
- if (proxy_->GetRendererCapabilities().allow_partial_texture_updates &&
- !settings_.impl_side_painting) {
- max_partial_texture_updates = std::min(
- settings_.max_partial_texture_updates,
- proxy_->MaxPartialTextureUpdates());
- }
- settings_.max_partial_texture_updates = max_partial_texture_updates;
-
- if (!contents_texture_manager_) {
- contents_texture_manager_ =
- PrioritizedResourceManager::Create(proxy_.get());
- surface_memory_placeholder_ =
- contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA);
- }
-
+ DidUpdateCapabilities();
client_->DidInitializeOutputSurface(true);
return CreateSucceeded;
}
@@ -210,6 +188,29 @@ LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
return CreateFailedButTryAgain;
}
+void LayerTreeHost::DidUpdateCapabilities() {
+ // Update settings_ based on capabilities that we got back from the
+ // renderer.
danakj 2013/05/21 14:00:49 weird indenting going on here
+ settings_.accelerate_painting =
+ proxy_->GetRendererCapabilities().using_accelerated_painting;
+ // Update settings_ based on partial update capability.
+ size_t max_partial_texture_updates = 0;
+ if (proxy_->GetRendererCapabilities().allow_partial_texture_updates &&
+ !settings_.impl_side_painting) {
+ max_partial_texture_updates = std::min(
+ settings_.max_partial_texture_updates,
+ proxy_->MaxPartialTextureUpdates());
+ }
+ settings_.max_partial_texture_updates = max_partial_texture_updates;
+
+ if (!contents_texture_manager_) {
danakj 2013/05/21 14:00:49 i don't really get why this would belong here, thi
+ contents_texture_manager_ =
+ PrioritizedResourceManager::Create(proxy_.get());
+ surface_memory_placeholder_ =
+ contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA);
+ }
+}
+
void LayerTreeHost::DeleteContentsTexturesOnImplThread(
ResourceProvider* resource_provider) {
DCHECK(proxy_->IsImplThread());

Powered by Google App Engine
This is Rietveld 408576698