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

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

Issue 1136006: Calling OpenGL from the renderer process. (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/gpu_processor.cc ('k') | gpu/command_buffer/service/gpu_processor_mac.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_linux.cc
===================================================================
--- gpu/command_buffer/service/gpu_processor_linux.cc (revision 42644)
+++ gpu/command_buffer/service/gpu_processor_linux.cc (working copy)
@@ -10,7 +10,10 @@
namespace gpu {
-bool GPUProcessor::Initialize(gfx::PluginWindowHandle handle) {
+bool GPUProcessor::Initialize(gfx::PluginWindowHandle handle,
+ GPUProcessor* parent,
+ const gfx::Size& size,
+ uint32 parent_texture_id) {
DCHECK(handle);
// Cannot reinitialize.
@@ -34,17 +37,27 @@
// Initialize GAPI immediately if the window handle is valid.
XWindowWrapper *window = new XWindowWrapper(GDK_DISPLAY(), handle);
decoder_->set_window_wrapper(window);
- return decoder_->Initialize();
-}
+ gles2::GLES2Decoder* parent_decoder = parent ? parent->decoder_.get() : NULL;
+ if (!decoder_->Initialize(parent_decoder,
+ size,
+ parent_texture_id)) {
+ Destroy();
+ return false;
+ }
+ return true;}
+
void GPUProcessor::Destroy() {
- // Destroy GAPI if window handle has not already become invalid.
- XWindowWrapper *window = decoder_->window();
- if (window) {
+ // Destroy decoder if initialized.
+ if (decoder_.get()) {
+ XWindowWrapper *window = decoder_->window();
decoder_->Destroy();
decoder_->set_window_wrapper(NULL);
delete window;
+ decoder_.reset();
}
+
+ parser_.reset();
}
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/gpu_processor.cc ('k') | gpu/command_buffer/service/gpu_processor_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698