Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / image / imgIContainer.idl
blob82396b80c7fa792e502370ad1f60027132722bfd
1 /** -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 webidl Document;
11 %{C++
12 #include "ImgDrawResult.h"
13 #include "gfxPoint.h"
14 #include "mozilla/gfx/Types.h"
15 #include "mozilla/AspectRatio.h"
16 #include "mozilla/Maybe.h"
17 #include "mozilla/RefPtr.h"
18 #include "nsRect.h"
19 #include "nsSize.h"
20 #include "nsTArray.h"
21 #include "limits.h"
23 class gfxContext;
24 class nsIFrame;
26 namespace mozilla {
27 class TimeStamp;
28 class SVGImageContext;
29 struct MediaFeatureChange;
31 namespace gfx {
32 class SourceSurface;
35 class WindowRenderer;
36 namespace layers {
37 class ImageContainer;
40 namespace image {
41 class ImageRegion;
42 class ImageIntRegion;
43 class WebRenderImageProvider;
44 struct Orientation;
45 struct Resolution;
51 native AspectRatio(mozilla::AspectRatio);
52 native ImgDrawResult(mozilla::image::ImgDrawResult);
53 [ptr] native gfxContext(gfxContext);
54 [ref] native gfxMatrix(gfxMatrix);
55 [ref] native gfxRect(gfxRect);
56 [ref] native gfxSize(gfxSize);
57 native SamplingFilter(mozilla::gfx::SamplingFilter);
58 [ref] native nsIntRect(nsIntRect);
59 native nsIntRectByVal(nsIntRect);
60 [ref] native nsIntSize(nsIntSize);
61 native nsSize(nsSize);
62 [ptr] native nsIFrame(nsIFrame);
63 native TempRefImageContainer(already_AddRefed<mozilla::layers::ImageContainer>);
64 [ptr] native ImageContainer(mozilla::layers::ImageContainer);
65 [ptr] native WebRenderImageProvider(mozilla::image::WebRenderImageProvider);
66 [ref] native ImageRegion(mozilla::image::ImageRegion);
67 [ptr] native WindowRenderer(mozilla::WindowRenderer);
68 native Orientation(mozilla::image::Orientation);
69 native ImageResolution(mozilla::image::Resolution);
70 [ref] native TimeStamp(mozilla::TimeStamp);
71 [ref] native SVGImageContext(mozilla::SVGImageContext);
72 [ref] native MaybeImageIntRegion(mozilla::Maybe<mozilla::image::ImageIntRegion>);
73 native TempRefSourceSurface(already_AddRefed<mozilla::gfx::SourceSurface>);
74 native TempRefImgIContainer(already_AddRefed<imgIContainer>);
75 native nsIntSizeByVal(nsIntSize);
76 [ref] native MediaFeatureChange(mozilla::MediaFeatureChange);
79 /**
80 * imgIContainer is the interface that represents an image. It allows
81 * access to frames as Thebes surfaces. It also allows drawing of images
82 * onto Thebes contexts.
84 * Internally, imgIContainer also manages animation of images.
86 [scriptable, builtinclass, uuid(a8dbee24-ff86-4755-b40e-51175caf31af)]
87 interface imgIContainer : nsISupports
89 /**
90 * The width of the container rectangle. In the case of any error,
91 * zero is returned, and an exception will be thrown.
93 readonly attribute int32_t width;
95 /**
96 * The height of the container rectangle. In the case of any error,
97 * zero is returned, and an exception will be thrown.
99 readonly attribute int32_t height;
102 * The intrinsic size of this image in appunits. If the image has no intrinsic
103 * size in a dimension, -1 will be returned for that dimension. In the case of
104 * any error, an exception will be thrown.
106 [noscript] readonly attribute nsSize intrinsicSize;
109 * The (dimensionless) intrinsic ratio of this image. Might return a
110 * degenerate ratio (one that returns 'false' when coerced to a bool)
111 * if the image is in an error state, or there's no ratio.
113 [notxpcom, nostdcall] readonly attribute AspectRatio intrinsicRatio;
116 * The x coordinate of the image's hotspot, or 0 if there is no hotspot.
118 readonly attribute int32_t hotspotX;
121 * The y coordinate of the image's hotspot, or 0 if there is no hotspot.
123 readonly attribute int32_t hotspotY;
126 * Given a size at which this image will be displayed, and the drawing
127 * parameters affecting how it will be drawn, returns the image size which
128 * should be used to draw to produce the highest quality result. This is the
129 * appropriate size, for example, to use as an input to the pixel snapping
130 * algorithm.
132 * For best results the size returned by this method should not be cached. It
133 * can change over time due to changes in the internal state of the image.
135 * @param aDest The size of the destination rect into which this image will be
136 * drawn, in device pixels.
137 * @param aWhichFrame Frame specifier of the FRAME_* variety.
138 * @param aSamplingFilter The filter to be used if we're scaling the image.
139 * @param aFlags Flags of the FLAG_* variety
141 [notxpcom, nostdcall] nsIntSizeByVal
142 optimalImageSizeForDest([const] in gfxSize aDest, in uint32_t aWhichFrame,
143 in SamplingFilter aSamplingFilter, in uint32_t aFlags);
146 * Enumerated values for the 'type' attribute (below).
148 const unsigned short TYPE_RASTER = 0;
149 const unsigned short TYPE_VECTOR = 1;
150 const unsigned short TYPE_REQUEST = 2;
153 * The type of this image (one of the TYPE_* values above).
155 [infallible] readonly attribute unsigned short type;
158 * Whether this image is animated. You can only be guaranteed that querying
159 * this will not throw if STATUS_DECODE_COMPLETE is set on the imgIRequest.
161 * @throws NS_ERROR_NOT_AVAILABLE if the animated state cannot be determined.
163 readonly attribute boolean animated;
166 * Provider ID for image providers created by this image.
168 [infallible] readonly attribute unsigned long providerId;
171 * Flags for imgIContainer operations.
173 * Meanings:
175 * FLAG_NONE: Lack of flags.
177 * FLAG_SYNC_DECODE: Forces synchronous/non-progressive decode of all
178 * available data before the call returns.
180 * FLAG_SYNC_DECODE_IF_FAST: Like FLAG_SYNC_DECODE, but requests a sync decode
181 * be performed only if ImageLib estimates it can be completed very quickly.
183 * FLAG_ASYNC_NOTIFY: Send notifications asynchronously, even if we decode
184 * synchronously because of FLAG_SYNC_DECODE or FLAG_SYNC_DECODE_IF_FAST.
186 * FLAG_DECODE_NO_PREMULTIPLY_ALPHA: Do not premultiply alpha if
187 * it's not already premultiplied in the image data.
189 * FLAG_DECODE_NO_COLORSPACE_CONVERSION: Do not do any colorspace conversion;
190 * ignore any embedded profiles, and don't convert to any particular
191 * destination space.
193 * FLAG_CLAMP: Extend the image to the fill area by clamping image sample
194 * coordinates instead of by tiling. This only affects 'draw'.
196 * FLAG_HIGH_QUALITY_SCALING: A hint as to whether this image should be
197 * scaled using the high quality scaler. Do not set this if not drawing to
198 * a window or not listening to invalidations. Passing this flag will do two
199 * things: 1) request a decode of the image at the size asked for by the
200 * caller if one isn't already started or complete, and 2) allows a decoded
201 * frame of any size (it could be neither the requested size, nor the
202 * intrinsic size) to be substituted.
204 * FLAG_BYPASS_SURFACE_CACHE: Forces drawing to happen rather than taking
205 * cached rendering from the surface cache. This is used when we are printing,
206 * for example, where we want the vector commands from VectorImages to end up
207 * in the PDF output rather than a cached rendering at screen resolution.
209 * FLAG_FORCE_PRESERVEASPECTRATIO_NONE: Force scaling this image
210 * non-uniformly if necessary. This flag is for vector image only. A raster
211 * image should ignore this flag. While drawing a vector image with this
212 * flag, do not force uniform scaling even if its root <svg> node has a
213 * preserveAspectRatio attribute that would otherwise require uniform
214 * scaling , such as xMinYMin/ xMidYMin. Always scale the graphic content of
215 * the given image non-uniformly if necessary such that the image's
216 * viewBox (if specified or implied by height/width attributes) exactly
217 * matches the viewport rectangle.
219 * FLAG_FORCE_UNIFORM_SCALING: Signal to ClippedImage::OptimalSizeForDest that
220 * its returned size can only scale the image's size *uniformly* (by the same
221 * factor in each dimension). We need this flag when painting border-image
222 * section with SVG image source-data, if the SVG image has no viewBox and no
223 * intrinsic size. In such a case, we synthesize a viewport for the SVG image
224 * (a "window into SVG space") based on the border image area, and we need to
225 * be sure we don't subsequently scale that viewport in a way that distorts
226 * its contents by stretching them more in one dimension than the other.
228 * FLAG_AVOID_REDECODE_FOR_SIZE: If there is already a raster surface
229 * available for this image, but it is not the same size as requested, skip
230 * starting a new decode for said size.
232 * FLAG_DECODE_TO_SRGB_COLORSPACE: Instead of converting the colorspace to
233 * the display's colorspace, use sRGB.
235 * FLAG_RECORD_BLOB: Instead of rasterizing an SVG image on the main thread,
236 * record the drawing commands using blob images.
238 const unsigned long FLAG_NONE = 0x0;
239 const unsigned long FLAG_SYNC_DECODE = 0x1;
240 const unsigned long FLAG_SYNC_DECODE_IF_FAST = 0x2;
241 const unsigned long FLAG_ASYNC_NOTIFY = 0x4;
242 const unsigned long FLAG_DECODE_NO_PREMULTIPLY_ALPHA = 0x8;
243 const unsigned long FLAG_DECODE_NO_COLORSPACE_CONVERSION = 0x10;
244 const unsigned long FLAG_CLAMP = 0x20;
245 const unsigned long FLAG_HIGH_QUALITY_SCALING = 0x40;
246 const unsigned long FLAG_BYPASS_SURFACE_CACHE = 0x80;
247 const unsigned long FLAG_FORCE_PRESERVEASPECTRATIO_NONE = 0x100;
248 const unsigned long FLAG_FORCE_UNIFORM_SCALING = 0x200;
249 const unsigned long FLAG_AVOID_REDECODE_FOR_SIZE = 0x400;
250 const unsigned long FLAG_DECODE_TO_SRGB_COLORSPACE = 0x800;
251 const unsigned long FLAG_RECORD_BLOB = 0x1000;
254 * A constant specifying the default set of decode flags (i.e., the default
255 * values for FLAG_DECODE_*).
257 const unsigned long DECODE_FLAGS_DEFAULT = 0;
260 * A constant specifying the decode flags recommended to be used when
261 * re-encoding an image, or with the clipboard.
263 const unsigned long DECODE_FLAGS_FOR_REENCODE =
264 FLAG_DECODE_NO_PREMULTIPLY_ALPHA | FLAG_DECODE_TO_SRGB_COLORSPACE;
267 * Constants for specifying various "special" frames.
269 * FRAME_FIRST: The first frame
270 * FRAME_CURRENT: The current frame
272 * FRAME_MAX_VALUE should be set to the value of the maximum constant above,
273 * as it is used for ensuring that a valid value was passed in.
275 const unsigned long FRAME_FIRST = 0;
276 const unsigned long FRAME_CURRENT = 1;
277 const unsigned long FRAME_MAX_VALUE = 1;
280 * Get a surface for the given frame. This may be a platform-native,
281 * optimized surface, so you cannot inspect its pixel data. If you
282 * need that, use SourceSurface::GetDataSurface.
284 * @param aWhichFrame Frame specifier of the FRAME_* variety.
285 * @param aFlags Flags of the FLAG_* variety
287 [noscript, notxpcom] TempRefSourceSurface getFrame(in uint32_t aWhichFrame,
288 in uint32_t aFlags);
291 * Get a surface for the given frame at the specified size. Matching the
292 * requested size is best effort; it's not guaranteed that the surface you get
293 * will be a perfect match. (Some reasons you may get a surface of a different
294 * size include: if you requested upscaling, if downscale-during-decode is
295 * disabled, or if you didn't request the first frame.)
297 * @param aSize The desired size.
298 * @param aWhichFrame Frame specifier of the FRAME_* variety.
299 * @param aFlags Flags of the FLAG_* variety
301 [noscript, notxpcom] TempRefSourceSurface getFrameAtSize([const] in nsIntSize aSize,
302 in uint32_t aWhichFrame,
303 in uint32_t aFlags);
306 * Returns true if this image will draw opaquely right now if asked to draw
307 * with FLAG_HIGH_QUALITY_SCALING and otherwise default flags. If this image
308 * (when decoded) is opaque but no decoded frames are available then
309 * willDrawOpaqueNow will return false.
311 [noscript, notxpcom] boolean willDrawOpaqueNow();
314 * Returns true if this image has a frame and the frame currently has a
315 * least 1 decoded pixel. Only valid for raster images.
317 [noscript, notxpcom] boolean hasDecodedPixels();
320 * @return true if getImageContainer() is expected to return a valid
321 * ImageContainer when passed the given @Renderer and @Flags
322 * parameters.
324 [noscript, notxpcom] boolean isImageContainerAvailable(in WindowRenderer aRenderer,
325 in uint32_t aFlags);
328 * Attempts to find a WebRenderImageProvider containing the current frame at
329 * the given size. Match the requested size is best effort; it's not
330 * guaranteed that the surface you get will be a perfect match. (Some reasons
331 * you may get a surface of a different size include: if you requested
332 * upscaling, or if downscale-during-decode is disabled.)
334 * @param aRenderer The WindowRenderer which will be used to render the
335 * ImageContainer.
336 * @param aSVGContext If specified, SVG-related rendering context, such as
337 * overridden attributes on the image document's root <svg>
338 * node, and the size of the viewport that the full image
339 * would occupy. Ignored for raster images.
340 * @param aFlags Decoding / drawing flags (in other words, FLAG_* flags).
341 * Currently only FLAG_SYNC_DECODE and FLAG_SYNC_DECODE_IF_FAST
342 * are supported.
343 * @param aProvider Return value for WebRenderImageProvider for the current
344 * frame. May be null depending on the draw result.
345 * @return The draw result for the current frame.
347 [noscript, notxpcom] ImgDrawResult getImageProvider(in WindowRenderer aRenderer,
348 [const] in nsIntSize aSize,
349 [const] in SVGImageContext aSVGContext,
350 [const] in MaybeImageIntRegion aRegion,
351 in uint32_t aFlags,
352 out WebRenderImageProvider aProvider);
355 * Draw the requested frame of this image onto the context specified.
357 * Drawing an image involves scaling it to a certain size (which may be
358 * implemented as a "smart" scale by substituting an HQ-scaled frame or
359 * rendering at a high DPI), and then selecting a region of that image to
360 * draw. That region is drawn onto the graphics context and in the process
361 * transformed by the context matrix, which determines the final area that is
362 * filled. The basic process looks like this:
364 * +------------------+
365 * | Image |
366 * | |
367 * | intrinsic width |
368 * | X |
369 * | intrinsic height |
370 * +------------------+
371 * / \
372 * / \
373 * / (scale to aSize) \
374 * / \
375 * +----------------------------+
376 * | |
377 * | Scaled Image |
378 * | aSize.width X aSize.height |
379 * | |
380 * | +---------+ |
381 * | | aRegion | |
382 * | +---------+ |
383 * +-------(---------(----------+
384 * | |
385 * / \
386 * | (transform |
387 * / by aContext \
388 * | matrix) |
389 * / \
390 * +---------------------+
391 * | |
392 * | Fill Rect |
393 * | |
394 * +---------------------+
396 * The region may extend outside of the scaled image's boundaries. It's
397 * actually a region in tiled image space, which is formed by tiling the
398 * scaled image infinitely in every direction. Drawing with a region larger
399 * than the scaled image thus causes the filled area to contain multiple tiled
400 * copies of the image, which looks like this:
402 * ....................................................
403 * : : : :
404 * : Tile : Tile : Tile :
405 * : +------------[aRegion]------------+ :
406 * :........|.......:................:........|.......:
407 * : | : : | :
408 * : Ti|le : Scaled Image : Ti|le :
409 * : | : : | :
410 * :........|.......:................:........|.......:
411 * : +---------------------------------+ :
412 * : Ti|le : Tile : Ti|le :
413 * : / : : \ :
414 * :......(.........:................:..........).....:
415 * | |
416 * / \
417 * | (transform by aContext matrix) |
418 * / \
419 * +---------------------------------------------+
420 * | : : |
421 * |.....:.................................:.....|
422 * | : : |
423 * | : Tiled Fill : |
424 * | : : |
425 * |.....:.................................:.....|
426 * | : : |
427 * +---------------------------------------------+
430 * @param aContext The Thebes context to draw the image to.
431 * @param aSize The size to which the image should be scaled before drawing.
432 * This requirement may be satisfied using HQ scaled frames,
433 * selecting from different resolution layers, drawing at a
434 * higher DPI, or just performing additional scaling on the
435 * graphics context. Callers can use optimalImageSizeForDest()
436 * to determine the best choice for this parameter if they have
437 * no special size requirements.
438 * @param aRegion The region in tiled image space which will be drawn onto the
439 * graphics context. aRegion is in the coordinate space of the
440 * image after it has been scaled to aSize - that is, the image
441 * is scaled first, and then aRegion is applied. When aFlags
442 * includes FLAG_CLAMP, the image will be extended to this area
443 * by clamping image sample coordinates. Otherwise, the image
444 * will be automatically tiled as necessary. aRegion can also
445 * optionally contain a second region which restricts the set
446 * of pixels we're allowed to sample from when drawing; this
447 * is only of use to callers which need to draw with pixel
448 * snapping.
449 * @param aWhichFrame Frame specifier of the FRAME_* variety.
450 * @param aSamplingFilter The filter to be used if we're scaling the image.
451 * @param aSVGContext If specified, SVG-related rendering context, such as
452 * overridden attributes on the image document's root <svg>
453 * node, and the size of the viewport that the full image
454 * would occupy. Ignored for raster images.
455 * @param aFlags Flags of the FLAG_* variety
456 * @return A ImgDrawResult value indicating whether and to what degree the
457 * drawing operation was successful.
459 [noscript, notxpcom] ImgDrawResult
460 draw(in gfxContext aContext,
461 [const] in nsIntSize aSize,
462 [const] in ImageRegion aRegion,
463 in uint32_t aWhichFrame,
464 in SamplingFilter aSamplingFilter,
465 [const] in SVGImageContext aSVGContext,
466 in uint32_t aFlags,
467 in float aOpacity);
470 * Ensures that an image is decoding. Calling this function guarantees that
471 * the image will at some point fire off decode notifications. Images that
472 * can be decoded "quickly" according to some heuristic will be decoded
473 * synchronously.
475 * @param aFlags Flags of the FLAG_* variety. Only FLAG_ASYNC_NOTIFY
476 * is accepted; all others are ignored.
477 * @param aWhichFrame Frame specifier of the FRAME_* variety.
479 [noscript] void startDecoding(in uint32_t aFlags, in uint32_t aWhichFrame);
481 %{C++
482 nsresult StartDecoding(uint32_t aFlags) {
483 return StartDecoding(aFlags, FRAME_CURRENT);
488 * Exactly like startDecoding above except returns whether the current frame
489 * of the image is complete or not.
491 * @param aFlags Flags of the FLAG_* variety. Only FLAG_ASYNC_NOTIFY
492 * is accepted; all others are ignored.
493 * @param aWhichFrame Frame specifier of the FRAME_* variety.
495 [noscript, notxpcom] boolean startDecodingWithResult(in uint32_t aFlags, in uint32_t aWhichFrame);
497 %{C++
498 bool StartDecodingWithResult(uint32_t aFlags) {
499 return StartDecodingWithResult(aFlags, FRAME_CURRENT);
504 * This method triggers decoding for an image, but unlike startDecoding() it
505 * enables the caller to provide more detailed information about the decode
506 * request.
508 * @param aFlags Flags of the FLAG_* variety.
509 * @param aWhichFrame Frame specifier of the FRAME_* variety.
510 * @return DECODE_SURFACE_AVAILABLE if is a surface that satisfies the
511 * request and it is fully decoded.
512 * DECODE_REQUESTED if we requested a decode.
513 * DECODE_REQUEST_FAILED if we failed to request a decode. This means
514 * that either there is an error in the image or we cannot allocate a
515 * surface that big.
517 cenum DecodeResult : 8 {
518 DECODE_SURFACE_AVAILABLE = 0,
519 DECODE_REQUESTED = 1,
520 DECODE_REQUEST_FAILED = 2
522 [noscript, notxpcom] imgIContainer_DecodeResult requestDecodeWithResult(in uint32_t aFlags, in uint32_t aWhichFrame);
524 %{C++
525 DecodeResult RequestDecodeWithResult(uint32_t aFlags) {
526 return RequestDecodeWithResult(aFlags, FRAME_CURRENT);
531 * This method triggers decoding for an image, but unlike startDecoding() it
532 * enables the caller to provide more detailed information about the decode
533 * request.
535 * @param aSize The size to which the image should be scaled while decoding,
536 * if possible. If the image cannot be scaled to this size while
537 * being decoded, it will be decoded at its intrinsic size.
538 * @param aFlags Flags of the FLAG_* variety.
539 * @param aWhichFrame Frame specifier of the FRAME_* variety.
541 [noscript] void requestDecodeForSize([const] in nsIntSize aSize,
542 in uint32_t aFlags,
543 in uint32_t aWhichFrame);
545 %{C++
546 nsresult RequestDecodeForSize(const nsIntSize& aSize, uint32_t aFlags) {
547 return RequestDecodeForSize(aSize, aFlags, FRAME_CURRENT);
552 * Increments the lock count on the image. An image will not be discarded
553 * as long as the lock count is nonzero. Note that it is still possible for
554 * the image to be undecoded if decode-on-draw is enabled and the image
555 * was never drawn.
557 * Upon instantiation images have a lock count of zero.
559 void lockImage();
562 * Decreases the lock count on the image. If the lock count drops to zero,
563 * the image is allowed to discard its frame data to save memory.
565 * Upon instantiation images have a lock count of zero. It is an error to
566 * call this method without first having made a matching lockImage() call.
567 * In other words, the lock count is not allowed to be negative.
569 void unlockImage();
572 * If this image is unlocked, discard its decoded data. If the image is
573 * locked or has already been discarded, do nothing.
575 void requestDiscard();
578 * Indicates that this imgIContainer has been triggered to update
579 * its internal animation state. Likely this should only be called
580 * from within nsImageFrame or objects of similar type.
582 [notxpcom] void requestRefresh([const] in TimeStamp aTime);
585 * Animation mode Constants
586 * 0 = normal
587 * 1 = don't animate
588 * 2 = loop once
590 const short kNormalAnimMode = 0;
591 const short kDontAnimMode = 1;
592 const short kLoopOnceAnimMode = 2;
594 attribute unsigned short animationMode;
596 /* Methods to control animation */
597 void resetAnimation();
600 * Returns an index for the requested animation frame (either FRAME_FIRST or
601 * FRAME_CURRENT).
603 * The units of the index aren't specified, and may vary between different
604 * types of images. What you can rely on is that on all occasions when
605 * getFrameIndex(FRAME_CURRENT) returns a certain value,
606 * draw(..FRAME_CURRENT..) will draw the same frame. The same holds for
607 * FRAME_FIRST as well.
609 * @param aWhichFrame Frame specifier of the FRAME_* variety.
611 [notxpcom] float getFrameIndex(in uint32_t aWhichFrame);
614 * Returns the inherent orientation of the image, as described in the image's
615 * metadata (e.g. EXIF).
617 [notxpcom] Orientation getOrientation();
620 * Returns the intrinsic resolution of the image, or 1.0 if the image doesn't
621 * declare any.
623 [notxpcom] ImageResolution getResolution();
626 * Returns the delay, in ms, between the first and second frame. If this
627 * returns 0, there is no delay between first and second frame (i.e., this
628 * image could render differently whenever it draws).
630 * If this image is not animated, or not known to be animated (see attribute
631 * animated), returns -1.
633 [notxpcom] int32_t getFirstFrameDelay();
636 * If this is an animated image that hasn't started animating already, this
637 * sets the animation's start time to the indicated time.
639 * This has no effect if the image isn't animated or it has started animating
640 * already; it also has no effect if the image format doesn't care about
641 * animation start time.
643 * In all cases, animation does not actually begin until startAnimation(),
644 * resetAnimation(), or requestRefresh() is called for the first time.
646 [notxpcom] void setAnimationStartTime([const] in TimeStamp aTime);
649 * Given an invalidation rect in the coordinate system used by the decoder,
650 * returns an invalidation rect in image space.
652 * This is the identity transformation in most cases, but the result can
653 * differ if the image is wrapped by an ImageWrapper that changes its size
654 * or orientation.
656 [notxpcom] nsIntRectByVal
657 getImageSpaceInvalidationRect([const] in nsIntRect aRect);
660 * Removes any ImageWrappers and returns the unwrapped base image.
662 [notxpcom, nostdcall] TempRefImgIContainer unwrap();
665 * Propagate the use counters (if any) from this container to the passed in
666 * document.
668 [noscript, notxpcom] void propagateUseCounters(in Document aReferencingDocument);
671 * Called when media feature values that apply to all documents (such as
672 * those based on system metrics) have changed. If this image is a type
673 * that can respond to media queries (i.e., an SVG image), this function
674 * is overridden to handle restyling and invalidating the image.
676 [notxpcom, nostdcall] void mediaFeatureValuesChangedAllDocuments([const] in MediaFeatureChange aChange);
679 * Get the set of sizes the image can decode to natively.
681 [nostdcall] Array<nsIntSizeByVal> getNativeSizes();
683 [nostdcall, notxpcom] size_t getNativeSizesLength();