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

Side by Side Diff: services/ui/surfaces/direct_output_surface_ozone.cc

Issue 2213273002: ozone: Consolidate primary plane format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment on a single line. Created 4 years, 4 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
« no previous file with comments | « services/ui/surfaces/DEPS ('k') | ui/display/types/BUILD.gn » ('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 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 "services/ui/surfaces/direct_output_surface_ozone.h" 5 #include "services/ui/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 "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "cc/output/compositor_frame.h" 11 #include "cc/output/compositor_frame.h"
12 #include "cc/output/context_provider.h" 12 #include "cc/output/context_provider.h"
13 #include "cc/output/output_surface_client.h" 13 #include "cc/output/output_surface_client.h"
14 #include "cc/scheduler/begin_frame_source.h" 14 #include "cc/scheduler/begin_frame_source.h"
15 #include "components/display_compositor/buffer_queue.h" 15 #include "components/display_compositor/buffer_queue.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 #include "services/ui/common/gpu_service.h" 18 #include "services/ui/common/gpu_service.h"
19 #include "services/ui/common/mojo_gpu_memory_buffer_manager.h" 19 #include "services/ui/common/mojo_gpu_memory_buffer_manager.h"
20 #include "services/ui/gpu/mus_gpu_memory_buffer_manager.h" 20 #include "services/ui/gpu/mus_gpu_memory_buffer_manager.h"
21 #include "services/ui/surfaces/surfaces_context_provider.h" 21 #include "services/ui/surfaces/surfaces_context_provider.h"
22 #include "ui/display/types/display_snapshot.h"
22 23
23 using display_compositor::BufferQueue; 24 using display_compositor::BufferQueue;
24 25
25 namespace ui { 26 namespace ui {
26 27
27 DirectOutputSurfaceOzone::DirectOutputSurfaceOzone( 28 DirectOutputSurfaceOzone::DirectOutputSurfaceOzone(
28 scoped_refptr<SurfacesContextProvider> context_provider, 29 scoped_refptr<SurfacesContextProvider> context_provider,
29 gfx::AcceleratedWidget widget, 30 gfx::AcceleratedWidget widget,
30 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source, 31 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source,
31 uint32_t target, 32 uint32_t target,
32 uint32_t internalformat) 33 uint32_t internalformat)
33 : cc::OutputSurface(context_provider, nullptr, nullptr), 34 : cc::OutputSurface(context_provider, nullptr, nullptr),
34 gl_helper_(context_provider->ContextGL(), 35 gl_helper_(context_provider->ContextGL(),
35 context_provider->ContextSupport()), 36 context_provider->ContextSupport()),
36 synthetic_begin_frame_source_(synthetic_begin_frame_source), 37 synthetic_begin_frame_source_(synthetic_begin_frame_source),
37 weak_ptr_factory_(this) { 38 weak_ptr_factory_(this) {
38 buffer_queue_.reset(new BufferQueue( 39 buffer_queue_.reset(
39 context_provider->ContextGL(), target, internalformat, &gl_helper_, 40 new BufferQueue(context_provider->ContextGL(), target, internalformat,
40 MusGpuMemoryBufferManager::current(), widget)); 41 ui::DisplaySnapshot::PrimaryFormat(), &gl_helper_,
42 MusGpuMemoryBufferManager::current(), widget));
41 43
42 capabilities_.uses_default_gl_framebuffer = false; 44 capabilities_.uses_default_gl_framebuffer = false;
43 capabilities_.flipped_output_surface = true; 45 capabilities_.flipped_output_surface = true;
44 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling 46 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling
45 // more closely with the previous surfaced behavior. 47 // more closely with the previous surfaced behavior.
46 // With a surface, swap buffer ack used to return early, before actually 48 // With a surface, swap buffer ack used to return early, before actually
47 // presenting the back buffer, enabling the browser compositor to run ahead. 49 // presenting the back buffer, enabling the browser compositor to run ahead.
48 // Surfaceless implementation acks at the time of actual buffer swap, which 50 // Surfaceless implementation acks at the time of actual buffer swap, which
49 // shifts the start of the new frame forward relative to the old 51 // shifts the start of the new frame forward relative to the old
50 // implementation. 52 // implementation.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, 150 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size,
149 float scale_factor, 151 float scale_factor,
150 const gfx::ColorSpace& color_space, 152 const gfx::ColorSpace& color_space,
151 bool alpha) { 153 bool alpha) {
152 OutputSurface::Reshape(size, scale_factor, color_space, alpha); 154 OutputSurface::Reshape(size, scale_factor, color_space, alpha);
153 DCHECK(buffer_queue_); 155 DCHECK(buffer_queue_);
154 buffer_queue_->Reshape(SurfaceSize(), scale_factor, color_space); 156 buffer_queue_->Reshape(SurfaceSize(), scale_factor, color_space);
155 } 157 }
156 158
157 } // namespace ui 159 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/surfaces/DEPS ('k') | ui/display/types/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698