Closed
Bug 950903
Opened 11 years ago
Closed 10 years ago
Expose backend-specific GLContext subclasses, rather than exposing backend-specific notions in GLContext
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: jgilbert, Assigned: bjacob)
References
Details
(Whiteboard: [qa-])
Attachments
(9 files, 1 obsolete file)
27.98 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
16.79 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
10.13 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
12.46 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
5.05 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
18.25 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
1.90 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
1.52 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
81.02 KB,
patch
|
Details | Diff | Splinter Review |
We want a good way for external code presented with a GLContext to retrieve the GLContext{EGL,GLX,CGL,WGL}. From talking with :bjacob we seemed to agree on: (or similar) ('proposal 1') GLContext has no backend-specific functions GLContext::GetNativeGLContext() returns a GLContext{EGL,GLX,CGL,WGL} Backend-specific calls live on backend-specific GLContext implementations: GLContextCGL::GetCGLContext() returns CGLContext GLContextCGL::GetNSOpenGLContext() returns NSOpenGLContext I would actually like to use something similar to SharedSurfaceFoo::Cast(), with the assert that gives us, which would shape the API as: ('proposal 2') GLContext::GetBackendType returns {EGL, WGL, CGL, GLX} static GLContextFoo* GLContextFoo::Cast(GLContext* gl) { MOZ_ASSERT(gl->GetBackendType() == Foo) return (GLContextFoo*)gl; }
Assignee | ||
Comment 1•10 years ago
|
||
Taking. The part that I'm interested in, is exposing GLContextCGL and friends directly to remove the need to expose backend-specific things in GLContext itself. I'll adopt the Cast() API that you propose for that. The part that I'm less interested in, is changing the API inside of GLContextCGL and friends. I'll leave that unchanged.
Assignee: nobody → bjacob
Assignee | ||
Updated•10 years ago
|
Summary: Improve the API for retrieving the backend-specific implementation of GLContext → Expose backed-specific GLContext subclasses, rather than exposing backend-specific notions in GLContext
Assignee | ||
Comment 2•10 years ago
|
||
Oh, I see: there simply was no other API than GetNativeData to get the stuff in a GLContextCGL. OK, adding the API that you suggested. Patches coming.
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8355322 -
Flags: review?(jgilbert)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8355324 -
Flags: review?(jgilbert)
Assignee | ||
Comment 5•10 years ago
|
||
Attachment #8355327 -
Flags: review?(jgilbert)
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8355328 -
Flags: review?(jgilbert)
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8355329 -
Flags: review?(jgilbert)
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8355331 -
Flags: review?(jgilbert)
Assignee | ||
Comment 9•10 years ago
|
||
Some build fixes.
Attachment #8355331 -
Attachment is obsolete: true
Attachment #8355331 -
Flags: review?(jgilbert)
Attachment #8355613 -
Flags: review?(jgilbert)
Assignee | ||
Comment 10•10 years ago
|
||
Attachment #8355615 -
Flags: review?(jgilbert)
Assignee | ||
Comment 11•10 years ago
|
||
I have no idea how this worked before. Looks like the old code was reinterpreting a WGLContext handle as a EGLContext handle. I had to fix that as the new Cast() methods assert that the context type is the right one. Was hitting this assertion failure on native-gl WebGL reftests on windows.
Attachment #8355905 -
Flags: review?(jgilbert)
Assignee | ||
Updated•10 years ago
|
Attachment #8355322 -
Attachment description: 1/6 - Expose GLContextEGL publicly → 1/8 - Expose GLContextEGL publicly
Assignee | ||
Updated•10 years ago
|
Attachment #8355324 -
Attachment description: 2/6 - Expose GLContextGLX publicly → 2/8 - Expose GLContextGLX publicly
Assignee | ||
Updated•10 years ago
|
Attachment #8355327 -
Attachment description: 3/6 - Expose GLContextCGL publicly → 3/8 - Expose GLContextCGL publicly
Assignee | ||
Updated•10 years ago
|
Attachment #8355328 -
Attachment description: 4/6 - Expose GLContextWGL publicly → 4/8 - Expose GLContextWGL publicly
Assignee | ||
Updated•10 years ago
|
Attachment #8355329 -
Attachment description: 5/6 - Add static Cast methods to allow getting the backend-specific object from a GLContext → 5/8 - Add static Cast methods to allow getting the backend-specific object from a GLContext
Assignee | ||
Updated•10 years ago
|
Summary: Expose backed-specific GLContext subclasses, rather than exposing backend-specific notions in GLContext → Expose backend-specific GLContext subclasses, rather than exposing backend-specific notions in GLContext
Assignee | ||
Updated•10 years ago
|
Attachment #8355615 -
Attachment description: 7/7 - Simplifications around EGLSurface override → 7/8 - Simplifications around EGLSurface override
Assignee | ||
Updated•10 years ago
|
Attachment #8355613 -
Attachment description: 6/6 - Remove GLContext::GetNativeData → 6/8 - Remove GLContext::GetNativeData
Assignee | ||
Comment 12•10 years ago
|
||
As a reviewing helper. Also, here's the diff --stat: $ hg diff --stat -r qparent:no-surfacefactoryangle-on-wgl dom/plugins/base/android/ANPOpenGL.cpp | 4 +- gfx/gl/GLContext.h | 9 - gfx/gl/GLContextCGL.h | 69 ++ gfx/gl/GLContextEGL.h | 133 ++++ gfx/gl/GLContextGLX.h | 83 ++ gfx/gl/GLContextProviderCGL.mm | 174 ++-- gfx/gl/GLContextProviderEGL.cpp | 665 +++++++++----------- gfx/gl/GLContextProviderGLX.cpp | 371 +++++------ gfx/gl/GLContextProviderWGL.cpp | 270 +++---- gfx/gl/GLContextWGL.h | 84 ++ gfx/gl/GLSharedHandleHelpers.cpp | 5 +- gfx/gl/SharedSurfaceANGLE.cpp | 10 +- gfx/gl/SharedSurfaceEGL.cpp | 6 +- gfx/gl/SharedSurfaceIO.cpp | 4 +- gfx/gl/WGLLibrary.h | 2 + gfx/gl/moz.build | 8 +- gfx/layers/d3d10/CanvasLayerD3D10.cpp | 12 +- gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp | 4 +- widget/cocoa/nsChildView.mm | 9 +- 19 files changed, 1074 insertions(+), 848 deletions(-)
Assignee | ||
Comment 13•10 years ago
|
||
Green on try: https://tbpl.mozilla.org/?tree=Try&rev=3c9c4a27c843
Reporter | ||
Updated•10 years ago
|
Attachment #8355322 -
Flags: review?(jgilbert) → review+
Reporter | ||
Updated•10 years ago
|
Attachment #8355324 -
Flags: review?(jgilbert) → review+
Reporter | ||
Updated•10 years ago
|
Attachment #8355327 -
Flags: review?(jgilbert) → review+
Reporter | ||
Updated•10 years ago
|
Attachment #8355328 -
Flags: review?(jgilbert) → review+
Reporter | ||
Comment 14•10 years ago
|
||
Comment on attachment 8355329 [details] [diff] [review] 5/8 - Add static Cast methods to allow getting the backend-specific object from a GLContext Review of attachment 8355329 [details] [diff] [review]: ----------------------------------------------------------------- No implied virtual overrides, please! ::: gfx/gl/GLContextCGL.h @@ +28,5 @@ > bool isOffscreen = false); > > ~GLContextCGL(); > > + GLContextType GetContextType() { return ContextTypeCGL; } Add `virtual` and `MOZ_OVERRIDE`. ([1]) ::: gfx/gl/GLContextEGL.h @@ +37,5 @@ > EGLContext context); > > ~GLContextEGL(); > > + GLContextType GetContextType() { return ContextTypeEGL; } [1] ::: gfx/gl/GLContextGLX.h @@ +30,5 @@ > gfxXlibSurface* pixmap = nullptr); > > ~GLContextGLX(); > > + GLContextType GetContextType() { return ContextTypeGLX; } [1] ::: gfx/gl/GLContextWGL.h @@ +38,5 @@ > LibType aLibUsed); > > ~GLContextWGL(); > > + GLContextType GetContextType() { return ContextTypeWGL; } [1]
Attachment #8355329 -
Flags: review?(jgilbert) → review+
Reporter | ||
Comment 15•10 years ago
|
||
Comment on attachment 8355613 [details] [diff] [review] 6/8 - Remove GLContext::GetNativeData Review of attachment 8355613 [details] [diff] [review]: ----------------------------------------------------------------- Woo!
Attachment #8355613 -
Flags: review?(jgilbert) → review+
Reporter | ||
Updated•10 years ago
|
Attachment #8355615 -
Flags: review?(jgilbert) → review+
Reporter | ||
Updated•10 years ago
|
Attachment #8355905 -
Flags: review?(jgilbert) → review+
Assignee | ||
Comment 16•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e51b55aa36de https://hg.mozilla.org/integration/mozilla-inbound/rev/03baae33872f https://hg.mozilla.org/integration/mozilla-inbound/rev/4e157aa1a51e https://hg.mozilla.org/integration/mozilla-inbound/rev/475af8f302c5 https://hg.mozilla.org/integration/mozilla-inbound/rev/b78144fcc95b https://hg.mozilla.org/integration/mozilla-inbound/rev/3265325c3ad5 https://hg.mozilla.org/integration/mozilla-inbound/rev/3894fdb72320 https://hg.mozilla.org/integration/mozilla-inbound/rev/73a83e2f8751
Target Milestone: --- → mozilla29
Comment 17•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e51b55aa36de https://hg.mozilla.org/mozilla-central/rev/03baae33872f https://hg.mozilla.org/mozilla-central/rev/4e157aa1a51e https://hg.mozilla.org/mozilla-central/rev/475af8f302c5 https://hg.mozilla.org/mozilla-central/rev/b78144fcc95b https://hg.mozilla.org/mozilla-central/rev/3265325c3ad5 https://hg.mozilla.org/mozilla-central/rev/3894fdb72320 https://hg.mozilla.org/mozilla-central/rev/73a83e2f8751
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•