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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 quad->SetNew(shared_quad_state, | 184 quad->SetNew(shared_quad_state, |
185 geometry_rect, | 185 geometry_rect, |
186 opaque_rect, | 186 opaque_rect, |
187 visible_geometry_rect, | 187 visible_geometry_rect, |
188 texture_rect, | 188 texture_rect, |
189 texture_size, | 189 texture_size, |
190 RGBA_8888, | 190 RGBA_8888, |
191 quad_content_rect, | 191 quad_content_rect, |
192 max_contents_scale, | 192 max_contents_scale, |
193 pile_); | 193 pile_); |
194 append_quads_data->num_missing_tiles++; | |
195 return; | 194 return; |
196 } | 195 } |
197 | 196 |
198 AppendDebugBorderQuad( | 197 AppendDebugBorderQuad( |
199 render_pass, scaled_content_bounds, shared_quad_state, append_quads_data); | 198 render_pass, scaled_content_bounds, shared_quad_state, append_quads_data); |
200 | 199 |
201 if (ShowDebugBorders()) { | 200 if (ShowDebugBorders()) { |
202 for (PictureLayerTilingSet::CoverageIterator iter( | 201 for (PictureLayerTilingSet::CoverageIterator iter( |
203 tilings_.get(), | 202 tilings_.get(), |
204 max_contents_scale, | 203 max_contents_scale, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if (*iter && iter->IsReadyToDraw()) { | 270 if (*iter && iter->IsReadyToDraw()) { |
272 const ManagedTileState::TileVersion& tile_version = | 271 const ManagedTileState::TileVersion& tile_version = |
273 iter->GetTileVersionForDrawing(); | 272 iter->GetTileVersionForDrawing(); |
274 switch (tile_version.mode()) { | 273 switch (tile_version.mode()) { |
275 case ManagedTileState::TileVersion::RESOURCE_MODE: { | 274 case ManagedTileState::TileVersion::RESOURCE_MODE: { |
276 gfx::RectF texture_rect = iter.texture_rect(); | 275 gfx::RectF texture_rect = iter.texture_rect(); |
277 gfx::Rect opaque_rect = iter->opaque_rect(); | 276 gfx::Rect opaque_rect = iter->opaque_rect(); |
278 opaque_rect.Intersect(geometry_rect); | 277 opaque_rect.Intersect(geometry_rect); |
279 | 278 |
280 if (iter->contents_scale() != ideal_contents_scale_) | 279 if (iter->contents_scale() != ideal_contents_scale_) |
281 append_quads_data->had_incomplete_tile = true; | 280 append_quads_data->num_incomplete_tiles++; |
282 | 281 |
283 TileDrawQuad* quad = | 282 TileDrawQuad* quad = |
284 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); | 283 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); |
285 quad->SetNew(shared_quad_state, | 284 quad->SetNew(shared_quad_state, |
286 geometry_rect, | 285 geometry_rect, |
287 opaque_rect, | 286 opaque_rect, |
288 visible_geometry_rect, | 287 visible_geometry_rect, |
289 tile_version.get_resource_id(), | 288 tile_version.get_resource_id(), |
290 texture_rect, | 289 texture_rect, |
291 iter.texture_size(), | 290 iter.texture_size(), |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 SolidColorDrawQuad* quad = | 344 SolidColorDrawQuad* quad = |
346 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 345 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
347 quad->SetNew(shared_quad_state, | 346 quad->SetNew(shared_quad_state, |
348 geometry_rect, | 347 geometry_rect, |
349 visible_geometry_rect, | 348 visible_geometry_rect, |
350 color, | 349 color, |
351 false); | 350 false); |
352 } | 351 } |
353 | 352 |
354 append_quads_data->num_missing_tiles++; | 353 append_quads_data->num_missing_tiles++; |
355 append_quads_data->had_incomplete_tile = true; | |
356 append_quads_data->approximated_visible_content_area += | 354 append_quads_data->approximated_visible_content_area += |
357 visible_geometry_rect.width() * visible_geometry_rect.height(); | 355 visible_geometry_rect.width() * visible_geometry_rect.height(); |
358 ++missing_tile_count; | 356 ++missing_tile_count; |
359 continue; | 357 continue; |
360 } | 358 } |
361 | 359 |
362 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { | 360 if (iter->priority(ACTIVE_TREE).resolution != HIGH_RESOLUTION) { |
363 append_quads_data->approximated_visible_content_area += | 361 append_quads_data->approximated_visible_content_area += |
364 visible_geometry_rect.width() * visible_geometry_rect.height(); | 362 visible_geometry_rect.width() * visible_geometry_rect.height(); |
365 } | 363 } |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 return iterator_index_ < iterators_.size(); | 1635 return iterator_index_ < iterators_.size(); |
1638 } | 1636 } |
1639 | 1637 |
1640 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1638 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
1641 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1639 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
1642 return it->get_type() == iteration_stage_ && | 1640 return it->get_type() == iteration_stage_ && |
1643 (**it)->required_for_activation() == required_for_activation_; | 1641 (**it)->required_for_activation() == required_for_activation_; |
1644 } | 1642 } |
1645 | 1643 |
1646 } // namespace cc | 1644 } // namespace cc |
OLD | NEW |