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

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

Issue 1958813002: mus: Use BufferQueue and GLHelper from display_compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: , 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_ozone.h" 5 #include "components/mus/surfaces/direct_output_surface_ozone.h"
6 6
7 #include <utility> 7 #include <utility>
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 "components/display_compositor/buffer_queue.h"
13 #include "components/mus/gles2/mojo_gpu_memory_buffer_manager.h" 14 #include "components/mus/gles2/mojo_gpu_memory_buffer_manager.h"
14 #include "components/mus/surfaces/buffer_queue.h"
15 #include "components/mus/surfaces/surfaces_context_provider.h" 15 #include "components/mus/surfaces/surfaces_context_provider.h"
16 #include "gpu/command_buffer/client/context_support.h" 16 #include "gpu/command_buffer/client/context_support.h"
17 #include "gpu/command_buffer/client/gles2_interface.h" 17 #include "gpu/command_buffer/client/gles2_interface.h"
18 18
19 using display_compositor::BufferQueue;
20
19 namespace mus { 21 namespace mus {
20 22
21 DirectOutputSurfaceOzone::DirectOutputSurfaceOzone( 23 DirectOutputSurfaceOzone::DirectOutputSurfaceOzone(
22 const scoped_refptr<SurfacesContextProvider>& context_provider, 24 const scoped_refptr<SurfacesContextProvider>& context_provider,
23 gfx::AcceleratedWidget widget, 25 gfx::AcceleratedWidget widget,
24 base::SingleThreadTaskRunner* task_runner, 26 base::SingleThreadTaskRunner* task_runner,
25 uint32_t target, 27 uint32_t target,
26 uint32_t internalformat) 28 uint32_t internalformat)
27 : cc::OutputSurface(context_provider), 29 : cc::OutputSurface(context_provider),
28 output_surface_( 30 gl_helper_(context_provider->ContextGL(),
29 new BufferQueue(context_provider, target, internalformat, widget)), 31 context_provider->ContextSupport()),
32 output_surface_(new BufferQueue(context_provider,
33 target,
34 internalformat,
35 &gl_helper_,
36 &gpu_memory_buffer_manager_,
37 widget)),
30 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource( 38 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
31 task_runner, 39 task_runner,
32 cc::BeginFrameArgs::DefaultInterval())), 40 cc::BeginFrameArgs::DefaultInterval())),
33 weak_ptr_factory_(this) { 41 weak_ptr_factory_(this) {
34 capabilities_.uses_default_gl_framebuffer = false; 42 capabilities_.uses_default_gl_framebuffer = false;
35 capabilities_.flipped_output_surface = true; 43 capabilities_.flipped_output_surface = true;
36 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling 44 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling
37 // more closely with the previous surfaced behavior. 45 // more closely with the previous surfaced behavior.
38 // With a surface, swap buffer ack used to return early, before actually 46 // With a surface, swap buffer ack used to return early, before actually
39 // presenting the back buffer, enabling the browser compositor to run ahead. 47 // presenting the back buffer, enabling the browser compositor to run ahead.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // must create the native window in the size that the hardware reports. 147 // must create the native window in the size that the hardware reports.
140 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, 148 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size,
141 float scale_factor, 149 float scale_factor,
142 bool alpha) { 150 bool alpha) {
143 OutputSurface::Reshape(size, scale_factor, alpha); 151 OutputSurface::Reshape(size, scale_factor, alpha);
144 DCHECK(output_surface_); 152 DCHECK(output_surface_);
145 output_surface_->Reshape(SurfaceSize(), scale_factor); 153 output_surface_->Reshape(SurfaceSize(), scale_factor);
146 } 154 }
147 155
148 } // namespace mus 156 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/surfaces/direct_output_surface_ozone.h ('k') | components/mus/surfaces/ozone_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698