Bug 934860 - Part 6: Add a pref to disable single rect painting and disable it for now for causing TART regressions. r=jrmuziel

This commit is contained in:
Matt Woodrow 2013-11-14 13:46:19 +13:00
parent 9ec181130a
commit e5d0e79c1e

View File

@ -3316,9 +3316,19 @@ FrameLayerBuilder::PaintItems(nsTArray<ClippedDisplayItem>& aItems,
*/
static bool ShouldDrawRectsSeparately(gfxContext* aContext, DrawRegionClip aClip)
{
if (aContext->IsCairo() || aClip == CLIP_NONE) {
static bool sPaintRectsSeparately;
static bool sPaintRectsSeparatelyPrefCached = false;
if (!sPaintRectsSeparatelyPrefCached) {
Preferences::AddBoolVarCache(&sPaintRectsSeparately, "layout.paint_rects_separately", false);
sPaintRectsSeparatelyPrefCached = true;
}
if (!sPaintRectsSeparately ||
aContext->IsCairo() ||
aClip == CLIP_NONE) {
return false;
}
DrawTarget *dt = aContext->GetDrawTarget();
return dt->GetType() == BACKEND_DIRECT2D;
}