Chromium Code Reviews| 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 877 void PictureLayerTiling::GetAllTilesForTracing( | 877 void PictureLayerTiling::GetAllTilesForTracing( |
| 878 std::set<const Tile*>* tiles) const { | 878 std::set<const Tile*>* tiles) const { |
| 879 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) | 879 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) |
| 880 tiles->insert(it->second.get()); | 880 tiles->insert(it->second.get()); |
| 881 } | 881 } |
| 882 | 882 |
| 883 void PictureLayerTiling::AsValueInto( | 883 void PictureLayerTiling::AsValueInto( |
| 884 base::trace_event::TracedValue* state) const { | 884 base::trace_event::TracedValue* state) const { |
| 885 state->SetInteger("num_tiles", tiles_.size()); | 885 state->SetInteger("num_tiles", tiles_.size()); |
| 886 state->SetDouble("content_scale", contents_scale_); | 886 state->SetDouble("content_scale", contents_scale_); |
| 887 MathUtil::AddToTracedValue("current_visible_rect", current_visible_rect_, | |
|
enne (OOO)
2015/03/19 19:15:21
Do you need the word current in all of these?
vmpstr
2015/03/19 19:38:19
Done.
| |
| 888 state); | |
| 889 MathUtil::AddToTracedValue("current_skewport_rect", current_skewport_rect_, | |
| 890 state); | |
| 891 MathUtil::AddToTracedValue("current_soon_border_rect", | |
|
enne (OOO)
2015/03/19 19:15:21
Also, why "soon_border" vs just "soon"? I'm not su
vmpstr
2015/03/19 19:38:19
Eh, I'm just following the name of the variable. I
| |
| 892 current_soon_border_rect_, state); | |
| 893 MathUtil::AddToTracedValue("current_eventually_rect", | |
| 894 current_eventually_rect_, state); | |
| 887 MathUtil::AddToTracedValue("tiling_size", tiling_size(), state); | 895 MathUtil::AddToTracedValue("tiling_size", tiling_size(), state); |
| 888 } | 896 } |
| 889 | 897 |
| 890 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { | 898 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { |
| 891 size_t amount = 0; | 899 size_t amount = 0; |
| 892 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | 900 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
| 893 const Tile* tile = it->second.get(); | 901 const Tile* tile = it->second.get(); |
| 894 amount += tile->GPUMemoryUsageInBytes(); | 902 amount += tile->GPUMemoryUsageInBytes(); |
| 895 } | 903 } |
| 896 return amount; | 904 return amount; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1041 break; | 1049 break; |
| 1042 } | 1050 } |
| 1043 | 1051 |
| 1044 gfx::Rect result(origin_x, origin_y, width, height); | 1052 gfx::Rect result(origin_x, origin_y, width, height); |
| 1045 if (cache) | 1053 if (cache) |
| 1046 cache->previous_result = result; | 1054 cache->previous_result = result; |
| 1047 return result; | 1055 return result; |
| 1048 } | 1056 } |
| 1049 | 1057 |
| 1050 } // namespace cc | 1058 } // namespace cc |
| OLD | NEW |