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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (*iter && iter->IsReadyToDraw()) { | 273 if (*iter && iter->IsReadyToDraw()) { |
274 const ManagedTileState::TileVersion& tile_version = | 274 const ManagedTileState::TileVersion& tile_version = |
275 iter->GetTileVersionForDrawing(); | 275 iter->GetTileVersionForDrawing(); |
276 switch (tile_version.mode()) { | 276 switch (tile_version.mode()) { |
277 case ManagedTileState::TileVersion::RESOURCE_MODE: { | 277 case ManagedTileState::TileVersion::RESOURCE_MODE: { |
278 gfx::RectF texture_rect = iter.texture_rect(); | 278 gfx::RectF texture_rect = iter.texture_rect(); |
279 gfx::Rect opaque_rect = iter->opaque_rect(); | 279 gfx::Rect opaque_rect = iter->opaque_rect(); |
280 opaque_rect.Intersect(geometry_rect); | 280 opaque_rect.Intersect(geometry_rect); |
281 | 281 |
282 if (iter->contents_scale() != ideal_contents_scale_) | 282 if (iter->contents_scale() != ideal_contents_scale_) |
283 append_quads_data->had_incomplete_tile = true; | 283 append_quads_data->num_incomplete_tiles++; |
284 | 284 |
285 TileDrawQuad* quad = | 285 TileDrawQuad* quad = |
286 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); | 286 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); |
287 quad->SetNew(shared_quad_state, | 287 quad->SetNew(shared_quad_state, |
288 geometry_rect, | 288 geometry_rect, |
289 opaque_rect, | 289 opaque_rect, |
290 visible_geometry_rect, | 290 visible_geometry_rect, |
291 tile_version.get_resource_id(), | 291 tile_version.get_resource_id(), |
292 texture_rect, | 292 texture_rect, |
293 iter.texture_size(), | 293 iter.texture_size(), |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 SolidColorDrawQuad* quad = | 347 SolidColorDrawQuad* quad = |
348 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 348 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
349 quad->SetNew(shared_quad_state, | 349 quad->SetNew(shared_quad_state, |
350 geometry_rect, | 350 geometry_rect, |
351 visible_geometry_rect, | 351 visible_geometry_rect, |
352 color, | 352 color, |
353 false); | 353 false); |
354 } | 354 } |
355 | 355 |
356 append_quads_data->num_missing_tiles++; | 356 append_quads_data->num_missing_tiles++; |
357 append_quads_data->had_incomplete_tile = true; | |
358 append_quads_data->approximated_visible_content_area += | 357 append_quads_data->approximated_visible_content_area += |
359 visible_geometry_rect.width() * visible_geometry_rect.height(); | 358 visible_geometry_rect.width() * visible_geometry_rect.height(); |
360 ++missing_tile_count; | 359 ++missing_tile_count; |
361 continue; | 360 continue; |
362 } | 361 } |
363 | 362 |
364 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { | 363 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { |
365 append_quads_data->approximated_visible_content_area += | 364 append_quads_data->approximated_visible_content_area += |
366 visible_geometry_rect.width() * visible_geometry_rect.height(); | 365 visible_geometry_rect.width() * visible_geometry_rect.height(); |
367 } | 366 } |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 return iterator_index_ < iterators_.size(); | 1628 return iterator_index_ < iterators_.size(); |
1630 } | 1629 } |
1631 | 1630 |
1632 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1631 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
1633 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1632 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
1634 return it->get_type() == iteration_stage_ && | 1633 return it->get_type() == iteration_stage_ && |
1635 (**it)->required_for_activation() == required_for_activation_; | 1634 (**it)->required_for_activation() == required_for_activation_; |
1636 } | 1635 } |
1637 | 1636 |
1638 } // namespace cc | 1637 } // namespace cc |
OLD | NEW |