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

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

Issue 853393002: cc: refactor of MathUtil::AddToTracedValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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.cc ('k') | cc/resources/tile.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.h" 5 #include "cc/resources/picture_layer_tiling.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 862
863 void PictureLayerTiling::GetAllTilesForTracing( 863 void PictureLayerTiling::GetAllTilesForTracing(
864 std::set<const Tile*>* tiles) const { 864 std::set<const Tile*>* tiles) const {
865 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) 865 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
866 tiles->insert(it->second.get()); 866 tiles->insert(it->second.get());
867 } 867 }
868 868
869 void PictureLayerTiling::AsValueInto(base::debug::TracedValue* state) const { 869 void PictureLayerTiling::AsValueInto(base::debug::TracedValue* state) const {
870 state->SetInteger("num_tiles", tiles_.size()); 870 state->SetInteger("num_tiles", tiles_.size());
871 state->SetDouble("content_scale", contents_scale_); 871 state->SetDouble("content_scale", contents_scale_);
872 state->BeginDictionary("tiling_size"); 872 MathUtil::AddToTracedValue("tiling_size", tiling_size(), state);
873 MathUtil::AddToTracedValue(tiling_size(), state);
874 state->EndDictionary();
875 } 873 }
876 874
877 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { 875 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const {
878 size_t amount = 0; 876 size_t amount = 0;
879 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { 877 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
880 const Tile* tile = it->second.get(); 878 const Tile* tile = it->second.get();
881 amount += tile->GPUMemoryUsageInBytes(); 879 amount += tile->GPUMemoryUsageInBytes();
882 } 880 }
883 return amount; 881 return amount;
884 } 882 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 break; 1026 break;
1029 } 1027 }
1030 1028
1031 gfx::Rect result(origin_x, origin_y, width, height); 1029 gfx::Rect result(origin_x, origin_y, width, height);
1032 if (cache) 1030 if (cache)
1033 cache->previous_result = result; 1031 cache->previous_result = result;
1034 return result; 1032 return result;
1035 } 1033 }
1036 1034
1037 } // namespace cc 1035 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/tile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698