| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 AppendDebugBorderQuad( | 148 AppendDebugBorderQuad( |
| 149 quad_sink, | 149 quad_sink, |
| 150 shared_quad_state, | 150 shared_quad_state, |
| 151 append_quads_data, | 151 append_quads_data, |
| 152 DebugColors::DirectPictureBorderColor(), | 152 DebugColors::DirectPictureBorderColor(), |
| 153 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); | 153 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); |
| 154 | 154 |
| 155 gfx::Rect geometry_rect = rect; | 155 gfx::Rect geometry_rect = rect; |
| 156 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); | 156 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); |
| 157 gfx::Rect visible_geometry_rect = | 157 gfx::Rect visible_geometry_rect = |
| 158 quad_sink->UnoccludedContentRect(geometry_rect, draw_transform()); | 158 quad_sink->UnoccludedContentRect(this, geometry_rect, draw_transform()); |
| 159 if (visible_geometry_rect.IsEmpty()) | 159 if (visible_geometry_rect.IsEmpty()) |
| 160 return; | 160 return; |
| 161 | 161 |
| 162 gfx::Size texture_size = rect.size(); | 162 gfx::Size texture_size = rect.size(); |
| 163 gfx::RectF texture_rect = gfx::RectF(texture_size); | 163 gfx::RectF texture_rect = gfx::RectF(texture_size); |
| 164 gfx::Rect quad_content_rect = rect; | 164 gfx::Rect quad_content_rect = rect; |
| 165 float contents_scale = contents_scale_x(); | 165 float contents_scale = contents_scale_x(); |
| 166 | 166 |
| 167 scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create(); | 167 scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create(); |
| 168 quad->SetNew(shared_quad_state, | 168 quad->SetNew(shared_quad_state, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 std::vector<PictureLayerTiling*> seen_tilings; | 234 std::vector<PictureLayerTiling*> seen_tilings; |
| 235 | 235 |
| 236 size_t missing_tile_count = 0u; | 236 size_t missing_tile_count = 0u; |
| 237 size_t on_demand_missing_tile_count = 0u; | 237 size_t on_demand_missing_tile_count = 0u; |
| 238 for (PictureLayerTilingSet::CoverageIterator iter( | 238 for (PictureLayerTilingSet::CoverageIterator iter( |
| 239 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); | 239 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); |
| 240 iter; | 240 iter; |
| 241 ++iter) { | 241 ++iter) { |
| 242 gfx::Rect geometry_rect = iter.geometry_rect(); | 242 gfx::Rect geometry_rect = iter.geometry_rect(); |
| 243 gfx::Rect visible_geometry_rect = | 243 gfx::Rect visible_geometry_rect = |
| 244 quad_sink->UnoccludedContentRect(geometry_rect, draw_transform()); | 244 quad_sink->UnoccludedContentRect(this, geometry_rect, draw_transform()); |
| 245 if (visible_geometry_rect.IsEmpty()) | 245 if (visible_geometry_rect.IsEmpty()) |
| 246 continue; | 246 continue; |
| 247 | 247 |
| 248 append_quads_data->visible_content_area += | 248 append_quads_data->visible_content_area += |
| 249 visible_geometry_rect.width() * visible_geometry_rect.height(); | 249 visible_geometry_rect.width() * visible_geometry_rect.height(); |
| 250 | 250 |
| 251 scoped_ptr<DrawQuad> draw_quad; | 251 scoped_ptr<DrawQuad> draw_quad; |
| 252 if (*iter && iter->IsReadyToDraw()) { | 252 if (*iter && iter->IsReadyToDraw()) { |
| 253 const ManagedTileState::TileVersion& tile_version = | 253 const ManagedTileState::TileVersion& tile_version = |
| 254 iter->GetTileVersionForDrawing(); | 254 iter->GetTileVersionForDrawing(); |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 return iterator_index_ < iterators_.size(); | 1614 return iterator_index_ < iterators_.size(); |
| 1615 } | 1615 } |
| 1616 | 1616 |
| 1617 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1617 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
| 1618 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1618 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
| 1619 return it->get_type() == iteration_stage_ && | 1619 return it->get_type() == iteration_stage_ && |
| 1620 (**it)->required_for_activation() == required_for_activation_; | 1620 (**it)->required_for_activation() == required_for_activation_; |
| 1621 } | 1621 } |
| 1622 | 1622 |
| 1623 } // namespace cc | 1623 } // namespace cc |
| OLD | NEW |