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

Side by Side Diff: cc/layers/picture_layer_impl.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/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 bool should_use_gpu_rasterization) { 461 bool should_use_gpu_rasterization) {
462 if (should_use_gpu_rasterization != should_use_gpu_rasterization_) { 462 if (should_use_gpu_rasterization != should_use_gpu_rasterization_) {
463 should_use_gpu_rasterization_ = should_use_gpu_rasterization; 463 should_use_gpu_rasterization_ = should_use_gpu_rasterization;
464 RemoveAllTilings(); 464 RemoveAllTilings();
465 } else { 465 } else {
466 should_use_gpu_rasterization_ = should_use_gpu_rasterization; 466 should_use_gpu_rasterization_ = should_use_gpu_rasterization;
467 } 467 }
468 } 468 }
469 469
470 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling, 470 scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
471 gfx::Rect content_rect) { 471 const gfx::Rect& content_rect) {
472 if (!pile_->CanRaster(tiling->contents_scale(), content_rect)) 472 if (!pile_->CanRaster(tiling->contents_scale(), content_rect))
473 return scoped_refptr<Tile>(); 473 return scoped_refptr<Tile>();
474 474
475 int flags = 0; 475 int flags = 0;
476 if (is_using_lcd_text_) 476 if (is_using_lcd_text_)
477 flags |= Tile::USE_LCD_TEXT; 477 flags |= Tile::USE_LCD_TEXT;
478 if (should_use_gpu_rasterization()) 478 if (should_use_gpu_rasterization())
479 flags |= Tile::USE_GPU_RASTERIZATION; 479 flags |= Tile::USE_GPU_RASTERIZATION;
480 return layer_tree_impl()->tile_manager()->CreateTile( 480 return layer_tree_impl()->tile_manager()->CreateTile(
481 pile_.get(), 481 pile_.get(),
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 // content. 772 // content.
773 MarkVisibleTilesAsRequired( 773 MarkVisibleTilesAsRequired(
774 low_res, twin_low_res, contents_scale_x(), rect, missing_region); 774 low_res, twin_low_res, contents_scale_x(), rect, missing_region);
775 } 775 }
776 } 776 }
777 777
778 bool PictureLayerImpl::MarkVisibleTilesAsRequired( 778 bool PictureLayerImpl::MarkVisibleTilesAsRequired(
779 PictureLayerTiling* tiling, 779 PictureLayerTiling* tiling,
780 const PictureLayerTiling* optional_twin_tiling, 780 const PictureLayerTiling* optional_twin_tiling,
781 float contents_scale, 781 float contents_scale,
782 gfx::Rect rect, 782 const gfx::Rect& rect,
783 const Region& missing_region) const { 783 const Region& missing_region) const {
784 bool twin_had_missing_tile = false; 784 bool twin_had_missing_tile = false;
785 for (PictureLayerTiling::CoverageIterator iter(tiling, 785 for (PictureLayerTiling::CoverageIterator iter(tiling,
786 contents_scale, 786 contents_scale,
787 rect); 787 rect);
788 iter; 788 iter;
789 ++iter) { 789 ++iter) {
790 Tile* tile = *iter; 790 Tile* tile = *iter;
791 // A null tile (i.e. missing recording) can just be skipped. 791 // A null tile (i.e. missing recording) can just be skipped.
792 if (!tile) 792 if (!tile)
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { 1230 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
1231 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); 1231 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
1232 return tilings_->GPUMemoryUsageInBytes(); 1232 return tilings_->GPUMemoryUsageInBytes();
1233 } 1233 }
1234 1234
1235 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1235 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1236 benchmark->RunOnLayer(this); 1236 benchmark->RunOnLayer(this);
1237 } 1237 }
1238 1238
1239 } // namespace cc 1239 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698