diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-19 06:44:39 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-19 06:44:39 +0000 |
commit | a3ded6d49e31e7b03926e30ee04bdb74a622ca9a (patch) | |
tree | c785c8cac83b0e7c30e50dbd24ed650397c59adf /chrome/renderer/ggl | |
parent | 10156ef03d6985f8c0a9def13b02ad6fc3cee7f9 (diff) | |
download | chromium_src-a3ded6d49e31e7b03926e30ee04bdb74a622ca9a.zip chromium_src-a3ded6d49e31e7b03926e30ee04bdb74a622ca9a.tar.gz chromium_src-a3ded6d49e31e7b03926e30ee04bdb74a622ca9a.tar.bz2 |
Add Ability to pass in allowed extensions to GPU contexts.
Questions:
1) Is WebGraphicsContext3D only used for WebGL? Currently
this patch makes that assumption.
2) I started by adding const char* allowed_extensions to
a bunch of functions. Then, at the IPC level added
GPUInitParams. Should I use GPUInitParams everywhere?
3) Is the path for gpu_init_params.h ok?
TEST=unit tests, manually tested WebGL
BUG=none
Review URL: http://codereview.chromium.org/3775014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/ggl')
-rw-r--r-- | chrome/renderer/ggl/ggl.cc | 18 | ||||
-rw-r--r-- | chrome/renderer/ggl/ggl.h | 4 |
2 files changed, 15 insertions, 7 deletions
diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc index f69e3c3..0589852 100644 --- a/chrome/renderer/ggl/ggl.cc +++ b/chrome/renderer/ggl/ggl.cc @@ -64,6 +64,7 @@ class Context : public base::SupportsWeakPtr<Context> { bool Initialize(gfx::NativeViewId view, int render_view_id, const gfx::Size& size, + const char* allowed_extensions, const int32* attrib_list); #if defined(OS_MACOSX) @@ -151,6 +152,7 @@ Context::~Context() { bool Context::Initialize(gfx::NativeViewId view, int render_view_id, const gfx::Size& size, + const char* allowed_extensions, const int32* attrib_list) { DCHECK(size.width() >= 0 && size.height() >= 0); @@ -199,15 +201,18 @@ bool Context::Initialize(gfx::NativeViewId view, // Create a proxy to a command buffer in the GPU process. if (view) { - // TODO(enne): this call should also handle attribs - command_buffer_ = - channel_->CreateViewCommandBuffer(view, render_view_id); + command_buffer_ = channel_->CreateViewCommandBuffer( + view, + render_view_id, + allowed_extensions, + attribs); } else { CommandBufferProxy* parent_command_buffer = parent_.get() ? parent_->command_buffer_ : NULL; command_buffer_ = channel_->CreateOffscreenCommandBuffer( parent_command_buffer, size, + allowed_extensions, attribs, parent_texture_id_); } @@ -408,10 +413,12 @@ void Context::OnSwapBuffers() { Context* CreateViewContext(GpuChannelHost* channel, gfx::NativeViewId view, int render_view_id, + const char* allowed_extensions, const int32* attrib_list) { #if defined(ENABLE_GPU) scoped_ptr<Context> context(new Context(channel, NULL)); - if (!context->Initialize(view, render_view_id, gfx::Size(), attrib_list)) + if (!context->Initialize( + view, render_view_id, gfx::Size(), allowed_extensions, attrib_list)) return NULL; return context.release(); @@ -431,10 +438,11 @@ void ResizeOnscreenContext(Context* context, const gfx::Size& size) { Context* CreateOffscreenContext(GpuChannelHost* channel, Context* parent, const gfx::Size& size, + const char* allowed_extensions, const int32* attrib_list) { #if defined(ENABLE_GPU) scoped_ptr<Context> context(new Context(channel, parent)); - if (!context->Initialize(0, 0, size, attrib_list)) + if (!context->Initialize(0, 0, size, allowed_extensions, attrib_list)) return NULL; return context.release(); diff --git a/chrome/renderer/ggl/ggl.h b/chrome/renderer/ggl/ggl.h index b535306..1d53f57 100644 --- a/chrome/renderer/ggl/ggl.h +++ b/chrome/renderer/ggl/ggl.h @@ -19,10 +19,8 @@ class GpuChannelHost; class MessageLoop; namespace media { - class VideoDecodeContext; class VideoDecodeEngine; - } namespace ggl { @@ -78,6 +76,7 @@ bool Terminate(); Context* CreateViewContext(GpuChannelHost* channel, gfx::NativeViewId view, int render_view_id, + const char* allowed_extensions, const int32* attrib_list); #if defined(OS_MACOSX) @@ -97,6 +96,7 @@ void ResizeOnscreenContext(Context* context, const gfx::Size& size); Context* CreateOffscreenContext(GpuChannelHost* channel, Context* parent, const gfx::Size& size, + const char* allowed_extensions, const int32* attrib_list); // Resize an offscreen frame buffer. The resize occurs on the next call to |