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

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

Issue 516663003: Surfaceless OutputSurface implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_process_transport_factory.h" 5 #include "content/browser/compositor/gpu_process_transport_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "cc/output/compositor_frame.h" 15 #include "cc/output/compositor_frame.h"
16 #include "cc/output/output_surface.h" 16 #include "cc/output/output_surface.h"
17 #include "cc/surfaces/surface_manager.h" 17 #include "cc/surfaces/surface_manager.h"
18 #include "content/browser/compositor/browser_compositor_output_surface.h" 18 #include "content/browser/compositor/browser_compositor_output_surface.h"
19 #include "content/browser/compositor/browser_compositor_output_surface_proxy.h" 19 #include "content/browser/compositor/browser_compositor_output_surface_proxy.h"
20 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" 20 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
21 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h"
21 #include "content/browser/compositor/onscreen_display_client.h" 22 #include "content/browser/compositor/onscreen_display_client.h"
22 #include "content/browser/compositor/reflector_impl.h" 23 #include "content/browser/compositor/reflector_impl.h"
23 #include "content/browser/compositor/software_browser_compositor_output_surface. h" 24 #include "content/browser/compositor/software_browser_compositor_output_surface. h"
24 #include "content/browser/compositor/surface_display_output_surface.h" 25 #include "content/browser/compositor/surface_display_output_surface.h"
25 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 26 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
26 #include "content/browser/gpu/gpu_data_manager_impl.h" 27 #include "content/browser/gpu/gpu_data_manager_impl.h"
27 #include "content/browser/gpu/gpu_surface_tracker.h" 28 #include "content/browser/gpu/gpu_surface_tracker.h"
28 #include "content/browser/renderer_host/render_widget_host_impl.h" 29 #include "content/browser/renderer_host/render_widget_host_impl.h"
29 #include "content/common/gpu/client/context_provider_command_buffer.h" 30 #include "content/common/gpu/client/context_provider_command_buffer.h"
30 #include "content/common/gpu/client/gl_helper.h" 31 #include "content/common/gpu/client/gl_helper.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface( 226 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface(
226 new SoftwareBrowserCompositorOutputSurface( 227 new SoftwareBrowserCompositorOutputSurface(
227 output_surface_proxy_, 228 output_surface_proxy_,
228 CreateSoftwareOutputDevice(compositor), 229 CreateSoftwareOutputDevice(compositor),
229 per_compositor_data_[compositor]->surface_id, 230 per_compositor_data_[compositor]->surface_id,
230 &output_surface_map_, 231 &output_surface_map_,
231 compositor->vsync_manager())); 232 compositor->vsync_manager()));
232 return surface.PassAs<cc::OutputSurface>(); 233 return surface.PassAs<cc::OutputSurface>();
233 } 234 }
234 235
235 scoped_ptr<BrowserCompositorOutputSurface> surface( 236 scoped_ptr<BrowserCompositorOutputSurface> surface;
236 new GpuBrowserCompositorOutputSurface( 237 #if defined(USE_OZONE)
237 context_provider, 238 if (ui::SurfaceFactoryOzone::GetInstance()->CanShowPrimaryPlaneAsOverlay()) {
238 per_compositor_data_[compositor]->surface_id, 239 surface.reset(new GpuSurfacelessBrowserCompositorOutputSurface(
239 &output_surface_map_, 240 context_provider,
240 compositor->vsync_manager(), 241 per_compositor_data_[compositor]->surface_id,
241 CreateOverlayCandidateValidator(compositor->widget()))); 242 &output_surface_map_,
243 compositor->vsync_manager(),
244 CreateOverlayCandidateValidator(compositor->widget()),
245 GL_RGB8_OES,
246 0));
247 }
248 #endif
249 if (!surface)
250 surface.reset(new GpuBrowserCompositorOutputSurface(
251 context_provider,
252 per_compositor_data_[compositor]->surface_id,
253 &output_surface_map_,
254 compositor->vsync_manager(),
255 CreateOverlayCandidateValidator(compositor->widget())));
256
242 if (data->reflector.get()) 257 if (data->reflector.get())
243 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get()); 258 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get());
244 259
245 return surface.PassAs<cc::OutputSurface>(); 260 return surface.PassAs<cc::OutputSurface>();
246 } 261 }
247 262
248 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector( 263 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector(
249 ui::Compositor* source, 264 ui::Compositor* source,
250 ui::Layer* target) { 265 ui::Layer* target) {
251 PerCompositorData* data = per_compositor_data_[source]; 266 PerCompositorData* data = per_compositor_data_[source];
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 475 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
461 observer_list_, 476 observer_list_,
462 OnLostResources()); 477 OnLostResources());
463 478
464 // Kill things that use the shared context before killing the shared context. 479 // Kill things that use the shared context before killing the shared context.
465 lost_gl_helper.reset(); 480 lost_gl_helper.reset();
466 lost_shared_main_thread_contexts = NULL; 481 lost_shared_main_thread_contexts = NULL;
467 } 482 }
468 483
469 } // namespace content 484 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698