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

Side by Side Diff: content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc

Issue 943763004: cc: Remove the unused compositor thread variable and interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compositorthread: . Created 5 years, 10 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 "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h" 5 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "content/browser/compositor/buffer_queue.h" 8 #include "content/browser/compositor/buffer_queue.h"
9 #include "content/browser/compositor/reflector_impl.h" 9 #include "content/browser/compositor/reflector_impl.h"
10 #include "content/browser/gpu/gpu_surface_tracker.h" 10 #include "content/browser/gpu/gpu_surface_tracker.h"
11 #include "content/common/gpu/client/context_provider_command_buffer.h" 11 #include "content/common/gpu/client/context_provider_command_buffer.h"
12 #include "content/common/gpu/client/gl_helper.h" 12 #include "content/common/gpu/client/gl_helper.h"
13 #include "gpu/GLES2/gl2extchromium.h" 13 #include "gpu/GLES2/gl2extchromium.h"
14 #include "gpu/command_buffer/client/gles2_interface.h" 14 #include "gpu/command_buffer/client/gles2_interface.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 GpuSurfacelessBrowserCompositorOutputSurface:: 18 GpuSurfacelessBrowserCompositorOutputSurface::
19 GpuSurfacelessBrowserCompositorOutputSurface( 19 GpuSurfacelessBrowserCompositorOutputSurface(
20 const scoped_refptr<ContextProviderCommandBuffer>& context, 20 const scoped_refptr<ContextProviderCommandBuffer>& context,
21 int surface_id, 21 int surface_id,
22 IDMap<BrowserCompositorOutputSurface>* output_surface_map, 22 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
23 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, 23 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
24 scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator, 24 scoped_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator,
25 unsigned internalformat, 25 unsigned internalformat,
26 bool use_own_gl_helper,
27 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) 26 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager)
28 : GpuBrowserCompositorOutputSurface(context, 27 : GpuBrowserCompositorOutputSurface(context,
29 surface_id, 28 surface_id,
30 output_surface_map, 29 output_surface_map,
31 vsync_manager, 30 vsync_manager,
32 overlay_candidate_validator.Pass()), 31 overlay_candidate_validator.Pass()),
33 internalformat_(internalformat), 32 internalformat_(internalformat),
34 use_own_gl_helper_(use_own_gl_helper),
35 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { 33 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) {
36 capabilities_.uses_default_gl_framebuffer = false; 34 capabilities_.uses_default_gl_framebuffer = false;
37 capabilities_.flipped_output_surface = true; 35 capabilities_.flipped_output_surface = true;
38 } 36 }
39 37
40 GpuSurfacelessBrowserCompositorOutputSurface:: 38 GpuSurfacelessBrowserCompositorOutputSurface::
41 ~GpuSurfacelessBrowserCompositorOutputSurface() { 39 ~GpuSurfacelessBrowserCompositorOutputSurface() {
42 } 40 }
43 41
44 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( 42 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 float scale_factor) { 77 float scale_factor) {
80 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor); 78 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor);
81 DCHECK(output_surface_); 79 DCHECK(output_surface_);
82 output_surface_->Reshape(SurfaceSize(), scale_factor); 80 output_surface_->Reshape(SurfaceSize(), scale_factor);
83 } 81 }
84 82
85 bool GpuSurfacelessBrowserCompositorOutputSurface::BindToClient( 83 bool GpuSurfacelessBrowserCompositorOutputSurface::BindToClient(
86 cc::OutputSurfaceClient* client) { 84 cc::OutputSurfaceClient* client) {
87 if (!GpuBrowserCompositorOutputSurface::BindToClient(client)) 85 if (!GpuBrowserCompositorOutputSurface::BindToClient(client))
88 return false; 86 return false;
89 GLHelper* helper; 87 GLHelper* helper = ImageTransportFactory::GetInstance()->GetGLHelper();
90 if (use_own_gl_helper_) {
91 gl_helper_.reset(new GLHelper(context_provider_->ContextGL(),
92 context_provider_->ContextSupport()));
93 helper = gl_helper_.get();
94 } else {
95 helper = ImageTransportFactory::GetInstance()->GetGLHelper();
96 }
97 if (!helper) 88 if (!helper)
98 return false; 89 return false;
99
100 output_surface_.reset(new BufferQueue(context_provider_, internalformat_, 90 output_surface_.reset(new BufferQueue(context_provider_, internalformat_,
101 helper, gpu_memory_buffer_manager_, 91 helper, gpu_memory_buffer_manager_,
102 surface_id_)); 92 surface_id_));
103 return output_surface_->Initialize(); 93 return output_surface_->Initialize();
104 } 94 }
105 95
106 } // namespace content 96 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698