Index: gpu/command_buffer/service/gpu_processor_mac.cc |
=================================================================== |
--- gpu/command_buffer/service/gpu_processor_mac.cc (revision 49195) |
+++ gpu/command_buffer/service/gpu_processor_mac.cc (working copy) |
@@ -20,19 +20,15 @@ |
// Get the parent decoder and the GLContext to share IDs with, if any. |
gles2::GLES2Decoder* parent_decoder = NULL; |
gfx::GLContext* parent_context = NULL; |
- void* parent_handle = NULL; |
if (parent) { |
parent_decoder = parent->decoder_.get(); |
DCHECK(parent_decoder); |
parent_context = parent_decoder->GetGLContext(); |
DCHECK(parent_context); |
- |
- parent_handle = parent_context->GetHandle(); |
- DCHECK(parent_handle); |
} |
- context_.reset(gfx::GLContext::CreateOffscreenGLContext(parent_handle)); |
+ context_.reset(gfx::GLContext::CreateOffscreenGLContext(parent_context)); |
if (!context_.get()) |
return false; |
@@ -42,7 +38,6 @@ |
// is whether we allocate an AcceleratedSurface, which transmits the |
// rendering results back to the browser. |
if (window) { |
-#if !defined(UNIT_TEST) |
surface_.reset(new AcceleratedSurface()); |
// TODO(apatrick): AcceleratedSurface will not work with an OSMesa context. |
if (!surface_->Initialize( |
@@ -50,7 +45,6 @@ |
Destroy(); |
return false; |
} |
-#endif |
} |
return InitializeCommon(size, parent_decoder, parent_texture_id); |
@@ -59,51 +53,37 @@ |
} |
void GPUProcessor::Destroy() { |
-#if !defined(UNIT_TEST) |
if (surface_.get()) { |
surface_->Destroy(); |
} |
surface_.reset(); |
-#endif |
DestroyCommon(); |
} |
uint64 GPUProcessor::SetWindowSizeForIOSurface(const gfx::Size& size) { |
-#if !defined(UNIT_TEST) |
ResizeOffscreenFrameBuffer(size); |
decoder_->UpdateOffscreenFrameBufferSize(); |
return surface_->SetSurfaceSize(size); |
-#else |
- return 0; |
-#endif |
} |
TransportDIB::Handle GPUProcessor::SetWindowSizeForTransportDIB( |
const gfx::Size& size) { |
-#if !defined(UNIT_TEST) |
ResizeOffscreenFrameBuffer(size); |
decoder_->UpdateOffscreenFrameBufferSize(); |
return surface_->SetTransportDIBSize(size); |
-#else |
- return TransportDIB::DefaultHandleValue(); |
-#endif |
} |
void GPUProcessor::SetTransportDIBAllocAndFree( |
Callback2<size_t, TransportDIB::Handle*>::Type* allocator, |
Callback1<TransportDIB::Id>::Type* deallocator) { |
-#if !defined(UNIT_TEST) |
surface_->SetTransportDIBAllocAndFree(allocator, deallocator); |
-#endif |
} |
void GPUProcessor::WillSwapBuffers() { |
DCHECK(context_->IsCurrent()); |
-#if !defined(UNIT_TEST) |
if (surface_.get()) { |
surface_->SwapBuffers(); |
} |
-#endif |
if (wrapped_swap_buffers_callback_.get()) { |
wrapped_swap_buffers_callback_->Run(); |