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_) { |
285 append_quads_data->had_incomplete_tile = true; | 284 append_quads_data->had_incomplete_tile = true; |
| 285 append_quads_data->num_incomplete_tiles++; |
| 286 } |
286 | 287 |
287 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); | 288 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); |
288 quad->SetNew(shared_quad_state, | 289 quad->SetNew(shared_quad_state, |
289 geometry_rect, | 290 geometry_rect, |
290 opaque_rect, | 291 opaque_rect, |
291 visible_geometry_rect, | 292 visible_geometry_rect, |
292 tile_version.get_resource_id(), | 293 tile_version.get_resource_id(), |
293 texture_rect, | 294 texture_rect, |
294 iter.texture_size(), | 295 iter.texture_size(), |
295 tile_version.contents_swizzled()); | 296 tile_version.contents_swizzled()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 quad->SetNew(shared_quad_state, | 353 quad->SetNew(shared_quad_state, |
353 geometry_rect, | 354 geometry_rect, |
354 visible_geometry_rect, | 355 visible_geometry_rect, |
355 color, | 356 color, |
356 false); | 357 false); |
357 render_pass->AppendDrawQuad(quad.PassAs<DrawQuad>()); | 358 render_pass->AppendDrawQuad(quad.PassAs<DrawQuad>()); |
358 } | 359 } |
359 | 360 |
360 append_quads_data->num_missing_tiles++; | 361 append_quads_data->num_missing_tiles++; |
361 append_quads_data->had_incomplete_tile = true; | 362 append_quads_data->had_incomplete_tile = true; |
| 363 append_quads_data->num_incomplete_tiles++; |
362 append_quads_data->approximated_visible_content_area += | 364 append_quads_data->approximated_visible_content_area += |
363 visible_geometry_rect.width() * visible_geometry_rect.height(); | 365 visible_geometry_rect.width() * visible_geometry_rect.height(); |
364 ++missing_tile_count; | 366 ++missing_tile_count; |
365 continue; | 367 continue; |
366 } | 368 } |
367 | 369 |
368 render_pass->AppendDrawQuad(draw_quad.Pass()); | 370 render_pass->AppendDrawQuad(draw_quad.Pass()); |
369 | 371 |
370 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { | 372 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { |
371 append_quads_data->approximated_visible_content_area += | 373 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(); | 1642 return iterator_index_ < iterators_.size(); |
1641 } | 1643 } |
1642 | 1644 |
1643 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1645 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
1644 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1646 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
1645 return it->get_type() == iteration_stage_ && | 1647 return it->get_type() == iteration_stage_ && |
1646 (**it)->required_for_activation() == required_for_activation_; | 1648 (**it)->required_for_activation() == required_for_activation_; |
1647 } | 1649 } |
1648 | 1650 |
1649 } // namespace cc | 1651 } // namespace cc |
OLD | NEW |