| 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/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 TRACE_EVENT0("cc", "Display::SetSurfaceId"); | 98 TRACE_EVENT0("cc", "Display::SetSurfaceId"); |
| 99 current_surface_id_ = id; | 99 current_surface_id_ = id; |
| 100 device_scale_factor_ = device_scale_factor; | 100 device_scale_factor_ = device_scale_factor; |
| 101 | 101 |
| 102 UpdateRootSurfaceResourcesLocked(); | 102 UpdateRootSurfaceResourcesLocked(); |
| 103 if (scheduler_) | 103 if (scheduler_) |
| 104 scheduler_->SetNewRootSurface(id); | 104 scheduler_->SetNewRootSurface(id); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void Display::SetVisible(bool visible) { |
| 108 TRACE_EVENT1("cc", "Display::SetVisible", "visible", visible); |
| 109 renderer_->SetVisible(visible); |
| 110 // TODO(danakj): Could tell DisplayScheduler about the visiblity. |
| 111 } |
| 112 |
| 107 void Display::Resize(const gfx::Size& size) { | 113 void Display::Resize(const gfx::Size& size) { |
| 108 if (size == current_surface_size_) | 114 if (size == current_surface_size_) |
| 109 return; | 115 return; |
| 110 | 116 |
| 111 TRACE_EVENT0("cc", "Display::Resize"); | 117 TRACE_EVENT0("cc", "Display::Resize"); |
| 112 | 118 |
| 113 // Need to ensure all pending swaps have executed before the window is | 119 // Need to ensure all pending swaps have executed before the window is |
| 114 // resized, or D3D11 will scale the swap output. | 120 // resized, or D3D11 will scale the swap output. |
| 115 if (settings_.finish_rendering_on_resize) { | 121 if (settings_.finish_rendering_on_resize) { |
| 116 if (!swapped_since_resize_ && scheduler_) | 122 if (!swapped_since_resize_ && scheduler_) |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 433 |
| 428 if (surface_id == current_surface_id_) | 434 if (surface_id == current_surface_id_) |
| 429 UpdateRootSurfaceResourcesLocked(); | 435 UpdateRootSurfaceResourcesLocked(); |
| 430 } | 436 } |
| 431 | 437 |
| 432 const SurfaceId& Display::CurrentSurfaceId() { | 438 const SurfaceId& Display::CurrentSurfaceId() { |
| 433 return current_surface_id_; | 439 return current_surface_id_; |
| 434 } | 440 } |
| 435 | 441 |
| 436 } // namespace cc | 442 } // namespace cc |
| OLD | NEW |