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

Side by Side Diff: cc/resources/picture_layer_tiling_set.cc

Issue 323193002: cc: Don't cleanup the pending twin's low res tiling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scale-collision: . Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | 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 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/resources/picture_layer_tiling_set.h" 5 #include "cc/resources/picture_layer_tiling_set.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 namespace cc { 9 namespace cc {
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 for (size_t i = 0; i < tilings_.size(); ++i) 102 for (size_t i = 0; i < tilings_.size(); ++i)
103 tilings_[i]->RemoveTilesInRegion(region); 103 tilings_[i]->RemoveTilesInRegion(region);
104 } 104 }
105 105
106 void PictureLayerTilingSet::SetCanUseLCDText(bool can_use_lcd_text) { 106 void PictureLayerTilingSet::SetCanUseLCDText(bool can_use_lcd_text) {
107 for (size_t i = 0; i < tilings_.size(); ++i) 107 for (size_t i = 0; i < tilings_.size(); ++i)
108 tilings_[i]->SetCanUseLCDText(can_use_lcd_text); 108 tilings_[i]->SetCanUseLCDText(can_use_lcd_text);
109 } 109 }
110 110
111 PictureLayerTiling* PictureLayerTilingSet::AddTiling(float contents_scale) { 111 PictureLayerTiling* PictureLayerTilingSet::AddTiling(float contents_scale) {
112 for (size_t i = 0; i < tilings_.size(); ++i) { 112 for (size_t i = 0; i < tilings_.size(); ++i)
113 // TODO(enne): temporary sanity CHECK for http://crbug.com/358350. 113 DCHECK_NE(tilings_[i]->contents_scale(), contents_scale);
114 // If a duplicate tiling gets added, then many assumptions in
115 // PictureLayerImpl fail.
116 CHECK_NE(tilings_[i]->contents_scale(), contents_scale);
117 }
118 114
119 tilings_.push_back(PictureLayerTiling::Create(contents_scale, 115 tilings_.push_back(PictureLayerTiling::Create(contents_scale,
120 layer_bounds_, 116 layer_bounds_,
121 client_)); 117 client_));
122 PictureLayerTiling* appended = tilings_.back(); 118 PictureLayerTiling* appended = tilings_.back();
123 119
124 tilings_.sort(LargestToSmallestScaleFunctor()); 120 tilings_.sort(LargestToSmallestScaleFunctor());
125 return appended; 121 return appended;
126 } 122 }
127 123
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 346 }
351 347
352 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { 348 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const {
353 size_t amount = 0; 349 size_t amount = 0;
354 for (size_t i = 0; i < tilings_.size(); ++i) 350 for (size_t i = 0; i < tilings_.size(); ++i)
355 amount += tilings_[i]->GPUMemoryUsageInBytes(); 351 amount += tilings_[i]->GPUMemoryUsageInBytes();
356 return amount; 352 return amount;
357 } 353 }
358 354
359 } // namespace cc 355 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698