Bug 1333122 - Condition disabling of buffer-rotation on the layer tree rather than a compile-time flag. r?ethlin draft
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 23 Jan 2017 14:58:20 -0500 (2017-01-23)
changeset 465095 46e1478f8822cc004ccd25d115977dcba4434bd2
parent 465094 b755d8febcf8634d90017a1172597cd65a4fe4e8
child 543100 81ffd1e2c996de58a90b87dd9c55e3d3e4967c62
push id42545
push userkgupta@mozilla.com
push dateMon, 23 Jan 2017 19:58:54 +0000 (2017-01-23)
reviewersethlin
bugs1333122
milestone53.0a1
Bug 1333122 - Condition disabling of buffer-rotation on the layer tree rather than a compile-time flag. r?ethlin MozReview-Commit-ID: EQ8TsjDlPW0
gfx/layers/RotatedBuffer.cpp
modules/libpref/init/all.js
--- a/gfx/layers/RotatedBuffer.cpp
+++ b/gfx/layers/RotatedBuffer.cpp
@@ -422,18 +422,20 @@ RotatedContentBuffer::FlushBuffers()
 
 RotatedContentBuffer::PaintState
 RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
                                  uint32_t aFlags)
 {
   PaintState result;
   // We need to disable rotation if we're going to be resampled when
   // drawing, because we might sample across the rotation boundary.
+  // Also disable buffer rotation when using webrender.
   bool canHaveRotation = gfxPlatform::BufferRotationEnabled() &&
-                         !(aFlags & (PAINT_WILL_RESAMPLE | PAINT_NO_ROTATION));
+                         !(aFlags & (PAINT_WILL_RESAMPLE | PAINT_NO_ROTATION)) &&
+                         !(aLayer->Manager()->AsWebRenderLayerManager());
 
   nsIntRegion validRegion = aLayer->GetValidRegion();
 
   bool canUseOpaqueSurface = aLayer->CanUseOpaqueSurface();
   ContentType layerContentType =
     canUseOpaqueSurface ? gfxContentType::COLOR :
                           gfxContentType::COLOR_ALPHA;
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4652,21 +4652,17 @@ pref("layers.tiles.edge-padding", true);
 #endif
 
 // Whether to animate simple opacity and transforms on the compositor
 pref("layers.offmainthreadcomposition.async-animations", true);
 
 // Whether to log information about off main thread animations to stderr
 pref("layers.offmainthreadcomposition.log-animations", false);
 
-#ifdef MOZ_ENABLE_WEBRENDER
-pref("layers.bufferrotation.enabled", false);
-#else
 pref("layers.bufferrotation.enabled", true);
-#endif
 
 pref("layers.componentalpha.enabled", true);
 pref("layers.draw-mask-debug", false);
 
 pref("layers.advanced.border-layers", false);
 
 pref("gfx.content.always-paint", false);