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

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

Issue 2002303002: Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: outputsurface-constructors: . Created 4 years, 7 months 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
OLDNEW
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 "components/mus/surfaces/direct_output_surface.h" 5 #include "components/mus/surfaces/direct_output_surface.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
11 #include "cc/output/context_provider.h" 11 #include "cc/output/context_provider.h"
12 #include "cc/output/output_surface_client.h" 12 #include "cc/output/output_surface_client.h"
13 #include "gpu/command_buffer/client/context_support.h" 13 #include "gpu/command_buffer/client/context_support.h"
14 #include "gpu/command_buffer/client/gles2_interface.h" 14 #include "gpu/command_buffer/client/gles2_interface.h"
15 15
16 namespace mus { 16 namespace mus {
17 17
18 DirectOutputSurface::DirectOutputSurface( 18 DirectOutputSurface::DirectOutputSurface(
19 scoped_refptr<SurfacesContextProvider> context_provider, 19 scoped_refptr<SurfacesContextProvider> context_provider,
20 base::SingleThreadTaskRunner* task_runner) 20 base::SingleThreadTaskRunner* task_runner)
21 : cc::OutputSurface(context_provider), 21 : cc::OutputSurface(context_provider, nullptr, nullptr),
rjkroege 2016/05/23 21:30:07 Perhaps DirectOutputSurfaceOzone's invocation of c
danakj 2016/05/23 21:30:46 Ya probably, I didn't try to build ozone locally.
22 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource( 22 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
23 task_runner, 23 task_runner,
24 cc::BeginFrameArgs::DefaultInterval())), 24 cc::BeginFrameArgs::DefaultInterval())),
25 weak_ptr_factory_(this) { 25 weak_ptr_factory_(this) {
26 context_provider->SetDelegate(this); 26 context_provider->SetDelegate(this);
27 } 27 }
28 28
29 DirectOutputSurface::~DirectOutputSurface() {} 29 DirectOutputSurface::~DirectOutputSurface() {}
30 30
31 bool DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { 31 bool DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 gpu::SyncToken sync_token; 73 gpu::SyncToken sync_token;
74 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); 74 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
75 75
76 context_provider_->ContextSupport()->SignalSyncToken( 76 context_provider_->ContextSupport()->SignalSyncToken(
77 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete, 77 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete,
78 weak_ptr_factory_.GetWeakPtr())); 78 weak_ptr_factory_.GetWeakPtr()));
79 client_->DidSwapBuffers(); 79 client_->DidSwapBuffers();
80 } 80 }
81 81
82 } // namespace mus 82 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698