OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |