Bug 938395 - Enable single rect painting for d3d10. r=Bas

This commit is contained in:
Matt Woodrow 2014-05-08 14:56:48 +12:00
parent abac769686
commit f67185f255
3 changed files with 5 additions and 9 deletions

View File

@ -412,6 +412,8 @@ ThebesLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
destinationSurface = mD2DSurface;
}
aRegion.SimplifyOutwardByArea(100 * 100);
MOZ_ASSERT(mDrawTarget);
nsRefPtr<gfxContext> context = new gfxContext(mDrawTarget);

View File

@ -205,6 +205,7 @@ private:
DECL_GFX_PREF(Once, "layout.css.touch_action.enabled", TouchActionEnabled, bool, false);
DECL_GFX_PREF(Once, "layout.frame_rate", LayoutFrameRate, int32_t, -1);
DECL_GFX_PREF(Live, "layout.display-list.dump", LayoutDumpDisplayList, bool, false);
DECL_GFX_PREF(Once, "layout.paint_rects_separately", LayoutPaintRectsSeparately, bool, true);
DECL_GFX_PREF(Live, "nglayout.debug.widget_update_flashing", WidgetUpdateFlashing, bool, false);

View File

@ -26,7 +26,7 @@
#include "GeckoProfiler.h"
#include "mozilla/gfx/Tools.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/Preferences.h"
#include "gfxPrefs.h"
#include <algorithm>
@ -3705,14 +3705,7 @@ FrameLayerBuilder::PaintItems(nsTArray<ClippedDisplayItem>& aItems,
*/
static bool ShouldDrawRectsSeparately(gfxContext* aContext, DrawRegionClip aClip)
{
static bool sPaintRectsSeparately;
static bool sPaintRectsSeparatelyPrefCached = false;
if (!sPaintRectsSeparatelyPrefCached) {
mozilla::Preferences::AddBoolVarCache(&sPaintRectsSeparately, "layout.paint_rects_separately", false);
sPaintRectsSeparatelyPrefCached = true;
}
if (!sPaintRectsSeparately ||
if (!gfxPrefs::LayoutPaintRectsSeparately() ||
aContext->IsCairo() ||
aClip == DrawRegionClip::CLIP_NONE) {
return false;