Closed
Bug 756601
Opened 13 years ago
Closed 11 years ago
Finish the OMTC implementation on OS X
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla27
Tracking | Status | |
---|---|---|
relnote-firefox | --- | 24+ |
People
(Reporter: joe, Assigned: mattwoodrow)
References
Details
Attachments
(12 files, 2 obsolete files)
(deleted),
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
BenWa
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
Benoit Girard and Ali Juma did a lot of the initial work in implementing OMTC on OS X, but it's not done yet. This bug will track the work required to finish it.
Comment 1•13 years ago
|
||
Just a quick overview of what I think is needed before we can ship it without regressing:
1) Draw with cairo+quartz instead of cairo+pixman.
2) Texture sharing (bug 728524)
3) Either direct plugin (best), or add proper paths to shadow iosurfaces (easy).
Depends on: 728524
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #745793 -
Flags: review?
Assignee | ||
Updated•12 years ago
|
Attachment #745793 -
Flags: review? → review?(bas)
Assignee | ||
Comment 3•12 years ago
|
||
Looks like the refactoring actually broke our usage of TextureImageCGL, and we've been using BasicTextureImage instead. Bit sad that talos didn't pick this up.
Attachment #745794 -
Flags: review?(bgirard)
Assignee | ||
Comment 5•12 years ago
|
||
This fixes a bunch of errors we were getting with MOZ_GL_DEBUG
Attachment #745797 -
Flags: review?(bgirard)
Assignee | ||
Comment 6•12 years ago
|
||
I forget exactly why I needed to add these, but it fixed a warning of some sort.
Attachment #745798 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 8•12 years ago
|
||
This just matches what we have to do in the other impl's.
Attachment #745800 -
Flags: review?(roc)
Assignee | ||
Comment 9•12 years ago
|
||
Nothing was actually calling this function. This should match what the client side set.
Attachment #745801 -
Flags: review?(roc)
Assignee | ||
Comment 10•12 years ago
|
||
Adds this call back so that we get a DidPaintWindow call. The actual paint attempt will be a no-op.
It might be nice to stop using the widget events entirely and instead fire WillPaint/DidPaint around the refresh driver painting, and fire MozAfterPaint when the compositor has completed. Might leave that for now though.
Attachment #745802 -
Flags: review?(roc)
Assignee | ||
Comment 11•12 years ago
|
||
Attachment #745803 -
Flags: review?(roc)
Assignee | ||
Comment 12•12 years ago
|
||
Attachment #745804 -
Flags: review?(bas)
Assignee | ||
Comment 13•12 years ago
|
||
With these patches the only failures left are a 10.6-only crash inside the OpenGL driver, and bug 868919.
With the former, we might need to delay enabling OMTC on that platform until we figure out.
Updated•12 years ago
|
Summary: [Meta] Finish the OMTC implementation on OS X → Finish the OMTC implementation on OS X
Comment 14•12 years ago
|
||
Comment on attachment 745793 [details] [diff] [review]
Use the right texture target when allocating textures
Review of attachment 745793 [details] [diff] [review]:
-----------------------------------------------------------------
I seem to distinctly recall this wasn't what we wanted for one of the Gralloc things.. But hopefully I'm mistaking, testing should prove.
Attachment #745793 -
Flags: review?(bas) → review+
Updated•12 years ago
|
Attachment #745799 -
Flags: review?(bas) → review+
Updated•12 years ago
|
Attachment #745804 -
Flags: review?(bas) → review+
Updated•12 years ago
|
Attachment #745798 -
Flags: review?(jmuizelaar) → review+
Attachment #745800 -
Flags: review?(roc) → review+
Comment on attachment 745801 [details] [diff] [review]
Setup PaintWillResample correctly
Review of attachment 745801 [details] [diff] [review]:
-----------------------------------------------------------------
I'm confused. Where's the implementation of SetPaintWillResample that actually does something?
Comment on attachment 745802 [details] [diff] [review]
Call PaintWindow so we get a DidPaint
Review of attachment 745802 [details] [diff] [review]:
-----------------------------------------------------------------
What ensures that PaintWindow doesn't actually paint anything?
Comment on attachment 745803 [details] [diff] [review]
Send the values of mScaleToSize/mScaleMode across IPC
Review of attachment 745803 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/layers/ImageLayers.h
@@ +56,5 @@
> void SetScaleToSize(const gfxIntSize &aSize, ScaleMode aMode)
> {
> mScaleToSize = aSize;
> mScaleMode = aMode;
> + Mutated();
Please make this "Mutated()" conditional on size/mode changing.
Attachment #745803 -
Flags: review?(roc) → review+
Assignee | ||
Comment 18•12 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #15)
> Comment on attachment 745801 [details] [diff] [review]
> Setup PaintWillResample correctly
>
> Review of attachment 745801 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I'm confused. Where's the implementation of SetPaintWillResample that
> actually does something?
http://mxr.mozilla.org/mozilla-central/source/gfx/layers/composite/ContentHost.h#102
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #16)
> Comment on attachment 745802 [details] [diff] [review]
> Call PaintWindow so we get a DidPaint
>
> Review of attachment 745802 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> What ensures that PaintWindow doesn't actually paint anything?
http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#5504
Assignee | ||
Comment 19•12 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #14)
> Comment on attachment 745793 [details] [diff] [review]
> Use the right texture target when allocating textures
>
> Review of attachment 745793 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I seem to distinctly recall this wasn't what we wanted for one of the
> Gralloc things.. But hopefully I'm mistaking, testing should prove.
Indeed, you wrote the patch that fixed b2g, which is why I asked you to review :)
The GL_TEXTURE_EXTERNAL branch inside MakeTextureIfNeeded should preserve the existing behaviour for b2g, while fixing it for mac.
Comment on attachment 745801 [details] [diff] [review]
Setup PaintWillResample correctly
Review of attachment 745801 [details] [diff] [review]:
-----------------------------------------------------------------
Mark ContentHostBase::SetPaintWillResample explicitly virtual.
Attachment #745801 -
Flags: review?(roc) → review+
Attachment #745802 -
Flags: review?(roc) → review+
Assignee | ||
Updated•12 years ago
|
Attachment #745797 -
Flags: review?(bgirard) → review?(mstange)
Comment 21•12 years ago
|
||
Comment on attachment 745797 [details] [diff] [review]
Setup our OpenGL surface before compositing.
Review of attachment 745797 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/layers/composite/LayerManagerComposite.cpp
@@ +295,5 @@
> // Allow widget to render a custom background.
> + mCompositor->GetWidget()->DrawWindowUnderlay(this, nsIntRect(bounds.x,
> + bounds.y,
> + bounds.width,
> + bounds.height));
Why?
::: widget/cocoa/nsChildView.mm
@@ +1873,5 @@
> +nsChildView::PreRender(LayerManager* aManager)
> +{
> + nsAutoPtr<GLManager> manager(GLManager::CreateGLManager(aManager));
> + NSOpenGLContext *glContext = (NSOpenGLContext *)manager->gl()->GetNativeData(GLContext::NativeGLContext);
> + [(ChildView*)mView preRender: glContext];
Local style is no space after colon.
::: widget/nsIWidget.h
@@ +1169,5 @@
> */
> virtual void CleanupWindowEffects() = 0;
>
> + virtual void PreRender(LayerManager* aManager) = 0;
> +
needs IID change
Comment 22•12 years ago
|
||
(In reply to Markus Stange from comment #21)
> Comment on attachment 745797 [details] [diff] [review]
> Setup our OpenGL surface before compositing.
>
> Review of attachment 745797 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: gfx/layers/composite/LayerManagerComposite.cpp
> @@ +295,5 @@
> > // Allow widget to render a custom background.
> > + mCompositor->GetWidget()->DrawWindowUnderlay(this, nsIntRect(bounds.x,
> > + bounds.y,
> > + bounds.width,
> > + bounds.height));
>
> Why?
If the reason for the actualBounds -> bounds change is the fact that actualBounds is currently in screen coordinates (i.e. has a non-zero origin), then I think bug 861332 has a better fix.
Actually, in what cases can actualBounds differ from bounds/mRenderBounds?
Assignee | ||
Comment 23•12 years ago
|
||
(In reply to Markus Stange from comment #22)
> (In reply to Markus Stange from comment #21)
> > Comment on attachment 745797 [details] [diff] [review]
> > Setup our OpenGL surface before compositing.
> >
> > Review of attachment 745797 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > ::: gfx/layers/composite/LayerManagerComposite.cpp
> > @@ +295,5 @@
> > > // Allow widget to render a custom background.
> > > + mCompositor->GetWidget()->DrawWindowUnderlay(this, nsIntRect(bounds.x,
> > > + bounds.y,
> > > + bounds.width,
> > > + bounds.height));
> >
> > Why?
>
> If the reason for the actualBounds -> bounds change is the fact that
> actualBounds is currently in screen coordinates (i.e. has a non-zero
> origin), then I think bug 861332 has a better fix.
> Actually, in what cases can actualBounds differ from bounds/mRenderBounds?
No, it's just a change I made earlier when tinkering with things and forgot to revert :)
Will fix it before landing.
Assignee | ||
Comment 24•12 years ago
|
||
Attachment #745797 -
Attachment is obsolete: true
Attachment #745797 -
Flags: review?(mstange)
Attachment #747207 -
Flags: review?(mstange)
Assignee | ||
Comment 25•12 years ago
|
||
Attachment #747210 -
Flags: review?(roc)
Updated•12 years ago
|
Attachment #747207 -
Flags: review?(mstange) → review+
Attachment #747210 -
Flags: review?(roc) → review+
Comment 26•12 years ago
|
||
Comment on attachment 745794 [details] [diff] [review]
Use TextureImageCGL again, and used TiledTexturedImage for large textures
Review of attachment 745794 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/gl/GLContextProviderCGL.mm
@@ +374,5 @@
> + nsRefPtr<TextureImage> t = new gl::TiledTextureImage(this, aSize, aContentType, aFlags);
> + return t.forget();
> + }
> +
> + return CreateTextureImageInternal(aSize, aContentType,
2 extra spaces in this hunk
::: gfx/gl/GLContextProviderEGL.cpp
@@ +1537,5 @@
> already_AddRefed<TextureImage>
> GLContextEGL::TileGenFunc(const nsIntSize& aSize,
> + TextureImage::ContentType aContentType,
> + TextureImage::Flags aFlags)
> +
Missing '{'?
Attachment #745794 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 27•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/751fedabab31
https://hg.mozilla.org/integration/mozilla-inbound/rev/b58dac401ceb
https://hg.mozilla.org/integration/mozilla-inbound/rev/fed9c75cd9fd
https://hg.mozilla.org/integration/mozilla-inbound/rev/098ef52af05c
https://hg.mozilla.org/integration/mozilla-inbound/rev/0f3d7df79e32
https://hg.mozilla.org/integration/mozilla-inbound/rev/789f09e5ce7c
https://hg.mozilla.org/integration/mozilla-inbound/rev/1e746a304a6f
https://hg.mozilla.org/integration/mozilla-inbound/rev/74ff7b69c638
https://hg.mozilla.org/integration/mozilla-inbound/rev/b5a96574e077
https://hg.mozilla.org/integration/mozilla-inbound/rev/47a188160811
https://hg.mozilla.org/integration/mozilla-inbound/rev/3ea828782568
Whiteboard: [leave open]
Comment 28•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/751fedabab31
https://hg.mozilla.org/mozilla-central/rev/b58dac401ceb
https://hg.mozilla.org/mozilla-central/rev/fed9c75cd9fd
https://hg.mozilla.org/mozilla-central/rev/098ef52af05c
https://hg.mozilla.org/mozilla-central/rev/0f3d7df79e32
https://hg.mozilla.org/mozilla-central/rev/789f09e5ce7c
https://hg.mozilla.org/mozilla-central/rev/1e746a304a6f
https://hg.mozilla.org/mozilla-central/rev/74ff7b69c638
https://hg.mozilla.org/mozilla-central/rev/b5a96574e077
https://hg.mozilla.org/mozilla-central/rev/47a188160811
https://hg.mozilla.org/mozilla-central/rev/3ea828782568
https://hg.mozilla.org/mozilla-central/rev/ffd964f43194
Updated•12 years ago
|
Assignee: nobody → matt.woodrow
Assignee | ||
Comment 29•11 years ago
|
||
Attachment #764528 -
Flags: review?(jmuizelaar)
Comment on attachment 764528 [details] [diff] [review]
Enable OMTC on 10.7 and 10.8
Review of attachment 764528 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxPlatform.cpp
@@ +332,5 @@
> #endif
>
> + bool useOffMainThreadCompositing = false;
> + useOffMainThreadCompositing = GetPrefLayersOffMainThreadCompositionEnabled() ||
> + Preferences::GetBool("browser.tabs.remote", false);
Fuse declaration with assignment
::: gfx/thebes/gfxPlatformGtk.cpp
@@ +503,5 @@
> +gfxPlatformGtk::SupportsOffMainThreadCompositing()
> +{
> +#ifdef MOZ_X11
> + return (PR_GetEnv("MOZ_USE_OMTC") != nullptr) ||
> + (PR_GetEnv("MOZ_OMTC_ENABLED") != nullptr);
Why two different env vars here?
::: gfx/thebes/gfxPlatformMac.cpp
@@ +435,5 @@
> +gfxPlatformMac::SupportsOffMainThreadCompositing()
> +{
> + // 10.6.X has crashes on tinderbox with OMTC, so disable it
> + // for now.
> + return OSXVersion() >= 0x1070;
This gives us no way to test OMTC on 10.6. I think we need a separate "force" pref.
Assignee | ||
Comment 31•11 years ago
|
||
Attachment #764528 -
Attachment is obsolete: true
Attachment #764528 -
Flags: review?(jmuizelaar)
Attachment #764546 -
Flags: review?(roc)
Assignee | ||
Comment 32•11 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #30)
>
> ::: gfx/thebes/gfxPlatformGtk.cpp
> @@ +503,5 @@
> > +gfxPlatformGtk::SupportsOffMainThreadCompositing()
> > +{
> > +#ifdef MOZ_X11
> > + return (PR_GetEnv("MOZ_USE_OMTC") != nullptr) ||
> > + (PR_GetEnv("MOZ_OMTC_ENABLED") != nullptr);
>
> Why two different env vars here?
>
The scripts for running tests on tinderbox are global, not per-branch. With the refactoring, we wanted this pref enabled (for Ripc), but we didn't want it to be enabled on branches that didn't have the refactoring. So we needed separate env vars.
Once the refactoring reaches *all* branches, we can drop this again.
Assignee | ||
Comment 33•11 years ago
|
||
Note that this is just moving X11 specific code out of gfxPlatform, there's no changes to the env vars.
Comment on attachment 764546 [details] [diff] [review]
Enable OMTC on 10.7 and 10.8 v2
Review of attachment 764546 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxPlatformMac.cpp
@@ +438,5 @@
> + // for now.
> + if (OSXVersion() >= 0x1070) {
> + return true;
> + }
> + return GetPrefLayersOffMainThreadCompositionForceEnabled();
I think this call should move up so that if the force pref is set, we don't even call SupportsOffMainThreadCompositing on any platform.
Assignee | ||
Comment 35•11 years ago
|
||
The problem is that X11 *needs* at least one of those env vars set.
The env vars are also read at startup, and initialize threaded Xlib.
http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#3372
If we allow the force-enabled pref to override this, then it's just going to be a broken configuration that crashes.
Comment on attachment 764546 [details] [diff] [review]
Enable OMTC on 10.7 and 10.8 v2
Review of attachment 764546 [details] [diff] [review]:
-----------------------------------------------------------------
OK I guess.
Attachment #764546 -
Flags: review?(roc) → review+
Assignee | ||
Comment 37•11 years ago
|
||
Comment 38•11 years ago
|
||
Updated•11 years ago
|
relnote-firefox:
--- → ?
Updated•11 years ago
|
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #17)
> Comment on attachment 745803 [details] [diff] [review]
> Send the values of mScaleToSize/mScaleMode across IPC
>
> Review of attachment 745803 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: gfx/layers/ImageLayers.h
> @@ +56,5 @@
> > void SetScaleToSize(const gfxIntSize &aSize, ScaleMode aMode)
> > {
> > mScaleToSize = aSize;
> > mScaleMode = aMode;
> > + Mutated();
>
> Please make this "Mutated()" conditional on size/mode changing.
It would probably be a good idea to add an assertion that the layer properties have actually changed if we add an AttributeChange op for a layer.
Comment 40•11 years ago
|
||
The relnote has a typo (if I'm not mistaken), it should be:
> … for OSX renders smoother …
(and not "render's").
Comment 41•11 years ago
|
||
Comment on attachment 745793 [details] [diff] [review]
Use the right texture target when allocating textures
># HG changeset patch
># User Matt Woodrow <mwoodrow@mozilla.com>
># Date 1367384858 -43200
># Node ID 45493544fd0b4320573b6d00a53bb10e10b4e2d8
># Parent 8a2fb3738795e6209df068e57088574c7707145c
>imported patch fix-video
>
>diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp
>--- a/gfx/layers/opengl/TextureHostOGL.cpp
>+++ b/gfx/layers/opengl/TextureHostOGL.cpp
>@@ -46,29 +46,36 @@ CreateTextureHostOGL(SurfaceDescriptorTy
>
> NS_ASSERTION(result, "Result should have been created.");
>
> result->SetFlags(aTextureFlags);
> return result.forget();
> }
>
> static void
>-MakeTextureIfNeeded(gl::GLContext* gl, GLuint& aTexture)
>+MakeTextureIfNeeded(gl::GLContext* gl, GLenum aTarget, GLuint& aTexture)
> {
> if (aTexture != 0)
> return;
>
>+ GLenum target = aTarget;
>+ // GL_TEXTURE_EXTERNAL requires us to initialize the texture
>+ // using the GL_TEXTURE_2D attachment.
>+ if (target == LOCAL_GL_TEXTURE_EXTERNAL) {
>+ target = LOCAL_GL_TEXTURE_2D;
>+ }
>+
> gl->fGenTextures(1, &aTexture);
>
>- gl->fBindTexture(LOCAL_GL_TEXTURE_2D, aTexture);
>+ gl->fBindTexture(target, aTexture);
>
>- gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR);
>- gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR);
>- gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE);
>- gl->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE);
>+ gl->fTexParameteri(target, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR);
>+ gl->fTexParameteri(target, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR);
>+ gl->fTexParameteri(target, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE);
>+ gl->fTexParameteri(target, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE);
> }
>
> static gl::TextureImage::Flags
> FlagsToGLFlags(TextureFlags aFlags)
> {
> uint32_t result = TextureImage::NoFlags;
>
> if (aFlags & UseNearestFilter)
>@@ -265,17 +272,17 @@ SharedTextureHostOGL::SwapTexturesImpl(c
> mFormat = FormatFromShaderType(mShaderProgram);
> mTextureTransform = handleDetails.mTextureTransform;
> }
> }
>
> bool
> SharedTextureHostOGL::Lock()
> {
>- MakeTextureIfNeeded(mGL, mTextureHandle);
>+ MakeTextureIfNeeded(mGL, mTextureTarget, mTextureHandle);
>
> mGL->fActiveTexture(LOCAL_GL_TEXTURE0);
> mGL->fBindTexture(mTextureTarget, mTextureHandle);
> if (!mGL->AttachSharedHandle(mShareType, mSharedHandle)) {
> NS_ERROR("Failed to bind shared texture handle");
> return false;
> }
>
Comment 42•11 years ago
|
||
There are further enhancements that can and should be made (see meta bug 958195), but OMTC on the Mac is done and shipping, so we're closing this bug.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [leave open]
Updated•11 years ago
|
Target Milestone: --- → mozilla27
You need to log in
before you can comment on or make changes to this bug.
Description
•