Closed Bug 836130 Opened 13 years ago Closed 10 years ago

Enable accelerated quartz by default

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

Details

Attachments

(9 files)

No description provided.
Attachment #707905 - Flags: review? → review?(bas)
We can't really support this with accelerated quartz (without patching cairo significantly), so this makes us no longer require it.
Attachment #707906 - Flags: review?(bas)
This prevents us from making an invalid cast when we encounter a raw data surface.
Attachment #707908 - Flags: review?(jmuizelaar)
This really doesn't work at all, it just creates an entirely separate image surface that never gets any further updates. With the prior patches, we no longer require this to return a valid surface, so this removes it.
Attachment #707910 - Flags: review?(bgirard)
Attachment #707912 - Flags: review?(jmuizelaar)
This gets us fairly close on 10.7 at least: https://tbpl.mozilla.org/?tree=Try&rev=bf1498e215fc The biggest remaining issue is reftests on 10.8. We fail a large amount with what appears to be a blending bug. Any test that has a small invalidation update (and calls drawWindow with that small area) ends up with incorrect results. If I patch reftest.js to pad out the drawWindow sizes to at least 151x151, then the tests pass. The implementation of drawWindow allocates a gfxImageSurface and draws the required contents into that. I've verified that the pixel data is identical in both failing/passing cases. We then create a CGImage for this data, and draw it to the accelerated quartz context. Using OPERATOR_SOURCE for the blit doesn't appear to fix the bug either. My guess is that the internal implementation is doing something different for these 'small' surfaces. The fact that it is limited to 10.8 also suggests that it's unlikely to be something in our code. There are also a few crash bugs found by fuzzing (marked as deps of this bug) that need to be resolved.
Attachment #707913 - Flags: review?(bgirard) → review+
Attachment #707912 - Flags: review?(jmuizelaar) → review+
Attachment #707914 - Flags: review?(jmuizelaar) → review+
Comment on attachment 707910 [details] [diff] [review] Remove GetThebesSurfaceForDrawTarget for accelerated quartz Review of attachment 707910 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/thebes/gfxPlatformMac.cpp @@ +403,5 @@ > gfxPlatformMac::GetThebesSurfaceForDrawTarget(DrawTarget *aTarget) > { > if (aTarget->GetType() == BACKEND_COREGRAPHICS_ACCELERATED) { > + // There is no thebes support for accelerated CGContexts > + return nullptr; Are you sure nothing here will need this? We could just read back the results.
Comment on attachment 707906 [details] [diff] [review] Remove GetThebesSurfaceForDrawTarget dependencies Review of attachment 707906 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me! Some incorrect whitespace here, make sure to fix that before landing.
Attachment #707906 - Flags: review?(bas) → review+
Comment on attachment 707905 [details] [diff] [review] Add a direct azure version of DrawMissingGlyph Review of attachment 707905 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/2d/2D.h @@ +371,5 @@ > * if there is no active subpath. > */ > virtual Point CurrentPoint() const = 0; > + > + void Rectangle(const Rect& aRect) { I'm not sure I like this API inside PathSink. I need to think about it a little more though.
(In reply to Benoit Girard (:BenWa) from comment #11) > Are you sure nothing here will need this? We could just read back the > results. Positive, I went through every caller and made sure of it. Reading back doesn't work, because the callers expect the surface returned to be a 'live' copy of the DrawTarget's data. This is what we had previously, and broke things. An example: We create a new, blank, canvas. We call drawWindow, which does a readback (of blank pixels) inside GetThebesSurfaceForDrawTarget, and then draws the window contents into the cached gfxImageSurface. We then use canvas API's to draw something ontop of the drawWindow contents (fillRect maybe?). These go into the DT (which is still blank), and don't touch the drawWindow contents which are in the gfxImageSurface. We then use asDataURL to retrieve our composited image, which grbas the cached gfxImageSurface and doesn't contain the changes that our drawRect should have done. We could stop caching the gfxImageSurface, but then the drawWindow contents would be lost instead. I'm pretty sure my patches are the only sane way to fix this :)
(In reply to Bas Schouten (:bas.schouten) from comment #13) > > I'm not sure I like this API inside PathSink. I need to think about it a > little more though. I assume we want it *somewhere* though right? It's pretty basic boilerplate code that we don't want to be repeating all over the place.
Comment on attachment 707910 [details] [diff] [review] Remove GetThebesSurfaceForDrawTarget for accelerated quartz Review of attachment 707910 [details] [diff] [review]: ----------------------------------------------------------------- r+ with a summary of your explanation in the code base why it's not supported.
Attachment #707910 - Flags: review?(bgirard) → review+
Comment on attachment 707907 [details] [diff] [review] Share the code for creating a CGImage from data Review of attachment 707907 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/2d/SourceSurfaceCG.cpp @@ -165,5 @@ > bitsPerPixel = 32; > break; > > case FORMAT_A8: > - // XXX: why don't we set a colorspace here? Don't drop the comment @@ +121,5 @@ > > + dataProvider = CGDataProviderCreateWithData(data, > + data, > + aSize.height * aStride, > + (aOwner > ExternalData) ? releaseCallback : nullptr); This function call mixes lines and spaces. ::: gfx/2d/SourceSurfaceCG.h @@ +26,5 @@ > +CreateImageFromData(unsigned char *aData, > + const IntSize &aSize, > + int32_t aStride, > + SurfaceFormat aFormat, > + DataOwnership aOwner = ExternalData); Don't have a default parameter. I'd prefer to have all the callers be explicit.
Attachment #707907 - Flags: review?(jmuizelaar) → review+
Attachment #707908 - Flags: review?(jmuizelaar) → review+
Depends on: 850081
Blocks: 841931
No longer blocks: 841931
Blocks: 799663
This is currently on hold because of the crash bugs (listed as dependencies) that we currently have no solution to.
So we're planning to use SkiaGL instead, right?
I think we should, yes, since we can patch it as needed. CC'ing gw280 who has been working on SkiaGL the most.
Comment on attachment 707905 [details] [diff] [review] Add a direct azure version of DrawMissingGlyph Review of attachment 707905 [details] [diff] [review]: ----------------------------------------------------------------- If this is still relevant it looks fine. ::: gfx/2d/2D.h @@ +371,5 @@ > * if there is no active subpath. > */ > virtual Point CurrentPoint() const = 0; > + > + void Rectangle(const Rect& aRect) { We have a helper for this outside of pathsink now.
Attachment #707905 - Flags: review?(bas) → review+
What are we doing with this bug?
Assignee: nobody → matt.woodrow
Status: NEW → ASSIGNED
Flags: needinfo?(matt.woodrow)
Flags: needinfo?(jmuizelaar)
Flags: needinfo?(bgirard)
Flags: needinfo?(bas)
The high risk of problems and are inability to fix system libraries means that accelerated CoreGraphics is not worth the risk.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(matt.woodrow)
Flags: needinfo?(jmuizelaar)
Flags: needinfo?(bgirard)
Flags: needinfo?(bas)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: