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

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

Issue 1176713002: Synchronously drop tile textures in android webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove extra if Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 // Check for a non-null active tree to avoid doing this during shutdown. 1320 // Check for a non-null active tree to avoid doing this during shutdown.
1321 if (active_tree_ && !client_->IsInsideDraw() && tile->required_for_draw()) { 1321 if (active_tree_ && !client_->IsInsideDraw() && tile->required_for_draw()) {
1322 // The LayerImpl::NotifyTileStateChanged() should damage the layer, so this 1322 // The LayerImpl::NotifyTileStateChanged() should damage the layer, so this
1323 // redraw will make those tiles be displayed. 1323 // redraw will make those tiles be displayed.
1324 SetNeedsRedraw(); 1324 SetNeedsRedraw();
1325 } 1325 }
1326 } 1326 }
1327 1327
1328 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { 1328 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
1329 SetManagedMemoryPolicy(policy); 1329 SetManagedMemoryPolicy(policy);
1330
1331 // This is short term solution to synchronously drop tile resources when
1332 // using synchronous compositing to avoid memory usage regression.
1333 // crbug.com/499004 to track removing this.
1334 if (!policy.bytes_limit_when_visible && tile_manager_ &&
1335 settings_.using_synchronous_renderer_compositor) {
1336 ReleaseTreeResources();
1337 DestroyTileManager();
vmpstr 2015/06/10 23:15:54 Can you make a comment that explains that destruct
boliu 2015/06/10 23:20:56 Done
1338 CreateAndSetTileManager();
1339 RecreateTreeResources();
1340 }
1330 } 1341 }
1331 1342
1332 void LayerTreeHostImpl::SetTreeActivationCallback( 1343 void LayerTreeHostImpl::SetTreeActivationCallback(
1333 const base::Closure& callback) { 1344 const base::Closure& callback) {
1334 DCHECK(proxy_->IsImplThread()); 1345 DCHECK(proxy_->IsImplThread());
1335 DCHECK(settings_.impl_side_painting || callback.is_null()); 1346 DCHECK(settings_.impl_side_painting || callback.is_null());
1336 tree_activation_callback_ = callback; 1347 tree_activation_callback_ = callback;
1337 } 1348 }
1338 1349
1339 void LayerTreeHostImpl::SetManagedMemoryPolicy( 1350 void LayerTreeHostImpl::SetManagedMemoryPolicy(
(...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after
3483 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3494 new_target.SetToMin(layer_impl->MaxScrollOffset());
3484 3495
3485 curve->UpdateTarget( 3496 curve->UpdateTarget(
3486 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3497 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3487 .InSecondsF(), 3498 .InSecondsF(),
3488 new_target); 3499 new_target);
3489 3500
3490 return true; 3501 return true;
3491 } 3502 }
3492 } // namespace cc 3503 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698