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

Unified Diff: gpu/command_buffer/service/gpu_processor_mac.cc

Issue 2134006: Added EGL based GLContext.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 | « gpu/command_buffer/service/gpu_processor_linux.cc ('k') | gpu/command_buffer/service/gpu_processor_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « gpu/command_buffer/service/gpu_processor_linux.cc ('k') | gpu/command_buffer/service/gpu_processor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698