Make DrawTargetSkia::DrawSurface accept any surface type

RESOLVED FIXED in mozilla31

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

Trunk
mozilla31
x86
macOS
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
Posted patch patchSplinter Review
Attachment #8405935 - Flags: review?(gwright)

Comment 2

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.