@@ -157,8 +157,8 @@ class Decoder {
157157 * TakeInvalidRect() returns only the invalidation region accumulated since
158158 * the last call to TakeInvalidRect().
159159 */
160- nsIntRect TakeInvalidRect () {
161- nsIntRect invalidRect = mInvalidRect ;
160+ OrientedIntRect TakeInvalidRect () {
161+ OrientedIntRect invalidRect = mInvalidRect ;
162162 mInvalidRect .SetEmpty ();
163163 return invalidRect;
164164 }
@@ -211,7 +211,7 @@ class Decoder {
211211 *
212212 * This must be called before Init() is called.
213213 */
214- void SetOutputSize (const gfx::IntSize & aSize);
214+ void SetOutputSize (const OrientedIntSize & aSize);
215215
216216 /* *
217217 * @return the output size of this decoder. If this is smaller than the
@@ -220,7 +220,7 @@ class Decoder {
220220 *
221221 * Illegal to call if HasSize() returns false.
222222 */
223- gfx::IntSize OutputSize () const {
223+ OrientedIntSize OutputSize () const {
224224 MOZ_ASSERT (HasSize ());
225225 return *mOutputSize ;
226226 }
@@ -229,13 +229,13 @@ class Decoder {
229229 * @return either the size passed to SetOutputSize() or Nothing(), indicating
230230 * that SetOutputSize() was not explicitly called.
231231 */
232- Maybe<gfx::IntSize > ExplicitOutputSize () const ;
232+ Maybe<OrientedIntSize > ExplicitOutputSize () const ;
233233
234234 /* *
235235 * Sets the expected image size of this decoder. Decoding will fail if this
236236 * does not match.
237237 */
238- void SetExpectedSize (const gfx::IntSize & aSize) {
238+ void SetExpectedSize (const OrientedIntSize & aSize) {
239239 mExpectedSize .emplace (aSize);
240240 }
241241
@@ -342,7 +342,7 @@ class Decoder {
342342 *
343343 * Illegal to call if HasSize() returns false.
344344 */
345- gfx::IntSize Size () const {
345+ OrientedIntSize Size () const {
346346 MOZ_ASSERT (HasSize ());
347347 return mImageMetadata .GetSize ();
348348 }
@@ -354,8 +354,8 @@ class Decoder {
354354 *
355355 * Illegal to call if HasSize() returns false.
356356 */
357- gfx::IntRect FullFrame () const {
358- return gfx::IntRect ( gfx::IntPoint (), Size ());
357+ OrientedIntRect FullFrame () const {
358+ return OrientedIntRect ( OrientedIntPoint (), Size ());
359359 }
360360
361361 /* *
@@ -369,8 +369,18 @@ class Decoder {
369369 *
370370 * Illegal to call if HasSize() returns false.
371371 */
372- gfx::IntRect FullOutputFrame () const {
373- return gfx::IntRect (gfx::IntPoint (), OutputSize ());
372+ OrientedIntRect FullOutputFrame () const {
373+ return OrientedIntRect (OrientedIntPoint (), OutputSize ());
374+ }
375+
376+ /* *
377+ * @return the orientation of the image.
378+ *
379+ * Illegal to call if HasSize() returns false.
380+ */
381+ Orientation GetOrientation () const {
382+ MOZ_ASSERT (HasSize ());
383+ return mImageMetadata .GetOrientation ();
374384 }
375385
376386 // / @return final status information about this decoder. Should be called
@@ -514,8 +524,8 @@ class Decoder {
514524 * be supplied if we're downscaling during decode.
515525 */
516526 void PostInvalidation (
517- const gfx::IntRect & aRect,
518- const Maybe<gfx::IntRect >& aRectAtOutputSize = Nothing());
527+ const OrientedIntRect & aRect,
528+ const Maybe<OrientedIntRect >& aRectAtOutputSize = Nothing());
519529
520530 // Called by the decoders when they have successfully decoded the image. This
521531 // may occur as the result of the decoder getting to the appropriate point in
@@ -586,14 +596,14 @@ class Decoder {
586596
587597 ImageMetadata mImageMetadata ;
588598
589- gfx::IntRect
599+ OrientedIntRect
590600 mInvalidRect ; // Tracks new rows as the current frame is decoded.
591- gfx::IntRect mRestoreDirtyRect ; // Tracks an invalidation region between the
592- // restore frame and the previous frame.
593- gfx::IntRect mRecycleRect ; // Tracks an invalidation region between the
594- // recycled frame and the current frame.
595- Maybe<gfx::IntSize > mOutputSize ; // The size of our output surface.
596- Maybe<gfx::IntSize > mExpectedSize ; // The expected size of the image.
601+ gfx::IntRect mRestoreDirtyRect ; // Tracks an invalidation region between the
602+ // restore frame and the previous frame.
603+ gfx::IntRect mRecycleRect ; // Tracks an invalidation region between the
604+ // recycled frame and the current frame.
605+ Maybe<OrientedIntSize > mOutputSize ; // The size of our output surface.
606+ Maybe<OrientedIntSize > mExpectedSize ; // The expected size of the image.
597607 Progress mProgress ;
598608
599609 uint32_t mFrameCount ; // Number of frames, including anything in-progress
0 commit comments