summaryrefslogtreecommitdiffstats
path: root/content/renderer/renderer_gl_context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/renderer_gl_context.cc')
-rw-r--r--content/renderer/renderer_gl_context.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/content/renderer/renderer_gl_context.cc b/content/renderer/renderer_gl_context.cc
index 0fea88ce..18e0c1d 100644
--- a/content/renderer/renderer_gl_context.cc
+++ b/content/renderer/renderer_gl_context.cc
@@ -156,6 +156,7 @@ RendererGLContext::~RendererGLContext() {
RendererGLContext* RendererGLContext::CreateViewContext(
GpuChannelHost* channel,
+ gfx::PluginWindowHandle render_surface,
int render_view_id,
const char* allowed_extensions,
const int32* attrib_list,
@@ -164,6 +165,7 @@ RendererGLContext* RendererGLContext::CreateViewContext(
scoped_ptr<RendererGLContext> context(new RendererGLContext(channel, NULL));
if (!context->Initialize(
true,
+ render_surface,
render_view_id,
gfx::Size(),
allowed_extensions,
@@ -196,6 +198,7 @@ RendererGLContext* RendererGLContext::CreateOffscreenContext(
scoped_ptr<RendererGLContext> context(new RendererGLContext(channel, parent));
if (!context->Initialize(
false,
+ gfx::kNullPluginWindow,
0,
size,
allowed_extensions,
@@ -366,6 +369,7 @@ RendererGLContext::RendererGLContext(GpuChannelHost* channel,
}
bool RendererGLContext::Initialize(bool onscreen,
+ gfx::PluginWindowHandle render_surface,
int render_view_id,
const gfx::Size& size,
const char* allowed_extensions,
@@ -419,11 +423,17 @@ bool RendererGLContext::Initialize(bool onscreen,
// Create a proxy to a command buffer in the GPU process.
if (onscreen) {
- command_buffer_ = channel_->CreateViewCommandBuffer(
- render_view_id,
- allowed_extensions,
- attribs,
- active_url);
+ if (render_surface == gfx::kNullPluginWindow) {
+ LOG(ERROR) << "Invalid surface handle for onscreen context.";
+ command_buffer_ = NULL;
+ } else {
+ command_buffer_ = channel_->CreateViewCommandBuffer(
+ render_surface,
+ render_view_id,
+ allowed_extensions,
+ attribs,
+ active_url);
+ }
} else {
CommandBufferProxy* parent_command_buffer =
parent_.get() ? parent_->command_buffer_ : NULL;