Closed Bug 995832 Opened 10 years ago Closed 10 years ago

Make DrawTargetSkia::DrawSurface accept any surface type

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file)

The latest Try failure I'm debugging with the patch for bug 950372 is failures on the tests under:

https://mxr.mozilla.org/mozilla-central/source/image/test/reftest/encoders-lossless/

This test loads a PNG in an <img> and then paints that <img> to a canvas using:

CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image, ...)

Under that DrawImage function we call RasterImage::GetFrame() and then it passes the SourceSurface to DrawTargetSkia::DrawSurface. It turns out the reason the tests fail is because RasterImage::GetFrame now returns a SourceSurfaceCairo and DrawTargetSkia::DrawSurface just silently returns if the passed in SourceSurface isn't of type SurfaceType::SKIA or SurfaceType::DATA.

I think DrawTargetSkia::DrawSurface should call GetDataSurface on the surface that is passed in if it's not of these types.
Attached patch patchSplinter Review
Attachment #8405935 - Flags: review?(gwright)
I wanted to do this before but Bas stopped me and said that we intentionally don't want backends to inter-operate. Instead you should extract that data and wrap it into a data surface and pass that in.
Comment on attachment 8405935 [details] [diff] [review]
patch

Review of attachment 8405935 [details] [diff] [review]:
-----------------------------------------------------------------

Looks ok. Not sure I'm a fan of re-using the "aSurface" pointer like that, but otherwise no issues.
Attachment #8405935 - Flags: review?(gwright) → review+
https://hg.mozilla.org/mozilla-central/rev/44e4463a8eeb
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: