summaryrefslogtreecommitdiffstats
path: root/content/renderer/gpu/renderer_gl_context.h
Commit message (Collapse)AuthorAgeFilesLines
* Move gpu client files to content_common, in content/common/gpu/clientpiman@chromium.org2012-02-071-211/+0
| | | | | | | | | | BUG=99516 TEST=compiles Review URL: http://codereview.chromium.org/9340012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120729 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert 119430 - Make transferbuffer increase in size dynamically"gman@chromium.org2012-01-271-1/+2
| | | | | | | | | | | | | This reverts commit 2f38c45427c68fe731c1f5c05256b6c141a6a590. BUG=101431 TEST= TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/9121057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119509 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 119430 - Make transferbuffer increase in size dynamicallykinuko@chromium.org2012-01-271-2/+1
| | | | | | | | | | | | | TEST=unit tests BUG=101431 Review URL: http://codereview.chromium.org/9113069 TBR=gman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9298005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119436 0039d316-1c4b-4281-b951-d872f2087c98
* Make transferbuffer increase in size dynamicallygman@chromium.org2012-01-271-1/+2
| | | | | | | | | | TEST=unit tests BUG=101431 Review URL: http://codereview.chromium.org/9113069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119430 0039d316-1c4b-4281-b951-d872f2087c98
* gpu: reference target surfaces through a globally unique surface id.piman@chromium.org2012-01-181-2/+2
| | | | | | | | | | | | | | | | This allows the gpu process to ignore all knowledge of renderers. It simplifies some of the gpu <-> browser and gpu <-> renderer IPC, but mostly paves the way for non-renderer clients. Surfaces are kept in a global GpuSurfaceTracker which is just a thread-safe map. BUG=99516 TEST=covered by existing tests. Run chrome, open poster circle (or other accelerated content page). Review URL: http://codereview.chromium.org/9194005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118172 0039d316-1c4b-4281-b951-d872f2087c98
* Remove TransportTexture, it's unusedpiman@chromium.org2012-01-041-5/+1
| | | | | | | | | | BUG=None TEST=compiles Review URL: http://codereview.chromium.org/9049013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116235 0039d316-1c4b-4281-b951-d872f2087c98
* Adding gl command to change surface visibility, so that the gpu process can ↵mmocny@chromium.org2011-10-141-0/+3
| | | | | | | | | | | | appropriately release/reacquire resources. BUG=5175544 TEST=None Review URL: http://codereview.chromium.org/7890046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105563 0039d316-1c4b-4281-b951-d872f2087c98
* Support dynamic switching between integrated and discrete GPUs on Mac OS X.kbr@chromium.org2011-10-131-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change Chrome to allocate most OpenGL contexts with the kCGLPFAAllowOfflineRenderers flag, and specify NSSupportsAutomaticGraphicsSwitching in the Info.plist for the main executable and helper apps. This keeps Chrome on the integrated GPU except when using WebGL, accelerated 2D Canvas, Pepper 3D, and Core Animation-based plugins (except Flash). Chrome shares resources between OpenGL contexts in order to display WebGL and other content in the compositor, and resource sharing doesn't work between contexts allocated on different GPUs. Therefore, when the first context for a given renderer requests the discrete GPU, the channel is dropped and all contexts are reallocated on the discrete GPU. Similarly, when the last context requesting the discrete GPU for a given renderer is shut down, all contexts are dropped and reallocated on the integrated GPU. Currently dynamic GPU switching is only supported on the latest Mac OS X 10.7 update and MacBook Pros with dual AMD / Intel GPUs, though this will improve in future OS updates. Tested with WebGL, CSS 3D, Flash and Unity3D content and observed desired GPU switching behavior. Also added a layout test to WebKit under https://bugs.webkit.org/show_bug.cgi?id=69776 which when run in Chrome catches an assertion failure related to the destruction of contexts. The intent is to add it as a UI layout test on the GPU bots. BUG=88788 TEST=none Review URL: http://codereview.chromium.org/8233027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105399 0039d316-1c4b-4281-b951-d872f2087c98
* Convert a bunch of pepper implementation to use base::Callback.dmichael@chromium.org2011-10-071-5/+5
| | | | | | | | | BUG=35223 TEST=ppapi ui_tests Review URL: http://codereview.chromium.org/8135010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104572 0039d316-1c4b-4281-b951-d872f2087c98
* Fix build error in release mode.husky@google.com2011-09-051-6/+3
| | | | | | | | | | | | | | I used a mix of NDEBUG and DHECK, but I didn't realise that DCHECKs are still compiled in release builds, and that the try bots don't catch this. Updated to use base::NonThreadSafe, which is both simpler and safer. TBR=kbr@chromium.org Review URL: http://codereview.chromium.org/7834021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99650 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 98392 - Split WebGraphicsContext3DCommandBufferImpl::initialize() ↵husky@google.com2011-09-051-0/+4
| | | | | | | | | | | | | | | | | into two stages. After the context is created, the remaining calls should be done on the compositor thread. This CL adds a MaybeInitializeGL() method, which we run on each call to makeContextCurrent(). Added asserts to RendererGLContext to check that it's always used on the same thread. Original review URL: http://codereview.chromium.org/7713015 Reverted due to buildbot errors: http://codereview.chromium.org/7745042 Review URL: http://codereview.chromium.org/7828046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99648 0039d316-1c4b-4281-b951-d872f2087c98
* Added GPU process "echo" IPC message.apatrick@chromium.org2011-08-301-6/+5
| | | | | | | | | | | The echo message is essentially an async fence with event based notification. The client gets a notification when the GPU process has completed all the work up to the last flush. I used it to replace the SwapBuffers / OnSwapBuffers synchronization and got rid of some of the callbacks in the lower layers of the stack. The SwapBuffers callbacks in the GPU process are only needed on mac now and I will replace them with something more generic soon. Review URL: http://codereview.chromium.org/7762013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98747 0039d316-1c4b-4281-b951-d872f2087c98
* Use 3D graphics context shareResources flag to decide whether a context ↵apatrick@chromium.org2011-08-271-22/+21
| | | | | | | | | | | | | | | should share resources. Before, it abused the noExtensions flag to determine to disable share groups for WebGL, which was awful. This patch is dependent on https://bugs.webkit.org/show_bug.cgi?id=66516. See also http://codereview.chromium.org/7669072 where I perpetrated the aforementioned hack. BUG=92356 Review URL: http://codereview.chromium.org/7669072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98527 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 98392 - Split WebGraphicsContext3DCommandBufferImpl::initialize() ↵wez@chromium.org2011-08-261-4/+0
| | | | | | | | | | | | | | | | | | into two stages. After the context is created, the remaining calls should be done on the compositor thread. This CL adds a MaybeInitializeGL() method, which we run on each call to makeContextCurrent(). Added asserts to RendererGLContext to check that it's always used on the same thread. Review URL: http://codereview.chromium.org/7713015 TBR=husky@google.com Review URL: http://codereview.chromium.org/7745042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98395 0039d316-1c4b-4281-b951-d872f2087c98
* Split WebGraphicsContext3DCommandBufferImpl::initialize() into two stages.husky@google.com2011-08-261-0/+4
| | | | | | | | | | | | | After the context is created, the remaining calls should be done on the compositor thread. This CL adds a MaybeInitializeGL() method, which we run on each call to makeContextCurrent(). Added asserts to RendererGLContext to check that it's always used on the same thread. Review URL: http://codereview.chromium.org/7713015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98392 0039d316-1c4b-4281-b951-d872f2087c98
* Unify MacOS resizing path with glResizeCHROMIUM.nduca@chromium.org2011-08-221-15/+0
| | | | | | | | Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97644 Review URL: http://codereview.chromium.org/7671035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97668 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 97644 - Unify MacOS resizing path with glResizeCHROMIUM.nduca@chromium.org2011-08-221-0/+15
| | | | | | | | | Review URL: http://codereview.chromium.org/7671035 TBR=nduca@chromium.org Review URL: http://codereview.chromium.org/7713001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97645 0039d316-1c4b-4281-b951-d872f2087c98
* Unify MacOS resizing path with glResizeCHROMIUM.nduca@chromium.org2011-08-221-15/+0
| | | | | | Review URL: http://codereview.chromium.org/7671035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97644 0039d316-1c4b-4281-b951-d872f2087c98
* Add option to not generate resources on bind in OpenGL ESgman@chromium.org2011-08-161-0/+1
| | | | | | | | | | | | | | | | | | | 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
* Delete copy_texture_to_parent_texture from GPU command buffer code.apatrick@chromium.org2011-08-101-0/+3
| | | | | | | Because we aren't using it for anything anymore. Review URL: http://codereview.chromium.org/7538008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96238 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented support for GL context share groups in the renderer process.I ↵apatrick@chromium.org2011-08-031-0/+3
| | | | | | | | put all compositor and canvas contexts in the same share group so they can share IDs. Review URL: http://codereview.chromium.org/7554015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95345 0039d316-1c4b-4281-b951-d872f2087c98
* Added PPB_Graphics3D_Dev::Resize to let plugins resize the backing surface.alokp@chromium.org2011-08-011-0/+2
| | | | | | | BUG=62383 Review URL: http://codereview.chromium.org/7530010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94930 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 94743 - Allow the renderer process to map textures from one context ↵jamesr@chromium.org2011-07-301-29/+0
| | | | | | | | | | | | | | | | | | | | into another. This is on an individual resource basis rather than general share groups in order to hide be able to hide the full namespace from untrusted plugins. Accelerated 2D canvas now no longer needs to copy its backing store on every page composite and the redundant backing texture is not needed, saving video memory. Unit tests for the GPU service to follow. Patch to delete copyTextureToParentTexture extensions from gpu/ to follow. BUG=90714 Review URL: http://codereview.chromium.org/7529015 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7518016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94808 0039d316-1c4b-4281-b951-d872f2087c98
* Allow the renderer process to map textures from one context into another.apatrick@chromium.org2011-07-291-0/+29
| | | | | | | | | | | | | | | This is on an individual resource basis rather than general share groups in order to hide be able to hide the full namespace from untrusted plugins. Accelerated 2D canvas now no longer needs to copy its backing store on every page composite and the redundant backing texture is not needed, saving video memory. Unit tests for the GPU service to follow. Patch to delete copyTextureToParentTexture extensions from gpu/ to follow. BUG=90714 Review URL: http://codereview.chromium.org/7529015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94743 0039d316-1c4b-4281-b951-d872f2087c98
* Removed vestigial GL_latch_CHROMIUM code.apatrick@chromium.org2011-07-271-18/+0
| | | | | | | | | glFlush now has barrier semantics and is now used as an alternative. This patch is dependent on https://bugs.webkit.org/show_bug.cgi?id=65043, now landed as webkit r91736. Review URL: http://codereview.chromium.org/7495009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94215 0039d316-1c4b-4281-b951-d872f2087c98
* Detect and expose loss of OpenGL context using GL_ARB_robustness.kbr@chromium.org2011-07-141-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This CL was originally reviewed under http://codereview.chromium.org/7331020/ . The only difference is the removal of an #include from command_buffer.h that was accidentally left in and which caused a significant increase in the number of files containing static initializers, presumably because of the dependent #include of <iostream>.) This initial patch changes the Linux port to use GLX_ARB_create_context_robustness when available, and tests periodically whether the context has been lost after each draw call and when making the context current. The detection of context loss also works with EGL and ANGLE, although it always reports an unknown reset status. WebKit changes will follow which test the reset status and determine what to do in response; for example, the policy might be to never restore a WebGL context which was lost (due to a GPU reset) and which was determined to be the guilty context. Tested manually with WebGL stress tests and verified on Linux and Windows that in at least some situations it is possible to detect guilty contexts and shut down the associated WebGL application. Some precision of this detection was recently lost and will need to be fixed in following CLs. Also updated and ran GPU unit tests. BUG=88106 TEST=none (tested manually; try servers) R=gman,apatrick,piman Review URL: http://codereview.chromium.org/7362005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92453 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 92429 - Detect and expose loss of OpenGL context using ↵kbr@chromium.org2011-07-131-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GL_ARB_robustness. (Regressed static initalizer size on Linux -- will need to reexamine code to understand why.) This initial patch changes the Linux port to use GLX_ARB_create_context_robustness when available, and tests periodically whether the context has been lost after each draw call and when making the context current. The detection of context loss also works with EGL and ANGLE, although it always reports an unknown reset status. WebKit changes will follow which test the reset status and determine what to do in response; for example, the policy might be to never restore a WebGL context which was lost (due to a GPU reset) and which was determined to be the guilty context. Tested manually with WebGL stress tests and verified on Linux and Windows that in at least some situations it is possible to detect guilty contexts and shut down the associated WebGL application. Some precision of this detection was recently lost and will need to be fixed in following CLs. Also updated and ran GPU unit tests. BUG=88106 TEST=none (tested manually; try servers) Review URL: http://codereview.chromium.org/7331020 TBR=kbr@chromium.org Review URL: http://codereview.chromium.org/7346032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92434 0039d316-1c4b-4281-b951-d872f2087c98
* Detect and expose loss of OpenGL context using GL_ARB_robustness.kbr@chromium.org2011-07-131-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | This initial patch changes the Linux port to use GLX_ARB_create_context_robustness when available, and tests periodically whether the context has been lost after each draw call and when making the context current. The detection of context loss also works with EGL and ANGLE, although it always reports an unknown reset status. WebKit changes will follow which test the reset status and determine what to do in response; for example, the policy might be to never restore a WebGL context which was lost (due to a GPU reset) and which was determined to be the guilty context. Tested manually with WebGL stress tests and verified on Linux and Windows that in at least some situations it is possible to detect guilty contexts and shut down the associated WebGL application. Some precision of this detection was recently lost and will need to be fixed in following CLs. Also updated and ran GPU unit tests. BUG=88106 TEST=none (tested manually; try servers) Review URL: http://codereview.chromium.org/7331020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92429 0039d316-1c4b-4281-b951-d872f2087c98
* GPU compositing surface handle is no longer sent to renderer process.apatrick@chromium.org2011-06-271-2/+0
| | | | | | | | | | | | | Instead it is stored in a map in RenderWidgetHelper indexed by RenderWidgetHost route ID. This allows the UI thread to maintain the mapping as windows are created and destroyed and the IO thread to lookup the mapping in order to create GL contexts that render to the windows. This avoids a race where JavaScript would open a popup window and immediately try to use an accelerated canvas to render to it (2D canvas or WebGL canvas). <-- This is no longer true of this patch. There was a potential deadlock. WebGL canvas used to work in this case only because it would fall back to using ReadPixels. This goes some way to fixing the bug referenced below but does not fix it completely.BUG=80703 Review URL: http://codereview.chromium.org/7136001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90617 0039d316-1c4b-4281-b951-d872f2087c98
* RendererGLContext supports reparenting a GL context.apatrick@chromium.org2011-06-201-3/+5
| | | | | | | | | | | | This will allow the parenting of offscreen canvas contexts to be deferred until the compositor's view context exists, which in some cases needs to be deferred until the window is asynchronously created by the browser's UI thread. An example is JavaScript opening a popup window and then immediately using canvas to attempt to render to it. This patch alone does not fix the bug. BUG=80703 Review URL: http://codereview.chromium.org/7205012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89715 0039d316-1c4b-4281-b951-d872f2087c98
* Removing defunct GpuVideoDecoder and IpcVideoDecoder.scherkus@chromium.org2011-06-031-19/+0
| | | | | | | | | | | | These haven't been used in quite some time and have been replaced by the newer VideoDecoderAccelerator set of classes. BUG=none TEST=the world still compiles Review URL: http://codereview.chromium.org/6993016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87841 0039d316-1c4b-4281-b951-d872f2087c98
* Moved GPU related files in content/renderer into gpu subdirectory.apatrick@chromium.org2011-05-251-0/+239
Also added an OWNERS file to that subdirectory. Review URL: http://codereview.chromium.org/7066035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86707 0039d316-1c4b-4281-b951-d872f2087c98