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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_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/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 should_use_gpu_rasterization()) 507 should_use_gpu_rasterization())
508 return NULL; 508 return NULL;
509 for (size_t i = 0; i < twin_layer_->tilings_->num_tilings(); ++i) 509 for (size_t i = 0; i < twin_layer_->tilings_->num_tilings(); ++i)
510 if (twin_layer_->tilings_->tiling_at(i)->contents_scale() == 510 if (twin_layer_->tilings_->tiling_at(i)->contents_scale() ==
511 tiling->contents_scale()) 511 tiling->contents_scale())
512 return twin_layer_->tilings_->tiling_at(i); 512 return twin_layer_->tilings_->tiling_at(i);
513 return NULL; 513 return NULL;
514 } 514 }
515 515
516 gfx::Size PictureLayerImpl::CalculateTileSize( 516 gfx::Size PictureLayerImpl::CalculateTileSize(
517 gfx::Size content_bounds) const { 517 const gfx::Size& content_bounds) const {
518 if (is_mask_) { 518 if (is_mask_) {
519 int max_size = layer_tree_impl()->MaxTextureSize(); 519 int max_size = layer_tree_impl()->MaxTextureSize();
520 return gfx::Size( 520 return gfx::Size(
521 std::min(max_size, content_bounds.width()), 521 std::min(max_size, content_bounds.width()),
522 std::min(max_size, content_bounds.height())); 522 std::min(max_size, content_bounds.height()));
523 } 523 }
524 524
525 int max_texture_size = 525 int max_texture_size =
526 layer_tree_impl()->resource_provider()->max_texture_size(); 526 layer_tree_impl()->resource_provider()->max_texture_size();
527 527
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { 1231 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
1232 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); 1232 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
1233 return tilings_->GPUMemoryUsageInBytes(); 1233 return tilings_->GPUMemoryUsageInBytes();
1234 } 1234 }
1235 1235
1236 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1236 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1237 benchmark->RunOnLayer(this); 1237 benchmark->RunOnLayer(this);
1238 } 1238 }
1239 1239
1240 } // namespace cc 1240 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698