| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/surfaces/display.h" | 5 #include "cc/surfaces/display.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 aggregator_->SetFullDamageForSurface(current_surface_id_); | 402 aggregator_->SetFullDamageForSurface(current_surface_id_); |
| 403 } | 403 } |
| 404 | 404 |
| 405 void Display::OnSurfaceDamaged(SurfaceId surface_id, bool* changed) { | 405 void Display::OnSurfaceDamaged(SurfaceId surface_id, bool* changed) { |
| 406 if (aggregator_ && | 406 if (aggregator_ && |
| 407 aggregator_->previous_contained_surfaces().count(surface_id)) { | 407 aggregator_->previous_contained_surfaces().count(surface_id)) { |
| 408 Surface* surface = surface_manager_->GetSurfaceForId(surface_id); | 408 Surface* surface = surface_manager_->GetSurfaceForId(surface_id); |
| 409 if (surface) { | 409 if (surface) { |
| 410 const CompositorFrame& current_frame = surface->GetEligibleFrame(); | 410 const CompositorFrame& current_frame = surface->GetEligibleFrame(); |
| 411 if (!current_frame.delegated_frame_data || | 411 if (!current_frame.delegated_frame_data || |
| 412 !current_frame.delegated_frame_data->resource_list.size()) { | 412 current_frame.delegated_frame_data->resource_list.empty()) { |
| 413 aggregator_->ReleaseResources(surface_id); | 413 aggregator_->ReleaseResources(surface_id); |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 if (scheduler_) | 416 if (scheduler_) |
| 417 scheduler_->SurfaceDamaged(surface_id); | 417 scheduler_->SurfaceDamaged(surface_id); |
| 418 *changed = true; | 418 *changed = true; |
| 419 } else if (surface_id == current_surface_id_) { | 419 } else if (surface_id == current_surface_id_) { |
| 420 if (scheduler_) | 420 if (scheduler_) |
| 421 scheduler_->SurfaceDamaged(surface_id); | 421 scheduler_->SurfaceDamaged(surface_id); |
| 422 *changed = true; | 422 *changed = true; |
| 423 } | 423 } |
| 424 | 424 |
| 425 if (surface_id == current_surface_id_) | 425 if (surface_id == current_surface_id_) |
| 426 UpdateRootSurfaceResourcesLocked(); | 426 UpdateRootSurfaceResourcesLocked(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 SurfaceId Display::CurrentSurfaceId() { | 429 SurfaceId Display::CurrentSurfaceId() { |
| 430 return current_surface_id_; | 430 return current_surface_id_; |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace cc | 433 } // namespace cc |
| OLD | NEW |