Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: components/mus/surfaces/top_level_display_client.cc

Issue 1496103002: Reusing base::IdType<...> to implement SurfaceId. Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-id-base
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/html_viewer/html_frame.cc ('k') | components/mus/ws/display_manager_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/html_viewer/html_frame.cc ('k') | components/mus/ws/display_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698