Open Bug 749457 Opened 12 years ago Updated 2 years ago

Expose optimized RasterImages to Layers

Categories

(Core :: Graphics: ImageLib, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: mattwoodrow, Unassigned)

References

Details

Attachments

(1 file)

When we have an optimized image surface within a RasterImage (image smaller than the frame rect, or a single color), we end up doing a copy into a temporary surface before giving it to layers.

I think we either need to cache the temporary after doing this once, or expose this optimized state to layers. The latter is probably always going to be uglier, but hopefully optimal.

Attached patch implements the partial image handling component of the latter idea. I'll add conversion to ColorLayers for single color frames if we think this is a good idea.
Attachment #618868 - Flags: feedback?(joe)
Comment on attachment 618868 [details] [diff] [review]
Expose partial frame images

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

::: image/src/RasterImage.cpp
@@ +934,5 @@
>      nsRefPtr<gfxImageSurface> imgsurf;
>      rv = CopyFrame(aWhichFrame, aFlags, getter_AddRefs(imgsurf));
>      framesurf = imgsurf;
>    }
> +  

remove this extra newline please

@@ +991,5 @@
> +                          0 : GetCurrentImgFrameIndex();
> +  imgFrame *frame = GetDrawableImgFrame(frameIndex);
> +  if (!frame) {
> +    return NS_ERROR_FAILURE;
> +  }

It would be nice if we could factor this goop out into its own function; then we could use it from GetFrame and GetFrameRect as well as a bunch of other places.

Don't mean to make more work for you, but...
Attachment #618868 - Flags: feedback?(joe) → feedback+
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: