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

Unified Diff: gpu/command_buffer/service/gpu_processor_win.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_unittest.cc ('k') | gpu/command_buffer/service/texture_manager.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_win.cc
===================================================================
--- gpu/command_buffer/service/gpu_processor_win.cc (revision 42644)
+++ gpu/command_buffer/service/gpu_processor_win.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) {
// Cannot reinitialize.
if (parser_.get())
return false;
@@ -31,14 +34,25 @@
// Initialize GAPI immediately if the window handle is valid.
decoder_->set_hwnd(handle);
- 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 decoder if initialized.
- if (parser_.get()) {
+ if (decoder_.get()) {
decoder_->Destroy();
decoder_->set_hwnd(NULL);
+ decoder_.reset();
}
+
+ parser_.reset();
}
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/gpu_processor_unittest.cc ('k') | gpu/command_buffer/service/texture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698