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

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

Issue 1540004: Implemented offscreen rendering path for GLES2CmdDecoder on Linux.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/x_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_processor_linux.cc
===================================================================
--- gpu/command_buffer/service/gpu_processor_linux.cc (revision 43138)
+++ gpu/command_buffer/service/gpu_processor_linux.cc (working copy)
@@ -14,10 +14,8 @@
GPUProcessor* parent,
const gfx::Size& size,
uint32 parent_texture_id) {
- DCHECK(handle);
-
// Cannot reinitialize.
- if (decoder_->window() != NULL)
+ if (decoder_->context() != NULL)
return false;
// Map the ring buffer and create the parser.
@@ -34,9 +32,18 @@
decoder_.get()));
}
- // Initialize GAPI immediately if the window handle is valid.
- XWindowWrapper *window = new XWindowWrapper(GDK_DISPLAY(), handle);
- decoder_->set_window_wrapper(window);
+ // Initialize GAPI immediately.
+ GLXContextWrapper* wrapper = NULL;
+ if (size.width() > 0 && size.height() > 0) {
+ // Offscreen code path.
+ DCHECK(!handle);
+ wrapper = new GLXPbufferWrapper(GDK_DISPLAY());
+ } else {
+ DCHECK(handle);
+ // Onscreen code path.
+ wrapper = new XWindowWrapper(GDK_DISPLAY(), handle);
+ }
+ decoder_->set_context_wrapper(wrapper);
gles2::GLES2Decoder* parent_decoder = parent ? parent->decoder_.get() : NULL;
if (!decoder_->Initialize(parent_decoder,
size,
@@ -45,15 +52,17 @@
return false;
}
- return true;}
+ return true;
+}
void GPUProcessor::Destroy() {
// Destroy decoder if initialized.
+ // TODO(gman): simplify cleanup logic. http://crbug.com/39895
if (decoder_.get()) {
- XWindowWrapper *window = decoder_->window();
+ GLXContextWrapper *context = decoder_->context();
decoder_->Destroy();
- decoder_->set_window_wrapper(NULL);
- delete window;
+ decoder_->set_context_wrapper(NULL);
+ delete context;
decoder_.reset();
}
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/x_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698