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/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/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 color = DebugColors::ExtraHighResTileBorderColor(); | 231 color = DebugColors::ExtraHighResTileBorderColor(); |
| 232 width = DebugColors::ExtraHighResTileBorderWidth(layer_tree_impl()); | 232 width = DebugColors::ExtraHighResTileBorderWidth(layer_tree_impl()); |
| 233 } else { | 233 } else { |
| 234 color = DebugColors::ExtraLowResTileBorderColor(); | 234 color = DebugColors::ExtraLowResTileBorderColor(); |
| 235 width = DebugColors::ExtraLowResTileBorderWidth(layer_tree_impl()); | 235 width = DebugColors::ExtraLowResTileBorderWidth(layer_tree_impl()); |
| 236 } | 236 } |
| 237 } else { | 237 } else { |
| 238 color = DebugColors::MissingTileBorderColor(); | 238 color = DebugColors::MissingTileBorderColor(); |
| 239 width = DebugColors::MissingTileBorderWidth(layer_tree_impl()); | 239 width = DebugColors::MissingTileBorderWidth(layer_tree_impl()); |
| 240 } | 240 } |
| 241 | |
| 242 scoped_ptr<DebugBorderDrawQuad> debug_border_quad = | 241 scoped_ptr<DebugBorderDrawQuad> debug_border_quad = |
| 243 DebugBorderDrawQuad::Create(); | 242 DebugBorderDrawQuad::Create(); |
| 244 gfx::Rect geometry_rect = iter.geometry_rect(); | 243 gfx::Rect geometry_rect = iter.geometry_rect(); |
| 245 gfx::Rect visible_geometry_rect = geometry_rect; | 244 gfx::Rect visible_geometry_rect = geometry_rect; |
| 246 debug_border_quad->SetNew(shared_quad_state, | 245 debug_border_quad->SetNew(shared_quad_state, |
| 247 geometry_rect, | 246 geometry_rect, |
| 248 visible_geometry_rect, | 247 visible_geometry_rect, |
| 249 color, | 248 color, |
| 250 width); | 249 width); |
| 251 render_pass->AppendDrawQuad(debug_border_quad.PassAs<DrawQuad>()); | 250 render_pass->AppendDrawQuad(debug_border_quad.PassAs<DrawQuad>()); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 274 scoped_ptr<DrawQuad> draw_quad; | 273 scoped_ptr<DrawQuad> draw_quad; |
| 275 if (*iter && iter->IsReadyToDraw()) { | 274 if (*iter && iter->IsReadyToDraw()) { |
| 276 const ManagedTileState::TileVersion& tile_version = | 275 const ManagedTileState::TileVersion& tile_version = |
| 277 iter->GetTileVersionForDrawing(); | 276 iter->GetTileVersionForDrawing(); |
| 278 switch (tile_version.mode()) { | 277 switch (tile_version.mode()) { |
| 279 case ManagedTileState::TileVersion::RESOURCE_MODE: { | 278 case ManagedTileState::TileVersion::RESOURCE_MODE: { |
| 280 gfx::RectF texture_rect = iter.texture_rect(); | 279 gfx::RectF texture_rect = iter.texture_rect(); |
| 281 gfx::Rect opaque_rect = iter->opaque_rect(); | 280 gfx::Rect opaque_rect = iter->opaque_rect(); |
| 282 opaque_rect.Intersect(geometry_rect); | 281 opaque_rect.Intersect(geometry_rect); |
| 283 | 282 |
| 284 if (iter->contents_scale() != ideal_contents_scale_) | 283 if (iter->contents_scale() != ideal_contents_scale_) { |
|
danakj
2014/07/07 20:06:27
nit: don't need to add {}
weiliangc
2014/07/07 22:01:21
Done.
| |
| 285 append_quads_data->had_incomplete_tile = true; | 284 append_quads_data->num_incomplete_tiles++; |
| 285 } | |
| 286 | 286 |
| 287 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); | 287 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); |
| 288 quad->SetNew(shared_quad_state, | 288 quad->SetNew(shared_quad_state, |
| 289 geometry_rect, | 289 geometry_rect, |
| 290 opaque_rect, | 290 opaque_rect, |
| 291 visible_geometry_rect, | 291 visible_geometry_rect, |
| 292 tile_version.get_resource_id(), | 292 tile_version.get_resource_id(), |
| 293 texture_rect, | 293 texture_rect, |
| 294 iter.texture_size(), | 294 iter.texture_size(), |
| 295 tile_version.contents_swizzled()); | 295 tile_version.contents_swizzled()); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 351 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); | 351 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); |
| 352 quad->SetNew(shared_quad_state, | 352 quad->SetNew(shared_quad_state, |
| 353 geometry_rect, | 353 geometry_rect, |
| 354 visible_geometry_rect, | 354 visible_geometry_rect, |
| 355 color, | 355 color, |
| 356 false); | 356 false); |
| 357 render_pass->AppendDrawQuad(quad.PassAs<DrawQuad>()); | 357 render_pass->AppendDrawQuad(quad.PassAs<DrawQuad>()); |
| 358 } | 358 } |
| 359 | 359 |
| 360 append_quads_data->num_missing_tiles++; | 360 append_quads_data->num_missing_tiles++; |
| 361 append_quads_data->had_incomplete_tile = true; | 361 append_quads_data->num_incomplete_tiles++; |
|
danakj
2014/07/07 20:06:28
this means we're double counting missing tiles as
weiliangc
2014/07/07 22:01:21
Done.
| |
| 362 append_quads_data->approximated_visible_content_area += | 362 append_quads_data->approximated_visible_content_area += |
| 363 visible_geometry_rect.width() * visible_geometry_rect.height(); | 363 visible_geometry_rect.width() * visible_geometry_rect.height(); |
| 364 ++missing_tile_count; | 364 ++missing_tile_count; |
| 365 continue; | 365 continue; |
| 366 } | 366 } |
| 367 | 367 |
| 368 render_pass->AppendDrawQuad(draw_quad.Pass()); | 368 render_pass->AppendDrawQuad(draw_quad.Pass()); |
| 369 | 369 |
| 370 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { | 370 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { |
| 371 append_quads_data->approximated_visible_content_area += | 371 append_quads_data->approximated_visible_content_area += |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1640 return iterator_index_ < iterators_.size(); | 1640 return iterator_index_ < iterators_.size(); |
| 1641 } | 1641 } |
| 1642 | 1642 |
| 1643 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1643 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
| 1644 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1644 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
| 1645 return it->get_type() == iteration_stage_ && | 1645 return it->get_type() == iteration_stage_ && |
| 1646 (**it)->required_for_activation() == required_for_activation_; | 1646 (**it)->required_for_activation() == required_for_activation_; |
| 1647 } | 1647 } |
| 1648 | 1648 |
| 1649 } // namespace cc | 1649 } // namespace cc |
| OLD | NEW |