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

Side by Side Diff: cc/picture_layer_impl.cc

Issue 11953005: cc: Update picture pile on tiles to prevent memory leak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename MoveTilePriorities to DidBecomeActive Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « cc/picture_layer_impl.h ('k') | cc/picture_layer_tiling.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture_layer_impl.h" 5 #include "cc/picture_layer_impl.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "cc/append_quads_data.h" 8 #include "cc/append_quads_data.h"
9 #include "cc/checkerboard_draw_quad.h" 9 #include "cc/checkerboard_draw_quad.h"
10 #include "cc/debug_border_draw_quad.h" 10 #include "cc/debug_border_draw_quad.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 time_delta); 173 time_delta);
174 174
175 last_screen_space_transform_ = current_screen_space_transform; 175 last_screen_space_transform_ = current_screen_space_transform;
176 last_update_time_ = current_time; 176 last_update_time_ = current_time;
177 last_bounds_ = bounds(); 177 last_bounds_ = bounds();
178 last_content_bounds_ = contentBounds(); 178 last_content_bounds_ = contentBounds();
179 last_content_scale_ = contentsScaleX(); 179 last_content_scale_ = contentsScaleX();
180 } 180 }
181 181
182 void PictureLayerImpl::didBecomeActive() { 182 void PictureLayerImpl::didBecomeActive() {
183 tilings_.MoveTilePriorities(PENDING_TREE, ACTIVE_TREE); 183 tilings_.DidBecomeActive();
184 } 184 }
185 185
186 void PictureLayerImpl::didLoseOutputSurface() { 186 void PictureLayerImpl::didLoseOutputSurface() {
187 tilings_.RemoveAllTilings(); 187 tilings_.RemoveAllTilings();
188 } 188 }
189 189
190 void PictureLayerImpl::calculateContentsScale( 190 void PictureLayerImpl::calculateContentsScale(
191 float ideal_contents_scale, 191 float ideal_contents_scale,
192 float* contents_scale_x, 192 float* contents_scale_x,
193 float* contents_scale_y, 193 float* contents_scale_y,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 return make_scoped_refptr(new Tile( 231 return make_scoped_refptr(new Tile(
232 tile_manager, 232 tile_manager,
233 pile_.get(), 233 pile_.get(),
234 rect.size(), 234 rect.size(),
235 GL_RGBA, 235 GL_RGBA,
236 rect, 236 rect,
237 tiling->contents_scale())); 237 tiling->contents_scale()));
238 } 238 }
239 239
240 void PictureLayerImpl::UpdatePile(Tile* tile) {
241 tile->set_picture_pile(pile_);
242 }
243
240 void PictureLayerImpl::SyncFromActiveLayer() { 244 void PictureLayerImpl::SyncFromActiveLayer() {
241 DCHECK(layerTreeImpl()->IsPendingTree()); 245 DCHECK(layerTreeImpl()->IsPendingTree());
242 if (!drawsContent()) 246 if (!drawsContent())
243 return; 247 return;
244 248
245 // If there is an active tree version of this layer, get a copy of its 249 // If there is an active tree version of this layer, get a copy of its
246 // tiles. This needs to be done last, after setting invalidation and the 250 // tiles. This needs to be done last, after setting invalidation and the
247 // pile. 251 // pile.
248 PictureLayerImpl* active_twin = static_cast<PictureLayerImpl*>( 252 PictureLayerImpl* active_twin = static_cast<PictureLayerImpl*>(
249 layerTreeImpl()->FindActiveTreeLayerById(id())); 253 layerTreeImpl()->FindActiveTreeLayerById(id()));
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) == 450 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) ==
447 used_tilings.end()) 451 used_tilings.end())
448 to_remove.push_back(tiling); 452 to_remove.push_back(tiling);
449 } 453 }
450 454
451 for (size_t i = 0; i < to_remove.size(); ++i) 455 for (size_t i = 0; i < to_remove.size(); ++i)
452 tilings_.Remove(to_remove[i]); 456 tilings_.Remove(to_remove[i]);
453 } 457 }
454 458
455 } // namespace cc 459 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture_layer_impl.h ('k') | cc/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698