diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-16 08:39:35 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-16 08:39:35 +0000 |
commit | bf5a8d13ec2321d56c34a986070476f61f3e5b1c (patch) | |
tree | 0109d0e0b685b97d93eb467192fb84f6317e5319 /content | |
parent | 2c9bc58faf9a0d67e64d6c38d94dbafea2f4e07b (diff) | |
download | chromium_src-bf5a8d13ec2321d56c34a986070476f61f3e5b1c.zip chromium_src-bf5a8d13ec2321d56c34a986070476f61f3e5b1c.tar.gz chromium_src-bf5a8d13ec2321d56c34a986070476f61f3e5b1c.tar.bz2 |
Add option to not generate resources on bind in OpenGL ES
This allowes us to more efficiently manage ids. It is
not OpenGL ES 2.0 compatible though it probably fits most OpenGL ES
programs.
Note that we need to turn this off on Pepper and/or probably
provide a way for Pepper to turn on on. I'm not sure of the
path Pepper takes to setup. Assuming it goes through
GraphicsContext3D then changes to webkit will be needed to
get the flag all the way down through IPC to the GPU process.
TEST=unit tests and ran a few pages in a chrome build
BUG=92260
Review URL: http://codereview.chromium.org/7633060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96904 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.cc | 9 | ||||
-rw-r--r-- | content/renderer/gpu/renderer_gl_context.cc | 6 | ||||
-rw-r--r-- | content/renderer/gpu/renderer_gl_context.h | 1 |
3 files changed, 12 insertions, 4 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index b37e787..73d16c6 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -55,10 +55,13 @@ GpuCommandBufferStub::GpuCommandBufferStub( parent_texture_for_initialization_(0), watchdog_(watchdog), task_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { - if (share_group) + if (share_group) { context_group_ = share_group->context_group_; - else - context_group_ = new gpu::gles2::ContextGroup; + } else { + // TODO(gman): this needs to be false for everything but Pepper. + bool bind_generates_resource = true; + context_group_ = new gpu::gles2::ContextGroup(bind_generates_resource); + } } GpuCommandBufferStub::~GpuCommandBufferStub() { diff --git a/content/renderer/gpu/renderer_gl_context.cc b/content/renderer/gpu/renderer_gl_context.cc index 2feeaca..426386e 100644 --- a/content/renderer/gpu/renderer_gl_context.cc +++ b/content/renderer/gpu/renderer_gl_context.cc @@ -94,6 +94,7 @@ RendererGLContext* RendererGLContext::CreateViewContext( render_view_id, gfx::Size(), share_resources, + false, share_group, allowed_extensions, attrib_list, @@ -129,6 +130,7 @@ RendererGLContext* RendererGLContext::CreateOffscreenContext( 0, size, share_resources, + false, share_group, allowed_extensions, attrib_list, @@ -306,6 +308,7 @@ bool RendererGLContext::Initialize(bool onscreen, int render_view_id, const gfx::Size& size, bool share_resources, + bool bind_generates_resource, RendererGLContext* share_group, const char* allowed_extensions, const int32* attrib_list, @@ -420,7 +423,8 @@ bool RendererGLContext::Initialize(bool onscreen, transfer_buffer.size, transfer_buffer.ptr, transfer_buffer_id_, - share_resources); + share_resources, + bind_generates_resource); size_ = size; diff --git a/content/renderer/gpu/renderer_gl_context.h b/content/renderer/gpu/renderer_gl_context.h index 8c84780..a9f9580 100644 --- a/content/renderer/gpu/renderer_gl_context.h +++ b/content/renderer/gpu/renderer_gl_context.h @@ -194,6 +194,7 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext> { int render_view_id, const gfx::Size& size, bool share_resources, + bool bind_generates_resource, RendererGLContext* share_group, const char* allowed_extensions, const int32* attrib_list, |