summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/gl_context_virtual.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove the problematic call to GLSurface::GetBackingFrameBufferObject.msimonides@opera.com2013-09-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | GLContextVirtual::IsCurrent doesn't need to call GetBackingFrameBufferObject on a surface, the IsOffScreen check should be enough. The direct reason for this change is that GLContextVirtual::IsCurrent's use of GetBackingFrameBufferObject interferes with the implementation of that function in TextureImageTransportSurface. TextureImageTransportSurface::GetBackingFrameBufferObject creates an FBO if needed. Unfortunately GLContextVirtual::IsCurrent is called early in GLContextVirtual's initialization, too early for TextureImageTransportSurface::GetBackingFrameBufferObject to create the frame buffer object because it needs a fully initialized context to succeed. BUG= Review URL: https://chromiumcodereview.appspot.com/23480048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222505 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 205970 "Revert 205481 "Virtual context MakeCurrent tweaks.""sievers@chromium.org2013-06-131-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | > Revert 205481 "Virtual context MakeCurrent tweaks." > > > Virtual context MakeCurrent tweaks. > > > > Do not allow GLContextVirtual::MakeCurrent() without a decoder (state > > restorer), since this only leads to state bugs. > > > > For this reason remove the necessity of having a current context during surface destruction (it's ugly anyway, since GLSurface is RefCounted). > > > > BUG=248395 > > > > Review URL: https://chromiumcodereview.appspot.com/15925007 > > TBR=sievers@chromium.org > > Review URL: https://codereview.chromium.org/16841006 TBR=sievers@chromium.org BUG=248957 Review URL: https://codereview.chromium.org/16988002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206119 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 205481 "Virtual context MakeCurrent tweaks."sievers@chromium.org2013-06-121-4/+7
| | | | | | | | | | | | | | | | | | | > Virtual context MakeCurrent tweaks. > > Do not allow GLContextVirtual::MakeCurrent() without a decoder (state > restorer), since this only leads to state bugs. > > For this reason remove the necessity of having a current context during surface destruction (it's ugly anyway, since GLSurface is RefCounted). > > BUG=248395 > > Review URL: https://chromiumcodereview.appspot.com/15925007 TBR=sievers@chromium.org Review URL: https://codereview.chromium.org/16841006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205970 0039d316-1c4b-4281-b951-d872f2087c98
* Virtual context MakeCurrent tweaks.sievers@chromium.org2013-06-111-7/+4
| | | | | | | | | | | | | Do not allow GLContextVirtual::MakeCurrent() without a decoder (state restorer), since this only leads to state bugs. For this reason remove the necessity of having a current context during surface destruction (it's ugly anyway, since GLSurface is RefCounted). BUG=248395 Review URL: https://chromiumcodereview.appspot.com/15925007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205481 0039d316-1c4b-4281-b951-d872f2087c98
* GLContextVirtual::ReleaseCurrent sets current virtual to NULLboliu@chromium.org2013-05-311-2/+4
| | | | | | | | | | | Rename OnDestroyVirtualContext to OnReleaseVirtuallyCurrent and call it in GLContextVirtual::ReleaseCurrent. BUG=230195 Review URL: https://chromiumcodereview.appspot.com/16065003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203329 0039d316-1c4b-4281-b951-d872f2087c98
* gpu: Change Produce/ConsumeTexture to allow texture sharingpiman@chromium.org2013-05-291-2/+2
| | | | | | | | | | This changes the semantics of ProduceTexture to not replacing the current texture by a dud, but instead keeping the existing one, that it also puts into the mailbox. It changes the semantics of ConsumeTexture to deleting the current texture, and replacing it by the mailbox contents (without taking it out of the mailbox). The texture becomes shared. The mailbox is now effectively a weak pointer onto the texture. BUG=230137 Review URL: https://chromiumcodereview.appspot.com/14188053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202992 0039d316-1c4b-4281-b951-d872f2087c98
* Reland "GPU: Reduce MakeCurrent calls to fix Orange San Diego""epenner@chromium.org2013-05-281-18/+25
| | | | | | | | | | | | | This patch now also always calls MakeVirtuallyCurrent during initialize and MakeCurrent, such that the next context will always restore. The context state is restored only if the API has changed or the virtually current context has changed, so we should never skip calling MakeVirtuallyCurrent. BUG=241188 Review URL: https://chromiumcodereview.appspot.com/15841002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202561 0039d316-1c4b-4281-b951-d872f2087c98
* Partial revert of "GPU: Reduce MakeCurrent calls to fix Orange San Diego"yfriedman@chromium.org2013-05-231-19/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | GPU: Reduce MakeCurrent calls to fix Orange San Diego We have hit several separate issues resulting from calling MakeCurrent to change surfaces (when using virtual contexts). This removes most cases of MakeCurrent that aren't needed, and enables virtual contexts for Orange San Diego. Original code review: https://codereview.chromium.org/14069008/ The last remaining case is ReleaseCurrent which isn't needed for the Orange San Diego fix, and will be done in a follow up CL. BUG=179250, 229643, 230896 NOTRY=true Reason for revert: Flakiness on content_shell tests. Appears to be caused by this change. Example breakage:http://build.chromium.org/p/chromium.linux/buildstatus?builder=Android%20Tests%20%28dbg%29&number=10928 Original cl: https://chromiumcodereview.appspot.com/14069008 TBR=sievers@chromium.org Review URL: https://codereview.chromium.org/15796002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201665 0039d316-1c4b-4281-b951-d872f2087c98
* GPU: Prefer to restore from decoder state rather than GL state when possible.backer@chromium.org2013-05-101-5/+2
| | | | | | | | | | | Some drivers are buggy. Wherever possible, use the decoder state restoration for the Scoped{Texture,Framebuffer}Binders. BUG=239509 Review URL: https://chromiumcodereview.appspot.com/15021011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199542 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r198983, "gpu: Remove redundant MakeCurrent in ↵bulach@chromium.org2013-05-091-4/+1
| | | | | | | | | | | | | | | | | | GLContextVirtual::MakeCurrent" Original: https://chromiumcodereview.appspot.com/14611013 Previously I misunderstood why we check if the decoder_ exists. Only if it exists can we restore the state. If the decoder doesn't exist and the context is already current, we can just do nothing. BUG=179250, 229643, 230896, 239403 TBR=epenner@chromium.org, sievers@chromium.org, gman@chromium.org NOTRY=True Review URL: https://chromiumcodereview.appspot.com/14752011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199188 0039d316-1c4b-4281-b951-d872f2087c98
* gpu: Remove redundant MakeCurrent in GLContextVirtual::MakeCurrentepenner@chromium.org2013-05-081-1/+4
| | | | | | | | | | | | | Previously I misunderstood why we check if the decoder_ exists. Only if it exists can we restore the state. If the decoder doesn't exist and the context is already current, we can just do nothing. BUG=179250, 229643, 230896 Review URL: https://chromiumcodereview.appspot.com/14611013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198983 0039d316-1c4b-4281-b951-d872f2087c98
* GPU: Reduce MakeCurrent calls to fix Orange San Diegoepenner@chromium.org2013-05-031-16/+19
| | | | | | | | | | | | | | | | | | | | We have hit several separate issues resulting from calling MakeCurrent to change surfaces (when using virtual contexts). This removes most cases of MakeCurrent that aren't needed, and enables virtual contexts for Orange San Diego. The last remaining case is ReleaseCurrent which isn't needed for the Orange San Diego fix, and will be done in a follow up CL. BUG=179250,229643,230896 NOTRY=true No try since the trybots all passed and the last change is a one-liner. Review URL: https://chromiumcodereview.appspot.com/14069008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198182 0039d316-1c4b-4281-b951-d872f2087c98
* gpu: Cleanup 'black-screen on Huawei' work-around.epenner@chromium.org2013-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | We got a response from their driver team. The surface is only corrupted if an FBO is bound when it is first made-current. So we can avoid re-creating the surface and just unbind the Fbo instead. The work-around is still needed in the context itself for two reasons: - Virtual context indirections - The first make-current for new surfaces is not in the decoder. BUG=235935 NOTRY=true No try, since this doesn't run on mac, so mac_asan bot isn't relevant. Review URL: https://chromiumcodereview.appspot.com/14021014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196915 0039d316-1c4b-4281-b951-d872f2087c98
* Return the shared context's handle when a virtualized context'sccameron@chromium.org2013-04-201-1/+1
| | | | | | | | | | | | | | | handle is requested. GLES2DecoderImpl::DoTexImageIOSurface2DCHROMIUM uses GLContext::GetHandle's result as an argument to CGLTexImageIOSurface2D, which expects a valid CGLContextObj as the handle (not NULL). BUG=230300 Review URL: https://chromiumcodereview.appspot.com/14241007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195390 0039d316-1c4b-4281-b951-d872f2087c98
* Reland "gpu: Fix Vivante's "hisilicon" GPUs"epenner@chromium.org2013-04-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes "Hisilicon" GPUs, which is an instance of a Vivante's GPU design. This involves enabling virtual contexts, since they don't support share-groups, and further adds a work-around for switching surfaces. Without the work- around the view surface "inherits" the size of the last bound surface (which for Chrome tends to be a 1x1 pbuffer) resulting in a black screen. The following steps "repair" the view surface every time it is made current: - Make it current. - Bind the default frame-buffer. - Make it not current. - Destroy/recreate it from the native handle. - Make it current again. NOTE: The "Recreate" function is added to surface because the Destroy/Initialize may be intercepted or modified by wrapper surface classes. Recreate is similar to resize, which after being forwarded by a wrapper can call Destroy/Initialize on the 'real' surface. BUG=179250 NOTRY=true No-try, as all the relevant bots are already green. Review URL: https://chromiumcodereview.appspot.com/13852023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195349 0039d316-1c4b-4281-b951-d872f2087c98
* Force GPU switch with CGLSetVirtualScreen only for compositorccameron@chromium.org2013-04-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Only compositor contexts are known to use only the subset of GL that can be safely migrated between the iGPU and the dGPU. Mark those contexts as safe to forcibly transition between the GPUs. In particular, Intel GPUs support using a GL_STENCIL_INDEX8 attachment with no depth buffer, but NV GPUs don't. Skia will use this FBO combo if it is listed as available. If we use this combo on the iGPU and then forcibly transition the GL context using this combo from the iGPU to the dGPU, corruption occurs on NV, and a hang happens on AMD. Further, if we cache complete FBO combos, then we will cache this combo as valid when using the iGPU, and claim that it's valid when using the dGPU, resulting in GL errors. BUG=180876 Review URL: https://chromiumcodereview.appspot.com/13746002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193302 0039d316-1c4b-4281-b951-d872f2087c98
* Fix GL virtualization warnings on OS Xccameron@chromium.org2013-04-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | Stub out GetDisplay for GLSurfaceCGL so that the NOTIMPLEMENTED in GLSurface is not hit. Fix a bug where, when using context virtualization, a GL_INVALD_FRAMEBUFFER_OPERATION is generated by GLES2DecoderImpl::Initialize. This is a use-before-initialization bug wherein GpuCommandBufferStub::Initialize calls MakeCurrent on the virtual context, and because decoder_ is non-NULL in GLContextVirtual::MakeCurrent, we try to restore the state from the decoder (but decoder_ has not yet been initialized). Remove extra logic to prevent calling Destroy on un-initialized decoders, and add a check inside Destroy. BUG=180463 Review URL: https://chromiumcodereview.appspot.com/13430019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192109 0039d316-1c4b-4281-b951-d872f2087c98
* Extend virtual context MakeCurrent fastpath to offscreen surfaces.sievers@chromium.org2012-12-111-0/+1
| | | | | | | | | | | | | | | | | Similar to transport surfaces with an explicit fbo backing, we can avoid the call into the driver to make the surface current since the command decoder guarantess an fbo backing for offscreen surfaces. On Android, this specifically affects canvas contexts and the helper context used on the UI thread for mailbox texture exchange. BUG=160710 Review URL: https://chromiumcodereview.appspot.com/11537014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172410 0039d316-1c4b-4281-b951-d872f2087c98
* Advertise extensions for virtual GL api.sievers@chromium.org2012-12-051-1/+3
| | | | | | | | | | | | Also restore GL_TEXTURE_EXTERNAL_OES binding. BUG=160710 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11418300 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171286 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid actual MakeCurrent() calls with virtual contexts.sievers@chromium.org2012-11-301-1/+13
| | | | | | | | | | | | | | When switching to a context that only renders to an FBO, and when the underlying GL surface handle does not change, avoid calling GLContext::MakeCurrent(). BUG=160710 Review URL: https://chromiumcodereview.appspot.com/11308252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170323 0039d316-1c4b-4281-b951-d872f2087c98
* Support creating virtual contexts.sievers@chromium.org2012-11-291-5/+13
| | | | | | | | | | | | | | | This creates virtual contexts within a GLShareGroup, when '--enable-virtual-gl-contexts' is given on the command line. It requires the shared real GL context, which is created from the default offscreen surface configuration, to be compatible with any surface that is made current with a virtual context. BUG=160710 Review URL: https://chromiumcodereview.appspot.com/11308151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170148 0039d316-1c4b-4281-b951-d872f2087c98
* Virtual GLgman@chromium.org2012-11-071-0/+79
BUG=155557 Review URL: https://chromiumcodereview.appspot.com/11275120 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166442 0039d316-1c4b-4281-b951-d872f2087c98