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" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "cc/base/math_util.h" | 12 #include "cc/base/math_util.h" |
13 #include "cc/base/util.h" | 13 #include "cc/base/util.h" |
14 #include "cc/debug/debug_colors.h" | 14 #include "cc/debug/debug_colors.h" |
15 #include "cc/debug/micro_benchmark_impl.h" | 15 #include "cc/debug/micro_benchmark_impl.h" |
16 #include "cc/debug/traced_value.h" | 16 #include "cc/debug/traced_value.h" |
17 #include "cc/layers/append_quads_data.h" | 17 #include "cc/layers/append_quads_data.h" |
| 18 #include "cc/output/begin_frame_args.h" |
18 #include "cc/quads/checkerboard_draw_quad.h" | 19 #include "cc/quads/checkerboard_draw_quad.h" |
19 #include "cc/quads/debug_border_draw_quad.h" | 20 #include "cc/quads/debug_border_draw_quad.h" |
20 #include "cc/quads/picture_draw_quad.h" | 21 #include "cc/quads/picture_draw_quad.h" |
21 #include "cc/quads/solid_color_draw_quad.h" | 22 #include "cc/quads/solid_color_draw_quad.h" |
22 #include "cc/quads/tile_draw_quad.h" | 23 #include "cc/quads/tile_draw_quad.h" |
23 #include "cc/resources/tile_manager.h" | 24 #include "cc/resources/tile_manager.h" |
24 #include "cc/trees/layer_tree_impl.h" | 25 #include "cc/trees/layer_tree_impl.h" |
25 #include "cc/trees/occlusion_tracker.h" | 26 #include "cc/trees/occlusion_tracker.h" |
26 #include "ui/gfx/quad_f.h" | 27 #include "ui/gfx/quad_f.h" |
27 #include "ui/gfx/rect_conversions.h" | 28 #include "ui/gfx/rect_conversions.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 452 |
452 if (layer_tree_impl()->IsPendingTree()) | 453 if (layer_tree_impl()->IsPendingTree()) |
453 MarkVisibleResourcesAsRequired(); | 454 MarkVisibleResourcesAsRequired(); |
454 } | 455 } |
455 | 456 |
456 void PictureLayerImpl::UpdateTilePriorities( | 457 void PictureLayerImpl::UpdateTilePriorities( |
457 const OcclusionTracker<LayerImpl>* occlusion_tracker) { | 458 const OcclusionTracker<LayerImpl>* occlusion_tracker) { |
458 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); | 459 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); |
459 | 460 |
460 double current_frame_time_in_seconds = | 461 double current_frame_time_in_seconds = |
461 (layer_tree_impl()->CurrentFrameTimeTicks() - | 462 (layer_tree_impl()->CurrentBeginFrameArgs().frame_time - |
462 base::TimeTicks()).InSecondsF(); | 463 base::TimeTicks()).InSecondsF(); |
463 | 464 |
464 bool tiling_needs_update = false; | 465 bool tiling_needs_update = false; |
465 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 466 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
466 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( | 467 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( |
467 current_frame_time_in_seconds)) { | 468 current_frame_time_in_seconds)) { |
468 tiling_needs_update = true; | 469 tiling_needs_update = true; |
469 break; | 470 break; |
470 } | 471 } |
471 } | 472 } |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 return false; | 1741 return false; |
1741 } | 1742 } |
1742 return true; | 1743 return true; |
1743 } | 1744 } |
1744 | 1745 |
1745 PictureLayerImpl::LayerEvictionTileIterator::operator bool() const { | 1746 PictureLayerImpl::LayerEvictionTileIterator::operator bool() const { |
1746 return !!iterator_; | 1747 return !!iterator_; |
1747 } | 1748 } |
1748 | 1749 |
1749 } // namespace cc | 1750 } // namespace cc |
OLD | NEW |