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

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

Issue 1230203007: Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
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/browser_compositor_overlay_candidate_valida tor.h" 8 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida tor.h"
9 #include "content/browser/compositor/buffer_queue.h" 9 #include "content/browser/compositor/buffer_queue.h"
10 #include "content/browser/compositor/reflector_impl.h" 10 #include "content/browser/compositor/reflector_impl.h"
11 #include "content/browser/gpu/gpu_surface_tracker.h" 11 #include "content/browser/gpu/gpu_surface_tracker.h"
12 #include "content/common/gpu/client/context_provider_command_buffer.h" 12 #include "content/common/gpu/client/context_provider_command_buffer.h"
13 #include "content/common/gpu/client/gl_helper.h" 13 #include "content/common/gpu/client/gl_helper.h"
14 #include "gpu/GLES2/gl2extchromium.h" 14 #include "gpu/GLES2/gl2extchromium.h"
15 #include "gpu/command_buffer/client/gles2_interface.h" 15 #include "gpu/command_buffer/client/gles2_interface.h"
16 16
17 namespace content { 17 namespace content {
18 18
19 GpuSurfacelessBrowserCompositorOutputSurface:: 19 GpuSurfacelessBrowserCompositorOutputSurface::
20 GpuSurfacelessBrowserCompositorOutputSurface( 20 GpuSurfacelessBrowserCompositorOutputSurface(
21 const scoped_refptr<ContextProviderCommandBuffer>& context, 21 const scoped_refptr<ContextProviderCommandBuffer>& context,
22 const scoped_refptr<ContextProviderCommandBuffer>& worker_context,
22 int surface_id, 23 int surface_id,
23 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, 24 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
24 scoped_ptr<BrowserCompositorOverlayCandidateValidator> 25 scoped_ptr<BrowserCompositorOverlayCandidateValidator>
25 overlay_candidate_validator, 26 overlay_candidate_validator,
26 unsigned int target, 27 unsigned int target,
27 unsigned int internalformat, 28 unsigned int internalformat,
28 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) 29 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager)
29 : GpuBrowserCompositorOutputSurface(context, 30 : GpuBrowserCompositorOutputSurface(context,
31 worker_context,
30 vsync_manager, 32 vsync_manager,
31 overlay_candidate_validator.Pass()), 33 overlay_candidate_validator.Pass()),
32 internalformat_(internalformat), 34 internalformat_(internalformat),
33 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { 35 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) {
34 capabilities_.uses_default_gl_framebuffer = false; 36 capabilities_.uses_default_gl_framebuffer = false;
35 capabilities_.flipped_output_surface = true; 37 capabilities_.flipped_output_surface = true;
36 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling 38 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling
37 // more closely with the previous surfaced behavior. 39 // more closely with the previous surfaced behavior.
38 // With a surface, swap buffer ack used to return early, before actually 40 // With a surface, swap buffer ack used to return early, before actually
39 // presenting the back buffer, enabling the browser compositor to run ahead. 41 // presenting the back buffer, enabling the browser compositor to run ahead.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 #endif 114 #endif
113 } 115 }
114 116
115 #if defined(OS_MACOSX) 117 #if defined(OS_MACOSX)
116 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() { 118 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() {
117 OnSwapBuffersComplete(); 119 OnSwapBuffersComplete();
118 } 120 }
119 #endif 121 #endif
120 122
121 } // namespace content 123 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698