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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 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
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('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/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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 void PictureLayerTilingSet::RemoveAllTiles() { 142 void PictureLayerTilingSet::RemoveAllTiles() {
143 for (size_t i = 0; i < tilings_.size(); ++i) 143 for (size_t i = 0; i < tilings_.size(); ++i)
144 tilings_[i]->Reset(); 144 tilings_[i]->Reset();
145 } 145 }
146 146
147 PictureLayerTilingSet::CoverageIterator::CoverageIterator( 147 PictureLayerTilingSet::CoverageIterator::CoverageIterator(
148 const PictureLayerTilingSet* set, 148 const PictureLayerTilingSet* set,
149 float contents_scale, 149 float contents_scale,
150 gfx::Rect content_rect, 150 const gfx::Rect& content_rect,
151 float ideal_contents_scale) 151 float ideal_contents_scale)
152 : set_(set), 152 : set_(set),
153 contents_scale_(contents_scale), 153 contents_scale_(contents_scale),
154 ideal_contents_scale_(ideal_contents_scale), 154 ideal_contents_scale_(ideal_contents_scale),
155 current_tiling_(-1) { 155 current_tiling_(-1) {
156 missing_region_.Union(content_rect); 156 missing_region_.Union(content_rect);
157 157
158 for (ideal_tiling_ = 0; 158 for (ideal_tiling_ = 0;
159 static_cast<size_t>(ideal_tiling_) < set_->tilings_.size(); 159 static_cast<size_t>(ideal_tiling_) < set_->tilings_.size();
160 ++ideal_tiling_) { 160 ++ideal_tiling_) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 297 }
298 298
299 PictureLayerTilingSet::CoverageIterator::operator bool() const { 299 PictureLayerTilingSet::CoverageIterator::operator bool() const {
300 return current_tiling_ < static_cast<int>(set_->tilings_.size()) || 300 return current_tiling_ < static_cast<int>(set_->tilings_.size()) ||
301 region_iter_.has_rect(); 301 region_iter_.has_rect();
302 } 302 }
303 303
304 void PictureLayerTilingSet::UpdateTilePriorities( 304 void PictureLayerTilingSet::UpdateTilePriorities(
305 WhichTree tree, 305 WhichTree tree,
306 gfx::Size device_viewport, 306 gfx::Size device_viewport,
307 gfx::Rect viewport_in_content_space, 307 const gfx::Rect& viewport_in_content_space,
308 gfx::Rect visible_content_rect, 308 const gfx::Rect& visible_content_rect,
309 gfx::Size last_layer_bounds, 309 gfx::Size last_layer_bounds,
310 gfx::Size current_layer_bounds, 310 gfx::Size current_layer_bounds,
311 float last_layer_contents_scale, 311 float last_layer_contents_scale,
312 float current_layer_contents_scale, 312 float current_layer_contents_scale,
313 const gfx::Transform& last_screen_transform, 313 const gfx::Transform& last_screen_transform,
314 const gfx::Transform& current_screen_transform, 314 const gfx::Transform& current_screen_transform,
315 double current_frame_time_in_seconds, 315 double current_frame_time_in_seconds,
316 size_t max_tiles_for_interest_area) { 316 size_t max_tiles_for_interest_area) {
317 gfx::Rect viewport_in_layer_space = gfx::ScaleToEnclosingRect( 317 gfx::Rect viewport_in_layer_space = gfx::ScaleToEnclosingRect(
318 viewport_in_content_space, 318 viewport_in_content_space,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 356 }
357 357
358 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { 358 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const {
359 size_t amount = 0; 359 size_t amount = 0;
360 for (size_t i = 0; i < tilings_.size(); ++i) 360 for (size_t i = 0; i < tilings_.size(); ++i)
361 amount += tilings_[i]->GPUMemoryUsageInBytes(); 361 amount += tilings_[i]->GPUMemoryUsageInBytes();
362 return amount; 362 return amount;
363 } 363 }
364 364
365 } // namespace cc 365 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698