| 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/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 return false; | 424 return false; |
| 425 | 425 |
| 426 return surface->HasUndrawnActiveFrame(); | 426 return surface->HasUndrawnActiveFrame(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void Display::OnSurfaceCreated(const SurfaceInfo& surface_info) { | 429 void Display::OnSurfaceCreated(const SurfaceInfo& surface_info) { |
| 430 if (scheduler_) | 430 if (scheduler_) |
| 431 scheduler_->SurfaceCreated(surface_info); | 431 scheduler_->SurfaceCreated(surface_info); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void Display::OnSurfaceDestroyed(const SurfaceId& surface_id) { | |
| 435 if (scheduler_) | |
| 436 scheduler_->SurfaceDestroyed(surface_id); | |
| 437 } | |
| 438 | |
| 439 void Display::OnSurfaceDamageExpected(const SurfaceId& surface_id, | 434 void Display::OnSurfaceDamageExpected(const SurfaceId& surface_id, |
| 440 const BeginFrameArgs& args) { | 435 const BeginFrameArgs& args) { |
| 441 if (scheduler_) | 436 if (scheduler_) |
| 442 scheduler_->SurfaceDamageExpected(surface_id, args); | 437 scheduler_->SurfaceDamageExpected(surface_id, args); |
| 443 } | 438 } |
| 444 | 439 |
| 445 void Display::OnSurfaceDiscarded(const SurfaceId& surface_id) { | 440 void Display::OnSurfaceDiscarded(const SurfaceId& surface_id) { |
| 441 if (scheduler_) |
| 442 scheduler_->SurfaceDiscarded(surface_id); |
| 443 |
| 446 if (aggregator_) | 444 if (aggregator_) |
| 447 aggregator_->ReleaseResources(surface_id); | 445 aggregator_->ReleaseResources(surface_id); |
| 448 } | 446 } |
| 449 | 447 |
| 450 const SurfaceId& Display::CurrentSurfaceId() { | 448 const SurfaceId& Display::CurrentSurfaceId() { |
| 451 return current_surface_id_; | 449 return current_surface_id_; |
| 452 } | 450 } |
| 453 | 451 |
| 454 void Display::ForceImmediateDrawAndSwapIfPossible() { | 452 void Display::ForceImmediateDrawAndSwapIfPossible() { |
| 455 if (scheduler_) | 453 if (scheduler_) |
| 456 scheduler_->ForceImmediateSwapIfPossible(); | 454 scheduler_->ForceImmediateSwapIfPossible(); |
| 457 } | 455 } |
| 458 | 456 |
| 459 } // namespace cc | 457 } // namespace cc |
| OLD | NEW |