Bug 1769935. Only do partial bg image drawing in content process. r=aosmond
authorTimothy Nikkel <tnikkel@gmail.com>
Thu, 19 May 2022 04:32:51 +0000
changeset 618193 ee2ca87ef3d6d503a4a1ed79d501fc8cd29dd701
parent 618191 c2221e86cb617fa2947a9a82c47207569f171823
child 618194 ea32c4c1d987ddef9f831edbb1c4cb187930dc16
push id39719
push usersmolnar@mozilla.com
push dateThu, 19 May 2022 16:03:14 +0000
treeherdermozilla-central@cc776278c4ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1769935
milestone102.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 1769935. Only do partial bg image drawing in content process. r=aosmond Differential Revision: https://phabricator.services.mozilla.com/D146686
layout/painting/nsCSSRendering.cpp
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -2968,18 +2968,21 @@ nsBackgroundLayerState nsCSSRendering::P
     irFlags |= nsImageRenderer::FLAG_SYNC_DECODE_IMAGES;
   }
   if (aFlags & nsCSSRendering::PAINTBG_TO_WINDOW) {
     irFlags |= nsImageRenderer::FLAG_PAINTING_TO_WINDOW;
   }
   if (aFlags & nsCSSRendering::PAINTBG_HIGH_QUALITY_SCALING) {
     irFlags |= nsImageRenderer::FLAG_HIGH_QUALITY_SCALING;
   }
+  // Only do partial bg image drawing in content documents: non-content
+  // documents are viewed as UI of the browser and a partial draw of a bg image
+  // might look weird in that context.
   if (StaticPrefs::layout_display_partial_background_images() &&
-      !aPresContext->IsChrome()) {
+      XRE_IsContentProcess() && !aPresContext->IsChrome()) {
     irFlags |= nsImageRenderer::FLAG_DRAW_PARTIAL_FRAMES;
   }
 
   nsBackgroundLayerState state(aForFrame, &aLayer.mImage, irFlags);
   if (!state.mImageRenderer.PrepareImage()) {
     // There's no image or it's not ready to be painted.
     if (aOutIsTransformedFixed &&
         StyleImageLayerAttachment::Fixed == aLayer.mAttachment) {