| 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/debug/traced_value.h" |
| 10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 11 #include "cc/base/math_util.h" | 12 #include "cc/base/math_util.h" |
| 12 #include "cc/base/util.h" | 13 #include "cc/base/util.h" |
| 13 #include "cc/debug/debug_colors.h" | 14 #include "cc/debug/debug_colors.h" |
| 14 #include "cc/debug/micro_benchmark_impl.h" | 15 #include "cc/debug/micro_benchmark_impl.h" |
| 15 #include "cc/debug/traced_value.h" | |
| 16 #include "cc/layers/append_quads_data.h" | 16 #include "cc/layers/append_quads_data.h" |
| 17 #include "cc/layers/quad_sink.h" | 17 #include "cc/layers/quad_sink.h" |
| 18 #include "cc/quads/checkerboard_draw_quad.h" | 18 #include "cc/quads/checkerboard_draw_quad.h" |
| 19 #include "cc/quads/debug_border_draw_quad.h" | 19 #include "cc/quads/debug_border_draw_quad.h" |
| 20 #include "cc/quads/picture_draw_quad.h" | 20 #include "cc/quads/picture_draw_quad.h" |
| 21 #include "cc/quads/solid_color_draw_quad.h" | 21 #include "cc/quads/solid_color_draw_quad.h" |
| 22 #include "cc/quads/tile_draw_quad.h" | 22 #include "cc/quads/tile_draw_quad.h" |
| 23 #include "cc/resources/tile_manager.h" | 23 #include "cc/resources/tile_manager.h" |
| 24 #include "cc/trees/layer_tree_impl.h" | 24 #include "cc/trees/layer_tree_impl.h" |
| 25 #include "ui/gfx/quad_f.h" | 25 #include "ui/gfx/quad_f.h" |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 scoped_ptr<base::ListValue> coverage_tiles(new base::ListValue); | 1316 scoped_ptr<base::ListValue> coverage_tiles(new base::ListValue); |
| 1317 for (PictureLayerTilingSet::CoverageIterator iter(tilings_.get(), | 1317 for (PictureLayerTilingSet::CoverageIterator iter(tilings_.get(), |
| 1318 contents_scale_x(), | 1318 contents_scale_x(), |
| 1319 gfx::Rect(content_bounds()), | 1319 gfx::Rect(content_bounds()), |
| 1320 ideal_contents_scale_); | 1320 ideal_contents_scale_); |
| 1321 iter; | 1321 iter; |
| 1322 ++iter) { | 1322 ++iter) { |
| 1323 scoped_ptr<base::DictionaryValue> tile_data(new base::DictionaryValue); | 1323 scoped_ptr<base::DictionaryValue> tile_data(new base::DictionaryValue); |
| 1324 tile_data->Set("geometry_rect", | 1324 tile_data->Set("geometry_rect", |
| 1325 MathUtil::AsValue(iter.geometry_rect()).release()); | 1325 MathUtil::AsValue(iter.geometry_rect()).release()); |
| 1326 if (*iter) | 1326 if (*iter) { |
| 1327 tile_data->Set("tile", TracedValue::CreateIDRef(*iter).release()); | 1327 tile_data->Set("tile", |
| 1328 base::debug::TracedValue::CreateIDRef(*iter).release()); |
| 1329 } |
| 1328 | 1330 |
| 1329 coverage_tiles->Append(tile_data.release()); | 1331 coverage_tiles->Append(tile_data.release()); |
| 1330 } | 1332 } |
| 1331 state->Set("coverage_tiles", coverage_tiles.release()); | 1333 state->Set("coverage_tiles", coverage_tiles.release()); |
| 1332 state->SetBoolean("is_using_lcd_text", is_using_lcd_text_); | 1334 state->SetBoolean("is_using_lcd_text", is_using_lcd_text_); |
| 1333 state->SetBoolean("using_gpu_rasterization", ShouldUseGpuRasterization()); | 1335 state->SetBoolean("using_gpu_rasterization", ShouldUseGpuRasterization()); |
| 1334 } | 1336 } |
| 1335 | 1337 |
| 1336 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1338 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
| 1337 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); | 1339 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 return iterator_index_ < iterators_.size(); | 1568 return iterator_index_ < iterators_.size(); |
| 1567 } | 1569 } |
| 1568 | 1570 |
| 1569 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1571 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
| 1570 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1572 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
| 1571 return it->get_type() == iteration_stage_ && | 1573 return it->get_type() == iteration_stage_ && |
| 1572 (**it)->required_for_activation() == required_for_activation_; | 1574 (**it)->required_for_activation() == required_for_activation_; |
| 1573 } | 1575 } |
| 1574 | 1576 |
| 1575 } // namespace cc | 1577 } // namespace cc |
| OLD | NEW |