| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/surfaces/top_level_display_client.h" | 5 #include "components/mus/surfaces/top_level_display_client.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/surfaces/display.h" | 8 #include "cc/surfaces/display.h" |
| 9 #include "cc/surfaces/surface.h" | 9 #include "cc/surfaces/surface.h" |
| 10 #include "components/mus/gles2/gpu_state.h" | 10 #include "components/mus/gles2/gpu_state.h" |
| 11 #include "components/mus/surfaces/direct_output_surface.h" | 11 #include "components/mus/surfaces/direct_output_surface.h" |
| 12 #include "components/mus/surfaces/surfaces_context_provider.h" | 12 #include "components/mus/surfaces/surfaces_context_provider.h" |
| 13 #include "components/mus/surfaces/surfaces_scheduler.h" | 13 #include "components/mus/surfaces/surfaces_scheduler.h" |
| 14 #include "components/mus/surfaces/surfaces_state.h" | 14 #include "components/mus/surfaces/surfaces_state.h" |
| 15 | 15 |
| 16 namespace mus { | 16 namespace mus { |
| 17 namespace { | 17 namespace { |
| 18 void CallCallback(const base::Closure& callback, cc::SurfaceDrawStatus status) { | 18 void CallCallback(const base::Closure& callback, cc::SurfaceDrawStatus status) { |
| 19 callback.Run(); | 19 callback.Run(); |
| 20 } | 20 } |
| 21 } | 21 } |
| 22 | 22 |
| 23 TopLevelDisplayClient::TopLevelDisplayClient( | 23 TopLevelDisplayClient::TopLevelDisplayClient( |
| 24 gfx::AcceleratedWidget widget, | 24 gfx::AcceleratedWidget widget, |
| 25 const scoped_refptr<GpuState>& gpu_state, | 25 const scoped_refptr<GpuState>& gpu_state, |
| 26 const scoped_refptr<SurfacesState>& surfaces_state) | 26 const scoped_refptr<SurfacesState>& surfaces_state) |
| 27 : surfaces_state_(surfaces_state), | 27 : surfaces_state_(surfaces_state), |
| 28 factory_(surfaces_state->manager(), this), | 28 factory_(surfaces_state->manager(), this), |
| 29 cc_id_(static_cast<uint64_t>(surfaces_state->next_id_namespace()) << 32) { | 29 cc_id_(cc::SurfaceId::FromUnsafeValue( |
| 30 static_cast<uint64_t>(surfaces_state->next_id_namespace()) << 32)) { |
| 30 factory_.Create(cc_id_); | 31 factory_.Create(cc_id_); |
| 31 | 32 |
| 32 display_.reset(new cc::Display(this, surfaces_state_->manager(), nullptr, | 33 display_.reset(new cc::Display(this, surfaces_state_->manager(), nullptr, |
| 33 nullptr, cc::RendererSettings())); | 34 nullptr, cc::RendererSettings())); |
| 34 surfaces_state_->scheduler()->AddDisplay(display_.get()); | 35 surfaces_state_->scheduler()->AddDisplay(display_.get()); |
| 35 | 36 |
| 36 // TODO(brianderson): Reconcile with SurfacesScheduler crbug.com/476676 | 37 // TODO(brianderson): Reconcile with SurfacesScheduler crbug.com/476676 |
| 37 cc::DisplayScheduler* null_display_scheduler = nullptr; | 38 cc::DisplayScheduler* null_display_scheduler = nullptr; |
| 38 | 39 |
| 39 if (gpu_state->HardwareRenderingAvailable()) { | 40 if (gpu_state->HardwareRenderingAvailable()) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // TODO(fsamuel): Implement this. | 105 // TODO(fsamuel): Implement this. |
| 105 } | 106 } |
| 106 | 107 |
| 107 void TopLevelDisplayClient::SetBeginFrameSource( | 108 void TopLevelDisplayClient::SetBeginFrameSource( |
| 108 cc::SurfaceId surface_id, | 109 cc::SurfaceId surface_id, |
| 109 cc::BeginFrameSource* begin_frame_source) { | 110 cc::BeginFrameSource* begin_frame_source) { |
| 110 // TODO(tansell): Implement this. | 111 // TODO(tansell): Implement this. |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace mus | 114 } // namespace mus |
| OLD | NEW |