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

Side by Side Diff: cc/tiles/picture_layer_tiling.cc

Issue 2150473003: cc: Eliminate refcount churn in prioritized tile's raster source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 5 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 | « no previous file | cc/tiles/prioritized_tile.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/tiles/picture_layer_tiling.h" 5 #include "cc/tiles/picture_layer_tiling.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 PrioritizedTile PictureLayerTiling::MakePrioritizedTile( 771 PrioritizedTile PictureLayerTiling::MakePrioritizedTile(
772 Tile* tile, 772 Tile* tile,
773 PriorityRectType priority_rect_type) const { 773 PriorityRectType priority_rect_type) const {
774 DCHECK(tile); 774 DCHECK(tile);
775 DCHECK(raster_source()->CoversRect(tile->enclosing_layer_rect())) 775 DCHECK(raster_source()->CoversRect(tile->enclosing_layer_rect()))
776 << "Recording rect: " 776 << "Recording rect: "
777 << gfx::ScaleToEnclosingRect(tile->content_rect(), 777 << gfx::ScaleToEnclosingRect(tile->content_rect(),
778 1.f / tile->contents_scale()) 778 1.f / tile->contents_scale())
779 .ToString(); 779 .ToString();
780 780
781 return PrioritizedTile(tile, raster_source(), 781 return PrioritizedTile(tile, this,
782 ComputePriorityForTile(tile, priority_rect_type), 782 ComputePriorityForTile(tile, priority_rect_type),
783 IsTileOccluded(tile)); 783 IsTileOccluded(tile));
784 } 784 }
785 785
786 std::map<const Tile*, PrioritizedTile> 786 std::map<const Tile*, PrioritizedTile>
787 PictureLayerTiling::UpdateAndGetAllPrioritizedTilesForTesting() const { 787 PictureLayerTiling::UpdateAndGetAllPrioritizedTilesForTesting() const {
788 std::map<const Tile*, PrioritizedTile> result; 788 std::map<const Tile*, PrioritizedTile> result;
789 for (const auto& key_tile_pair : tiles_) { 789 for (const auto& key_tile_pair : tiles_) {
790 Tile* tile = key_tile_pair.second.get(); 790 Tile* tile = key_tile_pair.second.get();
791 UpdateRequiredStatesOnTile(tile); 791 UpdateRequiredStatesOnTile(tile);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { 879 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const {
880 size_t amount = 0; 880 size_t amount = 0;
881 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { 881 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
882 const Tile* tile = it->second.get(); 882 const Tile* tile = it->second.get();
883 amount += tile->GPUMemoryUsageInBytes(); 883 amount += tile->GPUMemoryUsageInBytes();
884 } 884 }
885 return amount; 885 return amount;
886 } 886 }
887 887
888 } // namespace cc 888 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/prioritized_tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698