| 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/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" | 
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" | 
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 104 bool Display::Initialize(std::unique_ptr<OutputSurface> output_surface, | 104 bool Display::Initialize(std::unique_ptr<OutputSurface> output_surface, | 
| 105                          base::SingleThreadTaskRunner* task_runner) { | 105                          base::SingleThreadTaskRunner* task_runner) { | 
| 106   output_surface_ = std::move(output_surface); | 106   output_surface_ = std::move(output_surface); | 
| 107   if (!output_surface_->BindToClient(this)) | 107   if (!output_surface_->BindToClient(this)) | 
| 108     return false; | 108     return false; | 
| 109   CreateScheduler(task_runner); | 109   CreateScheduler(task_runner); | 
| 110   return true; | 110   return true; | 
| 111 } | 111 } | 
| 112 | 112 | 
| 113 void Display::SetSurfaceId(SurfaceId id, float device_scale_factor) { | 113 void Display::SetSurfaceId(SurfaceId id, float device_scale_factor) { | 
| 114   DCHECK_EQ(id.id_namespace(), compositor_surface_namespace_); | 114   DCHECK_EQ(id.id_namespace, compositor_surface_namespace_); | 
| 115   if (current_surface_id_ == id && device_scale_factor_ == device_scale_factor) | 115   if (current_surface_id_ == id && device_scale_factor_ == device_scale_factor) | 
| 116     return; | 116     return; | 
| 117 | 117 | 
| 118   TRACE_EVENT0("cc", "Display::SetSurfaceId"); | 118   TRACE_EVENT0("cc", "Display::SetSurfaceId"); | 
| 119   current_surface_id_ = id; | 119   current_surface_id_ = id; | 
| 120   device_scale_factor_ = device_scale_factor; | 120   device_scale_factor_ = device_scale_factor; | 
| 121 | 121 | 
| 122   UpdateRootSurfaceResourcesLocked(); | 122   UpdateRootSurfaceResourcesLocked(); | 
| 123   if (scheduler_) | 123   if (scheduler_) | 
| 124     scheduler_->SetNewRootSurface(id); | 124     scheduler_->SetNewRootSurface(id); | 
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 419 | 419 | 
| 420   if (surface_id == current_surface_id_) | 420   if (surface_id == current_surface_id_) | 
| 421     UpdateRootSurfaceResourcesLocked(); | 421     UpdateRootSurfaceResourcesLocked(); | 
| 422 } | 422 } | 
| 423 | 423 | 
| 424 SurfaceId Display::CurrentSurfaceId() { | 424 SurfaceId Display::CurrentSurfaceId() { | 
| 425   return current_surface_id_; | 425   return current_surface_id_; | 
| 426 } | 426 } | 
| 427 | 427 | 
| 428 }  // namespace cc | 428 }  // namespace cc | 
| OLD | NEW | 
|---|