Commit 01be4263 authored by Timothy Nikkel's avatar Timothy Nikkel
Browse files

Bug 1820711. Pass FLAG_SYNC_DECODE_IF_FAST for all nsImageRenderer image drawing. r=emilio

This doesn't have that much of an effect because we already call StartDecodingWithResult https://searchfox.org/mozilla-central/rev/3002762e41363de8ee9ca80196d55e79651bcb6b/layout/painting/nsImageRenderer.cpp before we even get to painting these images, which will do the "sync decode if fast" part of FLAG_SYNC_DECODE_IF_FAST. However, on redecodes after discarding the image we won't hit that codepath because mImage->IsComplete() will kep returning true because it checks the image status flags for the frame complete flag and we never remove image status flags (they are purely increasing). So in that case we will proceed to draw the image and at that point we will do some sync decoding if the image is small enough.

Differential Revision: https://phabricator.services.mozilla.com/D171829
parent 039b75b9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -444,6 +444,8 @@ static uint32_t ConvertImageRendererToDrawFlags(uint32_t aImageRendererFlags) {
  uint32_t drawFlags = imgIContainer::FLAG_ASYNC_NOTIFY;
  if (aImageRendererFlags & nsImageRenderer::FLAG_SYNC_DECODE_IMAGES) {
    drawFlags |= imgIContainer::FLAG_SYNC_DECODE;
  } else {
    drawFlags |= imgIContainer::FLAG_SYNC_DECODE_IF_FAST;
  }
  if (aImageRendererFlags & (nsImageRenderer::FLAG_PAINTING_TO_WINDOW |
                             nsImageRenderer::FLAG_HIGH_QUALITY_SCALING)) {