Closed Bug 929299 Opened 11 years ago Closed 11 years ago

fix DrawTargetSkia to not copy and render in place

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: gal, Assigned: gal)

References

Details

Attachments

(1 file, 1 obsolete file)

DrawTargetSkia copies the pixel data it is given when using InitWithData and then draws into the copy, ultimately losing it when the DT is deallocated. Instead, attach the bitmap to the pixel data and draw into that. The pixel data must stick around or this fails. I think InitWithData is meant this way.

Dito for SourceSourceSkia. It currently allocates a separate bitmap and copies the data in there. Thats very inefficient and I think not designed this way in Moz2D.
Comment on attachment 820107 [details] [diff] [review]
Don't allocate pixel data for DrawTargetSkia and SourceSurfaceSkia when using InitWithData.

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

::: gfx/2d/DrawTargetSkia.cpp
@@ +755,1 @@
>    mSize = aSize;

bitmap never gets given the aData pointer here?

::: gfx/2d/SourceSurfaceSkia.cpp
@@ +77,5 @@
>      mBitmap.unlockPixels();
>      mBitmap.notifyPixelsChanged();
>      mBitmap.setIsOpaque(true);
> +  } else {
> +    mBitmap = temp;

We can't do this because temp's pixels are currently set to aData, and CreateSourceSurfaceFromData (which in turns calls InitFromData) explicitly doesn't take ownership of aData.
Attachment #820107 - Flags: review?(gwright) → review-
Summary: fix DrawTargetSkia and SourceSurfaceSkia → fix DrawTargetSkia to not copy and render in place
On a related note, skia silently fails to render RGB in various exciting ways, only BGR is handled properly in most paths. Is that intentional?
Blocks: 933030
Attachment #825239 - Flags: review?(gwright) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/4d642c4a393c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: