Bug 771219 - Added a pref for progressive painting. r=ajuma

This commit is contained in:
Benoit Girard 2012-07-06 14:38:50 -04:00
parent a8ab8cd794
commit fcd43f3bee
3 changed files with 21 additions and 4 deletions

View File

@ -227,9 +227,7 @@ BasicTiledThebesLayer::PaintThebes(gfxContext* aContext,
if (regionToPaint.IsEmpty())
return;
bool useProgressivePaint = true;
if (useProgressivePaint) {
if (gfxPlatform::UseProgressiveTilePainting()) {
nsIntRegionRectIterator it(regionToPaint);
const nsIntRect* rect = it.Next();
if (!rect)

View File

@ -1080,6 +1080,22 @@ gfxPlatform::AppendPrefLang(eFontPrefLang aPrefLangs[], PRUint32& aLen, eFontPre
}
}
bool
gfxPlatform::UseProgressiveTilePainting()
{
static bool sUseProgressiveTilePainting;
static bool sUseProgressiveTilePaintingPrefCached = false;
if (!sUseProgressiveTilePaintingPrefCached) {
sUseProgressiveTilePaintingPrefCached = true;
mozilla::Preferences::AddBoolVarCache(&sUseProgressiveTilePainting,
"layers.progressive-paint",
true);
}
return sUseProgressiveTilePainting;
}
bool
gfxPlatform::UseAzureContentDrawing()
{
@ -1088,7 +1104,7 @@ gfxPlatform::UseAzureContentDrawing()
if (!sAzureContentDrawingPrefCached) {
sAzureContentDrawingPrefCached = true;
mozilla::Preferences::AddBoolVarCache(&sAzureContentDrawingEnabled,
mozilla::Preferences::AddBoolVarCache(&sAzureContentDrawingEnabled,
"gfx.content.azure.enabled");
}

View File

@ -368,6 +368,9 @@ public:
// platform-specific override, by default do nothing
}
// Break large OMTC tiled thebes layer painting into small paints.
static bool UseProgressiveTilePainting();
// helper method to indicate if we want to use Azure content drawing
static bool UseAzureContentDrawing();