Chromium Code Reviews| 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/picture_layer_impl.h" | 5 #include "cc/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "cc/append_quads_data.h" | 8 #include "cc/append_quads_data.h" |
| 9 #include "cc/checkerboard_draw_quad.h" | 9 #include "cc/checkerboard_draw_quad.h" |
| 10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 // better scheme would be to maintain a tighter visibleContentRect for the | 209 // better scheme would be to maintain a tighter visibleContentRect for the |
| 210 // finer tilings. | 210 // finer tilings. |
| 211 CleanUpTilingsOnActiveLayer(seen_tilings); | 211 CleanUpTilingsOnActiveLayer(seen_tilings); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void PictureLayerImpl::dumpLayerProperties(std::string*, int indent) const { | 214 void PictureLayerImpl::dumpLayerProperties(std::string*, int indent) const { |
| 215 // TODO(enne): implement me | 215 // TODO(enne): implement me |
| 216 } | 216 } |
| 217 | 217 |
| 218 void PictureLayerImpl::updateTilePriorities() { | 218 void PictureLayerImpl::updateTilePriorities() { |
| 219 if (!tilings_->num_tilings()) { | |
| 220 last_screen_space_transform_ = screenSpaceTransform(); | |
| 221 last_bounds_ = bounds(); | |
| 222 last_content_bounds_ = contentBounds(); | |
| 223 last_content_scale_ = contentsScaleX(); | |
| 224 return; | |
| 225 } | |
| 226 | |
| 219 int current_source_frame_number = layerTreeImpl()->source_frame_number(); | 227 int current_source_frame_number = layerTreeImpl()->source_frame_number(); |
| 220 double current_frame_time = | 228 double current_frame_time = |
| 221 (layerTreeImpl()->CurrentFrameTime() - base::TimeTicks()).InSecondsF(); | 229 (layerTreeImpl()->CurrentFrameTime() - base::TimeTicks()).InSecondsF(); |
| 222 | 230 |
| 223 gfx::Transform current_screen_space_transform = | 231 gfx::Transform current_screen_space_transform = |
| 224 screenSpaceTransform(); | 232 screenSpaceTransform(); |
| 225 | 233 |
| 226 gfx::Rect viewport_in_content_space; | 234 gfx::Rect viewport_in_content_space; |
| 227 gfx::Transform screenToLayer(gfx::Transform::kSkipInitialization); | 235 gfx::Transform screenToLayer(gfx::Transform::kSkipInitialization); |
| 228 if (screenSpaceTransform().GetInverse(&screenToLayer)) { | 236 if (screenSpaceTransform().GetInverse(&screenToLayer)) { |
| 229 gfx::Rect device_viewport(layerTreeImpl()->device_viewport_size()); | 237 gfx::Rect device_viewport(layerTreeImpl()->device_viewport_size()); |
| 230 viewport_in_content_space = gfx::ToEnclosingRect( | 238 viewport_in_content_space = gfx::ToEnclosingRect( |
| 231 MathUtil::projectClippedRect(screenToLayer, device_viewport)); | 239 MathUtil::projectClippedRect(screenToLayer, device_viewport)); |
| 232 } | 240 } |
| 233 | 241 |
|
ccameron
2013/02/14 18:35:10
It'd be really nice to (in a separate change) have
danakj
2013/02/14 18:41:24
Yeh, this is just a way to avoid the matrix invers
| |
| 234 WhichTree tree = layerTreeImpl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; | 242 WhichTree tree = layerTreeImpl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
| 235 bool store_screen_space_quads_on_tiles = | 243 bool store_screen_space_quads_on_tiles = |
| 236 layerTreeImpl()->debug_state().traceAllRenderedFrames; | 244 layerTreeImpl()->debug_state().traceAllRenderedFrames; |
| 237 tilings_->UpdateTilePriorities( | 245 tilings_->UpdateTilePriorities( |
| 238 tree, | 246 tree, |
| 239 layerTreeImpl()->device_viewport_size(), | 247 layerTreeImpl()->device_viewport_size(), |
| 240 viewport_in_content_space, | 248 viewport_in_content_space, |
| 241 last_bounds_, | 249 last_bounds_, |
| 242 bounds(), | 250 bounds(), |
| 243 last_content_bounds_, | 251 last_content_bounds_, |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 return twin; | 735 return twin; |
| 728 } | 736 } |
| 729 | 737 |
| 730 void PictureLayerImpl::getDebugBorderProperties( | 738 void PictureLayerImpl::getDebugBorderProperties( |
| 731 SkColor* color, float* width) const { | 739 SkColor* color, float* width) const { |
| 732 *color = DebugColors::TiledContentLayerBorderColor(); | 740 *color = DebugColors::TiledContentLayerBorderColor(); |
| 733 *width = DebugColors::TiledContentLayerBorderWidth(layerTreeImpl()); | 741 *width = DebugColors::TiledContentLayerBorderWidth(layerTreeImpl()); |
| 734 } | 742 } |
| 735 | 743 |
| 736 } // namespace cc | 744 } // namespace cc |
| OLD | NEW |