| 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 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 if (!layer_tree_impl()->device_viewport_valid_for_tile_management()) { | 307 if (!layer_tree_impl()->device_viewport_valid_for_tile_management()) { |
| 308 for (size_t i = 0; i < tilings_->num_tilings(); ++i) | 308 for (size_t i = 0; i < tilings_->num_tilings(); ++i) |
| 309 DCHECK(tilings_->tiling_at(i)->has_ever_been_updated()); | 309 DCHECK(tilings_->tiling_at(i)->has_ever_been_updated()); |
| 310 return; | 310 return; |
| 311 } | 311 } |
| 312 | 312 |
| 313 if (!tilings_->num_tilings()) | 313 if (!tilings_->num_tilings()) |
| 314 return; | 314 return; |
| 315 | 315 |
| 316 double current_frame_time_in_seconds = | 316 double current_frame_time_in_seconds = |
| 317 (layer_tree_impl()->CurrentFrameTimeTicks() - | 317 layer_tree_impl()->CurrentFrameTimeTicks().Unsafe_InSecondsF(); |
| 318 base::TimeTicks()).InSecondsF(); | |
| 319 | 318 |
| 320 bool tiling_needs_update = false; | 319 bool tiling_needs_update = false; |
| 321 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 320 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
| 322 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( | 321 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( |
| 323 current_frame_time_in_seconds)) { | 322 current_frame_time_in_seconds)) { |
| 324 tiling_needs_update = true; | 323 tiling_needs_update = true; |
| 325 break; | 324 break; |
| 326 } | 325 } |
| 327 } | 326 } |
| 328 if (!tiling_needs_update) | 327 if (!tiling_needs_update) |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 } | 1091 } |
| 1093 state->Set("coverage_tiles", coverage_tiles.release()); | 1092 state->Set("coverage_tiles", coverage_tiles.release()); |
| 1094 state->SetBoolean("is_using_lcd_text", is_using_lcd_text_); | 1093 state->SetBoolean("is_using_lcd_text", is_using_lcd_text_); |
| 1095 } | 1094 } |
| 1096 | 1095 |
| 1097 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1096 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
| 1098 return tilings_->GPUMemoryUsageInBytes(); | 1097 return tilings_->GPUMemoryUsageInBytes(); |
| 1099 } | 1098 } |
| 1100 | 1099 |
| 1101 } // namespace cc | 1100 } // namespace cc |
| OLD | NEW |