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

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 303113007: Add software renderer support for surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/display.cc ('k') | content/browser/compositor/onscreen_display_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 6de5f4d3b3482fc38b5ec369285497758147efa1..1f8b3c022f0cd3ab502a07f5d3869744ab430892 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -161,28 +161,35 @@ scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface(
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseSurfaces)) {
- if (!context_provider.get())
- LOG(FATAL) << "Surfaces do not support software compositing yet";
// This gets a bit confusing. Here we have a ContextProvider configured to
// render directly to this widget. We need to make an OnscreenDisplayClient
// associated with this context, then return a SurfaceDisplayOutputSurface
// set up to draw to the display's surface.
cc::SurfaceManager* manager = surface_manager_.get();
- scoped_ptr<OnscreenDisplayClient> display_client(
- new OnscreenDisplayClient(context_provider, manager));
+ scoped_ptr<cc::OutputSurface> software_surface;
+ if (!context_provider) {
+ software_surface =
+ make_scoped_ptr(new SoftwareBrowserCompositorOutputSurface(
+ output_surface_proxy_,
+ CreateSoftwareOutputDevice(compositor),
+ per_compositor_data_[compositor]->surface_id,
+ &output_surface_map_,
+ compositor->vsync_manager()));
+ }
+ scoped_ptr<OnscreenDisplayClient> display_client(new OnscreenDisplayClient(
+ context_provider, software_surface.Pass(), manager));
// TODO(jamesr): Need to set up filtering for the
// GpuHostMsg_UpdateVSyncParameters message.
- scoped_refptr<cc::ContextProvider> offscreen_context_provider =
- ContextProviderCommandBuffer::Create(
- GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(),
- "Offscreen-MainThread");
- scoped_ptr<cc::SoftwareOutputDevice> software_device;
+ scoped_refptr<cc::ContextProvider> offscreen_context_provider;
+ if (context_provider) {
+ offscreen_context_provider = ContextProviderCommandBuffer::Create(
+ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(),
+ "Offscreen-Compositor");
+ }
scoped_ptr<SurfaceDisplayOutputSurface> output_surface(
- new SurfaceDisplayOutputSurface(display_client->display(),
- manager,
- offscreen_context_provider,
- software_device.Pass()));
+ new SurfaceDisplayOutputSurface(
+ display_client->display(), manager, offscreen_context_provider));
data->display_client = display_client.Pass();
return output_surface.PassAs<cc::OutputSurface>();
}
« no previous file with comments | « cc/surfaces/display.cc ('k') | content/browser/compositor/onscreen_display_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698