Chromium Code Reviews| Index: gpu/ipc/service/gpu_command_buffer_stub.cc |
| diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc |
| index 3f41a30555095398eacb3ddab053551bfa5bfb3d..17b4b1162cc5455fff0badeb4bbf62ed2a7b34fd 100644 |
| --- a/gpu/ipc/service/gpu_command_buffer_stub.cc |
| +++ b/gpu/ipc/service/gpu_command_buffer_stub.cc |
| @@ -623,7 +623,29 @@ bool GpuCommandBufferStub::Initialize( |
| decoder_->set_engine(executor_.get()); |
| if (offscreen) { |
| - surface_ = default_surface; |
| + if (init_params.attribs.own_offscreen_surface) { |
| + DVLOG(1) << __FUNCTION__ << "Hit the own_offscreen_surface path"; |
| + use_virtualized_gl_context_ = false; |
|
jbauman
2017/01/06 03:09:08
We probably need to actually fail context creation
klausw
2017/01/06 06:13:00
I don't have a strong opinion about this, but the
|
| + // Currently, we always get alpha channe by default. |
| + // TODO(klausw): add way to disable alpha? |
| + if (init_params.attribs.depth_size > 0) { |
| + surface_format.SetDepthBits(init_params.attribs.depth_size); |
| + } |
| + if (init_params.attribs.samples > 0) { |
| + surface_format.SetSamples(init_params.attribs.samples); |
| + } |
| + if (init_params.attribs.stencil_size > 0) { |
| + surface_format.SetStencilBits(init_params.attribs.stencil_size); |
| + } |
| + surface_ = gl::init::CreateOffscreenGLSurfaceWithFormat( |
| + gfx::Size(), surface_format); |
| + if (!surface_) { |
| + DLOG(ERROR) << "Failed to create surface."; |
| + return false; |
| + } |
| + } else { |
| + surface_ = default_surface; |
| + } |
| } else { |
| surface_ = ImageTransportSurface::CreateNativeSurface( |
| AsWeakPtr(), surface_handle_, surface_format); |