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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 310 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
311 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( | 311 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( |
312 current_frame_time_in_seconds)) { | 312 current_frame_time_in_seconds)) { |
313 tiling_needs_update = true; | 313 tiling_needs_update = true; |
314 break; | 314 break; |
315 } | 315 } |
316 } | 316 } |
317 if (!tiling_needs_update) | 317 if (!tiling_needs_update) |
318 return; | 318 return; |
319 | 319 |
320 // At this point, tile priorities are going to be modified. | |
321 layer_tree_impl()->WillModifyTilePriorities(); | |
322 | |
323 UpdateLCDTextStatus(can_use_lcd_text()); | 320 UpdateLCDTextStatus(can_use_lcd_text()); |
324 | 321 |
325 gfx::Transform current_screen_space_transform = screen_space_transform(); | 322 gfx::Transform current_screen_space_transform = screen_space_transform(); |
326 | 323 |
327 gfx::Size viewport_size = layer_tree_impl()->DrawViewportSize(); | 324 gfx::Size viewport_size = layer_tree_impl()->DrawViewportSize(); |
328 gfx::Rect viewport_in_content_space; | 325 gfx::Rect viewport_in_content_space; |
329 gfx::Transform screen_to_layer(gfx::Transform::kSkipInitialization); | 326 gfx::Transform screen_to_layer(gfx::Transform::kSkipInitialization); |
330 if (screen_space_transform().GetInverse(&screen_to_layer)) { | 327 if (screen_space_transform().GetInverse(&screen_to_layer)) { |
331 viewport_in_content_space = | 328 viewport_in_content_space = |
332 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( | 329 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( |
(...skipping 17 matching lines...) Expand all Loading... |
350 current_screen_space_transform, | 347 current_screen_space_transform, |
351 current_frame_time_in_seconds, | 348 current_frame_time_in_seconds, |
352 max_tiles_for_interest_area); | 349 max_tiles_for_interest_area); |
353 | 350 |
354 if (layer_tree_impl()->IsPendingTree()) | 351 if (layer_tree_impl()->IsPendingTree()) |
355 MarkVisibleResourcesAsRequired(); | 352 MarkVisibleResourcesAsRequired(); |
356 | 353 |
357 last_screen_space_transform_ = current_screen_space_transform; | 354 last_screen_space_transform_ = current_screen_space_transform; |
358 last_bounds_ = bounds(); | 355 last_bounds_ = bounds(); |
359 last_content_scale_ = contents_scale_x(); | 356 last_content_scale_ = contents_scale_x(); |
| 357 |
| 358 // Tile priorities were modified. |
| 359 layer_tree_impl()->DidModifyTilePriorities(); |
360 } | 360 } |
361 | 361 |
362 void PictureLayerImpl::DidBecomeActive() { | 362 void PictureLayerImpl::DidBecomeActive() { |
363 LayerImpl::DidBecomeActive(); | 363 LayerImpl::DidBecomeActive(); |
364 tilings_->DidBecomeActive(); | 364 tilings_->DidBecomeActive(); |
365 layer_tree_impl()->WillModifyTilePriorities(); | 365 layer_tree_impl()->DidModifyTilePriorities(); |
366 } | 366 } |
367 | 367 |
368 void PictureLayerImpl::DidBeginTracing() { | 368 void PictureLayerImpl::DidBeginTracing() { |
369 pile_->DidBeginTracing(); | 369 pile_->DidBeginTracing(); |
370 } | 370 } |
371 | 371 |
372 void PictureLayerImpl::DidLoseOutputSurface() { | 372 void PictureLayerImpl::DidLoseOutputSurface() { |
373 if (tilings_) | 373 if (tilings_) |
374 tilings_->RemoveAllTilings(); | 374 tilings_->RemoveAllTilings(); |
375 | 375 |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 coverage_tiles->Append(tile_data.release()); | 1069 coverage_tiles->Append(tile_data.release()); |
1070 } | 1070 } |
1071 state->Set("coverage_tiles", coverage_tiles.release()); | 1071 state->Set("coverage_tiles", coverage_tiles.release()); |
1072 } | 1072 } |
1073 | 1073 |
1074 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1074 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
1075 return tilings_->GPUMemoryUsageInBytes(); | 1075 return tilings_->GPUMemoryUsageInBytes(); |
1076 } | 1076 } |
1077 | 1077 |
1078 } // namespace cc | 1078 } // namespace cc |
OLD | NEW |