Bug 1264809 - (Part 4) Add comment for FLAG_FORCE_UNIFORM_SCALING. r=dholbert
authorGuanWen-Chen <kechen@mozilla.com>
Mon, 22 Aug 2016 05:04:00 -0400
changeset 310787 ec83da3f24a9968574a30ed77d4ab67f61348acf
parent 310786 12c339c6063083e62ead7eeb20a4505982fd39aa
child 310788 27f61f2b6d787d0d6aefb3a8e5b72215bbd2e07c
push id80950
push userryanvm@gmail.com
push dateTue, 23 Aug 2016 14:29:50 +0000
treeherdermozilla-inbound@dab0693cae68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1264809
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1264809 - (Part 4) Add comment for FLAG_FORCE_UNIFORM_SCALING. r=dholbert
image/imgIContainer.idl
--- a/image/imgIContainer.idl
+++ b/image/imgIContainer.idl
@@ -190,16 +190,25 @@ interface imgIContainer : nsISupports
    * non-uniformly if necessary. This flag is for vector image only. A raster
    * image should ignore this flag. While drawing a vector image with this
    * flag, do not force uniform scaling even if its root <svg> node has a
    * preserveAspectRatio attribute that would otherwise require uniform
    * scaling , such as xMinYMin/ xMidYMin. Always scale the graphic content of
    * the given image non-uniformly if necessary such that the image's
    * viewBox (if specified or implied by height/width attributes) exactly
    * matches the viewport rectangle.
+   *
+   * FLAG_FORCE_UNIFORM_SCALING: Signal to ClippedImage::OptimalSizeForDest that
+   * its returned size can only scale the image's size *uniformly* (by the same
+   * factor in each dimension). We need this flag when painting border-image
+   * section with SVG image source-data, if the SVG image has no viewBox and no
+   * intrinsic size. In such a case, we synthesize a viewport for the SVG image
+   * (a "window into SVG space") based on the border image area, and we need to
+   * be sure we don't subsequently scale that viewport in a way that distorts
+   * its contents by stretching them more in one dimension than the other.
    */
   const unsigned long FLAG_NONE                            = 0x0;
   const unsigned long FLAG_SYNC_DECODE                     = 0x1;
   const unsigned long FLAG_SYNC_DECODE_IF_FAST             = 0x2;
   const unsigned long FLAG_ASYNC_NOTIFY                    = 0x4;
   const unsigned long FLAG_DECODE_NO_PREMULTIPLY_ALPHA     = 0x8;
   const unsigned long FLAG_DECODE_NO_COLORSPACE_CONVERSION = 0x10;
   const unsigned long FLAG_CLAMP                           = 0x20;