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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 1287043002: cc: Setup API to release OutputSurface from LTHClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 391
392 void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) { 392 void LayerTreeHost::SetOutputSurface(scoped_ptr<OutputSurface> surface) {
393 TRACE_EVENT0("cc", "LayerTreeHost::SetOutputSurface"); 393 TRACE_EVENT0("cc", "LayerTreeHost::SetOutputSurface");
394 DCHECK(output_surface_lost_); 394 DCHECK(output_surface_lost_);
395 DCHECK(surface); 395 DCHECK(surface);
396 396
397 proxy_->SetOutputSurface(surface.Pass()); 397 proxy_->SetOutputSurface(surface.Pass());
398 } 398 }
399 399
400 scoped_ptr<OutputSurface> LayerTreeHost::GetOutputSurface() {
no sievers 2015/09/10 00:00:22 DCHECK(!visible_); Otherwise it seems like you co
sohanjg 2015/09/10 15:07:23 sorry, i didnt get this part, you mean before aski
no sievers 2015/09/10 17:27:45 Yes, I think it makes sense to properly clean up r
sohanjg 2015/09/11 07:00:49 Acknowledged.
401 output_surface_lost_ = true;
402 return proxy_->GetOutputSurface();
403 }
404
400 void LayerTreeHost::RequestNewOutputSurface() { 405 void LayerTreeHost::RequestNewOutputSurface() {
401 client_->RequestNewOutputSurface(); 406 client_->RequestNewOutputSurface();
402 } 407 }
403 408
404 void LayerTreeHost::DidInitializeOutputSurface() { 409 void LayerTreeHost::DidInitializeOutputSurface() {
405 output_surface_lost_ = false; 410 output_surface_lost_ = false;
406 if (root_layer()) { 411 if (root_layer()) {
407 LayerTreeHostCommon::CallFunctionForSubtree( 412 LayerTreeHostCommon::CallFunctionForSubtree(
408 root_layer(), [](Layer* layer) { layer->OnOutputSurfaceCreated(); }); 413 root_layer(), [](Layer* layer) { layer->OnOutputSurfaceCreated(); });
409 } 414 }
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) 1233 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id())
1229 : false; 1234 : false;
1230 } 1235 }
1231 1236
1232 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { 1237 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const {
1233 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) 1238 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id())
1234 : false; 1239 : false;
1235 } 1240 }
1236 1241
1237 } // namespace cc 1242 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698