| 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 // on the same callstack as the ContextProvider being created/initialized | 97 // on the same callstack as the ContextProvider being created/initialized |
| 98 // or else it could miss a callback before setting this. | 98 // or else it could miss a callback before setting this. |
| 99 context->SetLostContextCallback(base::Bind( | 99 context->SetLostContextCallback(base::Bind( |
| 100 &Display::DidLoseContextProvider, | 100 &Display::DidLoseContextProvider, |
| 101 // Unretained is safe since the callback is unset in this class' | 101 // Unretained is safe since the callback is unset in this class' |
| 102 // destructor and is never posted. | 102 // destructor and is never posted. |
| 103 base::Unretained(this))); | 103 base::Unretained(this))); |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 void Display::SetLocalFrameId(const LocalFrameId& id, | 107 void Display::SetLocalSurfaceId(const LocalSurfaceId& id, |
| 108 float device_scale_factor) { | 108 float device_scale_factor) { |
| 109 if (current_surface_id_.local_frame_id() == id && | 109 if (current_surface_id_.local_surface_id() == id && |
| 110 device_scale_factor_ == device_scale_factor) { | 110 device_scale_factor_ == device_scale_factor) { |
| 111 return; | 111 return; |
| 112 } | 112 } |
| 113 | 113 |
| 114 TRACE_EVENT0("cc", "Display::SetSurfaceId"); | 114 TRACE_EVENT0("cc", "Display::SetSurfaceId"); |
| 115 current_surface_id_ = SurfaceId(frame_sink_id_, id); | 115 current_surface_id_ = SurfaceId(frame_sink_id_, id); |
| 116 device_scale_factor_ = device_scale_factor; | 116 device_scale_factor_ = device_scale_factor; |
| 117 | 117 |
| 118 UpdateRootSurfaceResourcesLocked(); | 118 UpdateRootSurfaceResourcesLocked(); |
| 119 if (scheduler_) | 119 if (scheduler_) |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 const SurfaceId& Display::CurrentSurfaceId() { | 397 const SurfaceId& Display::CurrentSurfaceId() { |
| 398 return current_surface_id_; | 398 return current_surface_id_; |
| 399 } | 399 } |
| 400 | 400 |
| 401 void Display::ForceImmediateDrawAndSwapIfPossible() { | 401 void Display::ForceImmediateDrawAndSwapIfPossible() { |
| 402 if (scheduler_) | 402 if (scheduler_) |
| 403 scheduler_->ForceImmediateSwapIfPossible(); | 403 scheduler_->ForceImmediateSwapIfPossible(); |
| 404 } | 404 } |
| 405 | 405 |
| 406 } // namespace cc | 406 } // namespace cc |
| OLD | NEW |