|
|
Created:
8 years, 9 months ago by danakj Modified:
8 years, 9 months ago CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, backer, Ben Goodger (Google) Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionAllow browser compositor to create an offscreen context3D.
This is needed for using compositor filters in Aura such as glass blur.
BUG=99528
TEST=
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=124594
Patch Set 1 #
Messages
Total messages: 9 (0 generated)
I'm not a great person to review this kind of thing. Can you ask one of the GPU folk? -Ben On Thu, Mar 1, 2012 at 3:06 PM, <danakj@chromium.org> wrote: > Reviewers: Ben Goodger (Google), > > Description: > Allow browser compositor to create an offscreen context3D. > > BUG=99528 > TEST= > > > Please review this at https://chromiumcodereview.**appspot.com/9568042/<https://chromiumcodereview.... > > SVN Base: svn://svn.chromium.org/chrome/**trunk/src<http://svn.chromium.org/chrome/trunk/src> > > Affected files: > M content/common/**webkitplatformsupport_impl.h > M content/common/**webkitplatformsupport_impl.cc > M content/renderer/renderer_**webkitplatformsupport_impl.h > M content/renderer/renderer_**webkitplatformsupport_impl.cc > > > Index: content/common/**webkitplatformsupport_impl.cc > diff --git a/content/common/**webkitplatformsupport_impl.cc > b/content/common/**webkitplatformsupport_impl.cc > index 3a32adf1f27cb7df91fc0a80c8eba4**18d020937c..** > 2ab541bb176a08acf8ef821afebfbc**fc0a437725 100644 > --- a/content/common/**webkitplatformsupport_impl.cc > +++ b/content/common/**webkitplatformsupport_impl.cc > @@ -2,10 +2,14 @@ > // Use of this source code is governed by a BSD-style license that can be > // found in the LICENSE file. > > +#include "base/command_line.h" > #include "content/common/child_thread.**h" > +#include "content/common/gpu/client/**webgraphicscontext3d_command_** > buffer_impl.h" > #include "content/common/socket_stream_**dispatcher.h" > #include "content/common/**webkitplatformsupport_impl.h" > #include "content/public/common/**content_client.h" > +#include "content/public/common/**content_switches.h" > +#include "webkit/gpu/**webgraphicscontext3d_in_**process_impl.h" > > namespace content { > > @@ -46,4 +50,23 @@ WebKitPlatformSupportImpl::**CreateWebSocketBridge( > return dispatcher->CreateBridge(**handle, delegate); > } > > +WebKit::WebGraphicsContext3D* > +WebKitPlatformSupportImpl::**createOffscreenGraphicsContext**3D( > + const WebGraphicsContext3D::**Attributes& attributes) { > + // The WebGraphicsContext3DInProcessI**mpl code path is used for > + // layout tests (though not through this code) as well as for > + // debugging and bringing up new ports. > + if (CommandLine::**ForCurrentProcess()->**HasSwitch(switches::**kInProcessWebGL)) > { > + return webkit::gpu::**WebGraphicsContext3DInProcessI** > mpl::CreateForWebView( > + attributes, false); > + } else { > + base::WeakPtr<**WebGraphicsContext3DSwapBuffer**sClient> null_client; > + scoped_ptr<**WebGraphicsContext3DCommandBuf**ferImpl> context( > + new WebGraphicsContext3DCommandBuf**ferImpl(0, GURL(), > null_client)); > + if (!context->Initialize(**attributes)) > + return NULL; > + return context.release(); > + } > +} > + > } // namespace content > Index: content/common/**webkitplatformsupport_impl.h > diff --git a/content/common/**webkitplatformsupport_impl.h > b/content/common/**webkitplatformsupport_impl.h > index 1904042cf26b9a8933b76dbbc1c904**778db1862c..** > b0d6cbcdb8cf3e4b9c9fe558d048d4**6628b38b05 100644 > --- a/content/common/**webkitplatformsupport_impl.h > +++ b/content/common/**webkitplatformsupport_impl.h > @@ -30,6 +30,8 @@ class CONTENT_EXPORT WebKitPlatformSupportImpl > virtual webkit_glue::**WebSocketStreamHandleBridge* > CreateWebSocketBridge( > WebKit::WebSocketStreamHandle* handle, > webkit_glue::**WebSocketStreamHandleDelegate* delegate) OVERRIDE; > + virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext** > 3D( > + const WebKit::WebGraphicsContext3D::**Attributes& attributes); > }; > > } // namespace content > Index: content/renderer/renderer_**webkitplatformsupport_impl.cc > diff --git a/content/renderer/renderer_**webkitplatformsupport_impl.cc > b/content/renderer/renderer_**webkitplatformsupport_impl.cc > index 66d15e6024837490594048cb101c4c**f3bc92c9c7..** > 240702d4de32d3fdd3de89ce13b2ce**0e21dbf0bc 100644 > --- a/content/renderer/renderer_**webkitplatformsupport_impl.cc > +++ b/content/renderer/renderer_**webkitplatformsupport_impl.cc > @@ -13,7 +13,6 @@ > #include "content/common/database_util.**h" > #include "content/common/file_system/**webfilesystem_impl.h" > #include "content/common/file_**utilities_messages.h" > -#include "content/common/gpu/client/**webgraphicscontext3d_command_** > buffer_impl.h" > #include "content/common/indexed_db/**proxy_webidbfactory_impl.h" > #include "content/common/mime_registry_**messages.h" > #include "content/common/npobject_util.**h" > @@ -50,7 +49,6 @@ > #include "webkit/glue/webclipboard_**impl.h" > #include "webkit/glue/webfileutilities_**impl.h" > #include "webkit/glue/webkit_glue.h" > -#include "webkit/gpu/**webgraphicscontext3d_in_**process_impl.h" > > #if defined(OS_WIN) > #include "content/common/child_process_**messages.h" > @@ -581,25 +579,6 @@ RendererWebKitPlatformSupportI**mpl::sharedWorkerRepository() > { > } > } > > -WebKit::WebGraphicsContext3D* > -**RendererWebKitPlatformSupportI**mpl::**createOffscreenGraphicsContext** > 3D( > - const WebGraphicsContext3D::**Attributes& attributes) { > - // The WebGraphicsContext3DInProcessI**mpl code path is used for > - // layout tests (though not through this code) as well as for > - // debugging and bringing up new ports. > - if (CommandLine::**ForCurrentProcess()->**HasSwitch(switches::**kInProcessWebGL)) > { > - return webkit::gpu::**WebGraphicsContext3DInProcessI** > mpl::CreateForWebView( > - attributes, false); > - } else { > - base::WeakPtr<**WebGraphicsContext3DSwapBuffer**sClient> null_client; > - scoped_ptr<**WebGraphicsContext3DCommandBuf**ferImpl> context( > - new WebGraphicsContext3DCommandBuf**ferImpl(0, GURL(), > null_client)); > - if (!context->Initialize(**attributes)) > - return NULL; > - return context.release(); > - } > -} > - > double RendererWebKitPlatformSupportI**mpl::audioHardwareSampleRate() { > return audio_hardware::**GetOutputSampleRate(); > } > Index: content/renderer/renderer_**webkitplatformsupport_impl.h > diff --git a/content/renderer/renderer_**webkitplatformsupport_impl.h > b/content/renderer/renderer_**webkitplatformsupport_impl.h > index 9b569771a9e4d95d8e66441f67f12c**e77ea93deb..** > 18fa046cbe2a102cbc365c5e231bee**34f547b319 100644 > --- a/content/renderer/renderer_**webkitplatformsupport_impl.h > +++ b/content/renderer/renderer_**webkitplatformsupport_impl.h > @@ -82,8 +82,6 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportI**mpl > const WebKit::WebString& keyPath) OVERRIDE; > virtual WebKit::WebFileSystem* fileSystem() OVERRIDE; > virtual WebKit::**WebSharedWorkerRepository* sharedWorkerRepository() > OVERRIDE; > - virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext** > 3D( > - const WebKit::WebGraphicsContext3D::**Attributes& attributes); > virtual double audioHardwareSampleRate() OVERRIDE; > virtual size_t audioHardwareBufferSize() OVERRIDE; > virtual WebKit::WebAudioDevice* createAudioDevice( > > >
Yup! Thanks. @brettw can you review this? On 2012/03/01 23:15:38, Ben Goodger (Google) wrote: > I'm not a great person to review this kind of thing. Can you ask one of the > GPU folk? > > -Ben > > On Thu, Mar 1, 2012 at 3:06 PM, <mailto:danakj@chromium.org> wrote: > > > Reviewers: Ben Goodger (Google), > > > > Description: > > Allow browser compositor to create an offscreen context3D. > > > > BUG=99528 > > TEST= > > > > > > Please review this at > https://chromiumcodereview.**appspot.com/9568042/%3Chttps://chromiumcoderevie...> > > > > SVN Base: > svn://svn.chromium.org/chrome/**trunk/src<http://svn.chromium.org/chrome/trunk/src> > > > > Affected files: > > M content/common/**webkitplatformsupport_impl.h > > M content/common/**webkitplatformsupport_impl.cc > > M content/renderer/renderer_**webkitplatformsupport_impl.h > > M content/renderer/renderer_**webkitplatformsupport_impl.cc > > > > > > Index: content/common/**webkitplatformsupport_impl.cc > > diff --git a/content/common/**webkitplatformsupport_impl.cc > > b/content/common/**webkitplatformsupport_impl.cc > > index 3a32adf1f27cb7df91fc0a80c8eba4**18d020937c..** > > 2ab541bb176a08acf8ef821afebfbc**fc0a437725 100644 > > --- a/content/common/**webkitplatformsupport_impl.cc > > +++ b/content/common/**webkitplatformsupport_impl.cc > > @@ -2,10 +2,14 @@ > > // Use of this source code is governed by a BSD-style license that can be > > // found in the LICENSE file. > > > > +#include "base/command_line.h" > > #include "content/common/child_thread.**h" > > +#include "content/common/gpu/client/**webgraphicscontext3d_command_** > > buffer_impl.h" > > #include "content/common/socket_stream_**dispatcher.h" > > #include "content/common/**webkitplatformsupport_impl.h" > > #include "content/public/common/**content_client.h" > > +#include "content/public/common/**content_switches.h" > > +#include "webkit/gpu/**webgraphicscontext3d_in_**process_impl.h" > > > > namespace content { > > > > @@ -46,4 +50,23 @@ WebKitPlatformSupportImpl::**CreateWebSocketBridge( > > return dispatcher->CreateBridge(**handle, delegate); > > } > > > > +WebKit::WebGraphicsContext3D* > > +WebKitPlatformSupportImpl::**createOffscreenGraphicsContext**3D( > > + const WebGraphicsContext3D::**Attributes& attributes) { > > + // The WebGraphicsContext3DInProcessI**mpl code path is used for > > + // layout tests (though not through this code) as well as for > > + // debugging and bringing up new ports. > > + if > (CommandLine::**ForCurrentProcess()->**HasSwitch(switches::**kInProcessWebGL)) > > { > > + return webkit::gpu::**WebGraphicsContext3DInProcessI** > > mpl::CreateForWebView( > > + attributes, false); > > + } else { > > + base::WeakPtr<**WebGraphicsContext3DSwapBuffer**sClient> null_client; > > + scoped_ptr<**WebGraphicsContext3DCommandBuf**ferImpl> context( > > + new WebGraphicsContext3DCommandBuf**ferImpl(0, GURL(), > > null_client)); > > + if (!context->Initialize(**attributes)) > > + return NULL; > > + return context.release(); > > + } > > +} > > + > > } // namespace content > > Index: content/common/**webkitplatformsupport_impl.h > > diff --git a/content/common/**webkitplatformsupport_impl.h > > b/content/common/**webkitplatformsupport_impl.h > > index 1904042cf26b9a8933b76dbbc1c904**778db1862c..** > > b0d6cbcdb8cf3e4b9c9fe558d048d4**6628b38b05 100644 > > --- a/content/common/**webkitplatformsupport_impl.h > > +++ b/content/common/**webkitplatformsupport_impl.h > > @@ -30,6 +30,8 @@ class CONTENT_EXPORT WebKitPlatformSupportImpl > > virtual webkit_glue::**WebSocketStreamHandleBridge* > > CreateWebSocketBridge( > > WebKit::WebSocketStreamHandle* handle, > > webkit_glue::**WebSocketStreamHandleDelegate* delegate) OVERRIDE; > > + virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext** > > 3D( > > + const WebKit::WebGraphicsContext3D::**Attributes& attributes); > > }; > > > > } // namespace content > > Index: content/renderer/renderer_**webkitplatformsupport_impl.cc > > diff --git a/content/renderer/renderer_**webkitplatformsupport_impl.cc > > b/content/renderer/renderer_**webkitplatformsupport_impl.cc > > index 66d15e6024837490594048cb101c4c**f3bc92c9c7..** > > 240702d4de32d3fdd3de89ce13b2ce**0e21dbf0bc 100644 > > --- a/content/renderer/renderer_**webkitplatformsupport_impl.cc > > +++ b/content/renderer/renderer_**webkitplatformsupport_impl.cc > > @@ -13,7 +13,6 @@ > > #include "content/common/database_util.**h" > > #include "content/common/file_system/**webfilesystem_impl.h" > > #include "content/common/file_**utilities_messages.h" > > -#include "content/common/gpu/client/**webgraphicscontext3d_command_** > > buffer_impl.h" > > #include "content/common/indexed_db/**proxy_webidbfactory_impl.h" > > #include "content/common/mime_registry_**messages.h" > > #include "content/common/npobject_util.**h" > > @@ -50,7 +49,6 @@ > > #include "webkit/glue/webclipboard_**impl.h" > > #include "webkit/glue/webfileutilities_**impl.h" > > #include "webkit/glue/webkit_glue.h" > > -#include "webkit/gpu/**webgraphicscontext3d_in_**process_impl.h" > > > > #if defined(OS_WIN) > > #include "content/common/child_process_**messages.h" > > @@ -581,25 +579,6 @@ > RendererWebKitPlatformSupportI**mpl::sharedWorkerRepository() > > { > > } > > } > > > > -WebKit::WebGraphicsContext3D* > > -**RendererWebKitPlatformSupportI**mpl::**createOffscreenGraphicsContext** > > 3D( > > - const WebGraphicsContext3D::**Attributes& attributes) { > > - // The WebGraphicsContext3DInProcessI**mpl code path is used for > > - // layout tests (though not through this code) as well as for > > - // debugging and bringing up new ports. > > - if > (CommandLine::**ForCurrentProcess()->**HasSwitch(switches::**kInProcessWebGL)) > > { > > - return webkit::gpu::**WebGraphicsContext3DInProcessI** > > mpl::CreateForWebView( > > - attributes, false); > > - } else { > > - base::WeakPtr<**WebGraphicsContext3DSwapBuffer**sClient> null_client; > > - scoped_ptr<**WebGraphicsContext3DCommandBuf**ferImpl> context( > > - new WebGraphicsContext3DCommandBuf**ferImpl(0, GURL(), > > null_client)); > > - if (!context->Initialize(**attributes)) > > - return NULL; > > - return context.release(); > > - } > > -} > > - > > double RendererWebKitPlatformSupportI**mpl::audioHardwareSampleRate() { > > return audio_hardware::**GetOutputSampleRate(); > > } > > Index: content/renderer/renderer_**webkitplatformsupport_impl.h > > diff --git a/content/renderer/renderer_**webkitplatformsupport_impl.h > > b/content/renderer/renderer_**webkitplatformsupport_impl.h > > index 9b569771a9e4d95d8e66441f67f12c**e77ea93deb..** > > 18fa046cbe2a102cbc365c5e231bee**34f547b319 100644 > > --- a/content/renderer/renderer_**webkitplatformsupport_impl.h > > +++ b/content/renderer/renderer_**webkitplatformsupport_impl.h > > @@ -82,8 +82,6 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportI**mpl > > const WebKit::WebString& keyPath) OVERRIDE; > > virtual WebKit::WebFileSystem* fileSystem() OVERRIDE; > > virtual WebKit::**WebSharedWorkerRepository* sharedWorkerRepository() > > OVERRIDE; > > - virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext** > > 3D( > > - const WebKit::WebGraphicsContext3D::**Attributes& attributes); > > virtual double audioHardwareSampleRate() OVERRIDE; > > virtual size_t audioHardwareBufferSize() OVERRIDE; > > virtual WebKit::WebAudioDevice* createAudioDevice( > > > > > >
LGTM you'll need OWNERS approval for someone from content/common/. I don't think anyone in that OWNERS file is super-familiar with GPU stuff (maybe that means we should add more people).
On 2012/03/02 00:01:06, jamesr wrote: > LGTM > > you'll need OWNERS approval for someone from content/common/. I don't think > anyone in that OWNERS file is super-familiar with GPU stuff (maybe that means we > should add more people). And for anyone who is a content/common/OWNERS, I'm a GPU person and I approve of this patch :)
On 2012/03/02 00:06:11, jamesr wrote: > On 2012/03/02 00:01:06, jamesr wrote: > > LGTM > > > > you'll need OWNERS approval for someone from content/common/. I don't think > > anyone in that OWNERS file is super-familiar with GPU stuff (maybe that means > we > > should add more people). > > And for anyone who is a content/common/OWNERS, I'm a GPU person and I approve of > this patch :) lgtm
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/9568042/1
Change committed as 124594
post-facto LGTM |