| 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/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 bool has_draw_quad = false; | 291 bool has_draw_quad = false; |
| 292 if (*iter && iter->IsReadyToDraw()) { | 292 if (*iter && iter->IsReadyToDraw()) { |
| 293 const ManagedTileState::TileVersion& tile_version = | 293 const ManagedTileState::TileVersion& tile_version = |
| 294 iter->GetTileVersionForDrawing(); | 294 iter->GetTileVersionForDrawing(); |
| 295 switch (tile_version.mode()) { | 295 switch (tile_version.mode()) { |
| 296 case ManagedTileState::TileVersion::RESOURCE_MODE: { | 296 case ManagedTileState::TileVersion::RESOURCE_MODE: { |
| 297 gfx::RectF texture_rect = iter.texture_rect(); | 297 gfx::RectF texture_rect = iter.texture_rect(); |
| 298 gfx::Rect opaque_rect = iter->opaque_rect(); | 298 gfx::Rect opaque_rect = iter->opaque_rect(); |
| 299 opaque_rect.Intersect(geometry_rect); | 299 opaque_rect.Intersect(geometry_rect); |
| 300 | 300 |
| 301 if (iter->contents_scale() != ideal_contents_scale_ && | 301 // The raster_contents_scale_ is the best scale that the layer is |
| 302 // trying to produce, even though it may not be ideal. Since that's |
| 303 // the best the layer can promise in the future, consider those as |
| 304 // complete. But if a tile is ideal scale, we don't want to consider |
| 305 // it incomplete and trying to replace it with a tile at a worse |
| 306 // scale. |
| 307 if (iter->contents_scale() != raster_contents_scale_ && |
| 308 iter->contents_scale() != ideal_contents_scale_ && |
| 302 geometry_rect.Intersects(scaled_viewport_for_tile_priority)) { | 309 geometry_rect.Intersects(scaled_viewport_for_tile_priority)) { |
| 303 append_quads_data->num_incomplete_tiles++; | 310 append_quads_data->num_incomplete_tiles++; |
| 304 } | 311 } |
| 305 | 312 |
| 306 TileDrawQuad* quad = | 313 TileDrawQuad* quad = |
| 307 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); | 314 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); |
| 308 quad->SetNew(shared_quad_state, | 315 quad->SetNew(shared_quad_state, |
| 309 geometry_rect, | 316 geometry_rect, |
| 310 opaque_rect, | 317 opaque_rect, |
| 311 visible_geometry_rect, | 318 visible_geometry_rect, |
| (...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1744 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1751 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
| 1745 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1752 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
| 1746 return tiling_range.end - 1 - current_tiling_range_offset; | 1753 return tiling_range.end - 1 - current_tiling_range_offset; |
| 1747 } | 1754 } |
| 1748 } | 1755 } |
| 1749 NOTREACHED(); | 1756 NOTREACHED(); |
| 1750 return 0; | 1757 return 0; |
| 1751 } | 1758 } |
| 1752 | 1759 |
| 1753 } // namespace cc | 1760 } // namespace cc |
| OLD | NEW |