| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 render_pass, | 171 render_pass, |
| 172 scaled_content_bounds, | 172 scaled_content_bounds, |
| 173 shared_quad_state, | 173 shared_quad_state, |
| 174 append_quads_data, | 174 append_quads_data, |
| 175 DebugColors::DirectPictureBorderColor(), | 175 DebugColors::DirectPictureBorderColor(), |
| 176 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); | 176 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); |
| 177 | 177 |
| 178 gfx::Rect geometry_rect = rect; | 178 gfx::Rect geometry_rect = rect; |
| 179 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); | 179 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); |
| 180 gfx::Rect visible_geometry_rect = occlusion_tracker.UnoccludedContentRect( | 180 gfx::Rect visible_geometry_rect = occlusion_tracker.UnoccludedContentRect( |
| 181 geometry_rect, draw_transform()); | 181 geometry_rect, scaled_draw_transform); |
| 182 if (visible_geometry_rect.IsEmpty()) | 182 if (visible_geometry_rect.IsEmpty()) |
| 183 return; | 183 return; |
| 184 | 184 |
| 185 gfx::Size texture_size = rect.size(); | 185 gfx::Size texture_size = rect.size(); |
| 186 gfx::RectF texture_rect = gfx::RectF(texture_size); | 186 gfx::RectF texture_rect = gfx::RectF(texture_size); |
| 187 gfx::Rect quad_content_rect = rect; | 187 gfx::Rect quad_content_rect = rect; |
| 188 | 188 |
| 189 scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create(); | 189 scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create(); |
| 190 quad->SetNew(shared_quad_state, | 190 quad->SetNew(shared_quad_state, |
| 191 geometry_rect, | 191 geometry_rect, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 std::vector<PictureLayerTiling*> seen_tilings; | 257 std::vector<PictureLayerTiling*> seen_tilings; |
| 258 | 258 |
| 259 size_t missing_tile_count = 0u; | 259 size_t missing_tile_count = 0u; |
| 260 size_t on_demand_missing_tile_count = 0u; | 260 size_t on_demand_missing_tile_count = 0u; |
| 261 for (PictureLayerTilingSet::CoverageIterator iter( | 261 for (PictureLayerTilingSet::CoverageIterator iter( |
| 262 tilings_.get(), max_contents_scale, rect, ideal_contents_scale_); | 262 tilings_.get(), max_contents_scale, rect, ideal_contents_scale_); |
| 263 iter; | 263 iter; |
| 264 ++iter) { | 264 ++iter) { |
| 265 gfx::Rect geometry_rect = iter.geometry_rect(); | 265 gfx::Rect geometry_rect = iter.geometry_rect(); |
| 266 gfx::Rect visible_geometry_rect = occlusion_tracker.UnoccludedContentRect( | 266 gfx::Rect visible_geometry_rect = occlusion_tracker.UnoccludedContentRect( |
| 267 geometry_rect, draw_transform()); | 267 geometry_rect, scaled_draw_transform); |
| 268 if (visible_geometry_rect.IsEmpty()) | 268 if (visible_geometry_rect.IsEmpty()) |
| 269 continue; | 269 continue; |
| 270 | 270 |
| 271 append_quads_data->visible_content_area += | 271 append_quads_data->visible_content_area += |
| 272 visible_geometry_rect.width() * visible_geometry_rect.height(); | 272 visible_geometry_rect.width() * visible_geometry_rect.height(); |
| 273 | 273 |
| 274 scoped_ptr<DrawQuad> draw_quad; | 274 scoped_ptr<DrawQuad> draw_quad; |
| 275 if (*iter && iter->IsReadyToDraw()) { | 275 if (*iter && iter->IsReadyToDraw()) { |
| 276 const ManagedTileState::TileVersion& tile_version = | 276 const ManagedTileState::TileVersion& tile_version = |
| 277 iter->GetTileVersionForDrawing(); | 277 iter->GetTileVersionForDrawing(); |
| (...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 return iterator_index_ < iterators_.size(); | 1644 return iterator_index_ < iterators_.size(); |
| 1645 } | 1645 } |
| 1646 | 1646 |
| 1647 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1647 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
| 1648 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1648 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
| 1649 return it->get_type() == iteration_stage_ && | 1649 return it->get_type() == iteration_stage_ && |
| 1650 (**it)->required_for_activation() == required_for_activation_; | 1650 (**it)->required_for_activation() == required_for_activation_; |
| 1651 } | 1651 } |
| 1652 | 1652 |
| 1653 } // namespace cc | 1653 } // namespace cc |
| OLD | NEW |