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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 tree, | 859 tree, |
860 TilePriority(resolution_, TilePriority::EVENTUALLY, distance_to_visible)); | 860 TilePriority(resolution_, TilePriority::EVENTUALLY, distance_to_visible)); |
861 } | 861 } |
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( |
| 870 base::trace_event::TracedValue* state) const { |
870 state->SetInteger("num_tiles", tiles_.size()); | 871 state->SetInteger("num_tiles", tiles_.size()); |
871 state->SetDouble("content_scale", contents_scale_); | 872 state->SetDouble("content_scale", contents_scale_); |
872 MathUtil::AddToTracedValue("tiling_size", tiling_size(), state); | 873 MathUtil::AddToTracedValue("tiling_size", tiling_size(), state); |
873 } | 874 } |
874 | 875 |
875 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { | 876 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { |
876 size_t amount = 0; | 877 size_t amount = 0; |
877 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | 878 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
878 const Tile* tile = it->second.get(); | 879 const Tile* tile = it->second.get(); |
879 amount += tile->GPUMemoryUsageInBytes(); | 880 amount += tile->GPUMemoryUsageInBytes(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 break; | 1027 break; |
1027 } | 1028 } |
1028 | 1029 |
1029 gfx::Rect result(origin_x, origin_y, width, height); | 1030 gfx::Rect result(origin_x, origin_y, width, height); |
1030 if (cache) | 1031 if (cache) |
1031 cache->previous_result = result; | 1032 cache->previous_result = result; |
1032 return result; | 1033 return result; |
1033 } | 1034 } |
1034 | 1035 |
1035 } // namespace cc | 1036 } // namespace cc |
OLD | NEW |