Bug 1225934 - Never allow surface substitution when FLAG_HIGH_QUALITY_SCALING is disabled. r=tn, a=ritu
authorSeth Fowler <mark.seth.fowler@gmail.com>
Mon, 07 Mar 2016 17:17:16 -0800
changeset 323457 19ced35b80760ea9cbf41dde24a832d01b4d8f88
parent 323456 ee1c8ed1e4b66ac53192cf092151257cf92d34ff
child 323458 f94242ec4259e7dc64a951f491e9b294c273bd53
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn, ritu
bugs1225934
milestone47.0a2
Bug 1225934 - Never allow surface substitution when FLAG_HIGH_QUALITY_SCALING is disabled. r=tn, a=ritu
image/RasterImage.cpp
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -285,19 +285,20 @@ RasterImage::LookupFrameInternal(uint32_
   if (mAnim && aFrameNum > 0) {
     MOZ_ASSERT(ToSurfaceFlags(aFlags) == DefaultSurfaceFlags(),
                "Can't composite frames with non-default surface flags");
     return mAnim->GetCompositedFrame(aFrameNum);
   }
 
   SurfaceFlags surfaceFlags = ToSurfaceFlags(aFlags);
 
-  // We don't want any substitution for sync decodes, so we use
+  // We don't want any substitution for sync decodes, and substitution would be
+  // illegal when high quality downscaling is disabled, so we use
   // SurfaceCache::Lookup in this case.
-  if (aFlags & FLAG_SYNC_DECODE) {
+  if ((aFlags & FLAG_SYNC_DECODE) || !(aFlags & FLAG_HIGH_QUALITY_SCALING)) {
     return SurfaceCache::Lookup(ImageKey(this),
                                 RasterSurfaceKey(aSize,
                                                  surfaceFlags,
                                                  aFrameNum));
   }
 
   // We'll return the best match we can find to the requested frame.
   return SurfaceCache::LookupBestMatch(ImageKey(this),