Bug 783368 - Add a pref to control low precision tile rendering. r=bgirard

Add pref 'layers.low-precision-buffer', enabled on mobile/android.
This commit is contained in:
Chris Lord 2012-11-21 19:16:53 +00:00
parent ebcd7b9479
commit 9ec8b6a2e5
4 changed files with 23 additions and 1 deletions

View File

@ -591,7 +591,8 @@ BasicTiledThebesLayer::PaintThebes(gfxContext* aContext,
// If we have a critical display-port defined, render the full display-port
// progressively in the low-precision tiled buffer.
bool updatedLowPrecision = false;
if (!criticalDisplayPort.IsEmpty() &&
if (gfxPlatform::UseLowPrecisionBuffer() &&
!criticalDisplayPort.IsEmpty() &&
!nsIntRegion(layerDisplayPort).Contains(mVisibleRegion)) {
nsIntRegion oldValidRegion = mLowPrecisionTiledBuffer.GetValidRegion();
oldValidRegion.And(oldValidRegion, mVisibleRegion);

View File

@ -1246,6 +1246,22 @@ gfxPlatform::UseProgressiveTilePainting()
return sUseProgressiveTilePainting;
}
bool
gfxPlatform::UseLowPrecisionBuffer()
{
static bool sUseLowPrecisionBuffer;
static bool sUseLowPrecisionBufferPrefCached = false;
if (!sUseLowPrecisionBufferPrefCached) {
sUseLowPrecisionBufferPrefCached = true;
mozilla::Preferences::AddBoolVarCache(&sUseLowPrecisionBuffer,
"layers.low-precision-buffer",
false);
}
return sUseLowPrecisionBuffer;
}
bool
gfxPlatform::UseReusableTileStore()
{

View File

@ -405,6 +405,10 @@ public:
// Break large OMTC tiled thebes layer painting into small paints.
static bool UseProgressiveTilePainting();
// When a critical display-port is set, render the visible area outside of
// it into a buffer at a lower precision. Requires tiled buffers.
static bool UseLowPrecisionBuffer();
// Retain some invalid tiles when the valid region of a layer changes and
// excludes previously valid tiles.
static bool UseReusableTileStore();

View File

@ -523,6 +523,7 @@ pref("layers.acceleration.disabled", false);
pref("layers.offmainthreadcomposition.enabled", true);
pref("layers.async-video.enabled", true);
pref("layers.progressive-paint", true);
pref("layers.low-precision-buffer", true);
pref("notification.feature.enabled", true);