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

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: 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/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index de019b011c12bc066503f45b8dc60ff03c91a9c3..6e0e5509aef83eb5b918d1786aa99eb5b9a02230 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -167,21 +167,7 @@ LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
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;
-
+ DidUpdateCapabilities();
if (!contents_texture_manager_) {
contents_texture_manager_ =
PrioritizedResourceManager::Create(proxy_.get());
@@ -211,6 +197,22 @@ LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
return CreateFailedButTryAgain;
}
+void LayerTreeHost::DidUpdateCapabilities() {
+ // 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;
+}
+
void LayerTreeHost::DeleteContentsTexturesOnImplThread(
ResourceProvider* resource_provider) {
DCHECK(proxy_->IsImplThread());

Powered by Google App Engine
This is Rietveld 408576698