mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 818169 - Add a pref to configure resolution of low precision buffer. r=bgirard
This commit is contained in:
parent
afc97dbcf9
commit
742c5a38d7
@ -238,6 +238,20 @@ BasicTiledLayerBuffer::ValidateTile(BasicTiledLayerTile aTile,
|
||||
return aTile;
|
||||
}
|
||||
|
||||
BasicTiledThebesLayer::BasicTiledThebesLayer(BasicShadowLayerManager* const aManager)
|
||||
: ThebesLayer(aManager, static_cast<BasicImplData*>(this))
|
||||
, mLastScrollOffset(0, 0)
|
||||
, mFirstPaint(true)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BasicTiledThebesLayer);
|
||||
mLowPrecisionTiledBuffer.SetResolution(gfxPlatform::GetLowPrecisionResolution());
|
||||
}
|
||||
|
||||
BasicTiledThebesLayer::~BasicTiledThebesLayer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(BasicTiledThebesLayer);
|
||||
}
|
||||
|
||||
void
|
||||
BasicTiledThebesLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
|
@ -12,8 +12,6 @@
|
||||
#include "BasicImplData.h"
|
||||
#include <algorithm>
|
||||
|
||||
#define LOW_PRECISION_RESOLUTION 0.25
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
@ -176,20 +174,8 @@ class BasicTiledThebesLayer : public ThebesLayer,
|
||||
typedef ThebesLayer Base;
|
||||
|
||||
public:
|
||||
BasicTiledThebesLayer(BasicShadowLayerManager* const aManager)
|
||||
: ThebesLayer(aManager, static_cast<BasicImplData*>(this))
|
||||
, mLastScrollOffset(0, 0)
|
||||
, mFirstPaint(true)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BasicTiledThebesLayer);
|
||||
mLowPrecisionTiledBuffer.SetResolution(LOW_PRECISION_RESOLUTION);
|
||||
}
|
||||
|
||||
~BasicTiledThebesLayer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(BasicTiledThebesLayer);
|
||||
}
|
||||
|
||||
BasicTiledThebesLayer(BasicShadowLayerManager* const aManager);
|
||||
~BasicTiledThebesLayer();
|
||||
|
||||
// Thebes Layer
|
||||
virtual Layer* AsLayer() { return this; }
|
||||
|
@ -1262,6 +1262,24 @@ gfxPlatform::UseLowPrecisionBuffer()
|
||||
return sUseLowPrecisionBuffer;
|
||||
}
|
||||
|
||||
float
|
||||
gfxPlatform::GetLowPrecisionResolution()
|
||||
{
|
||||
static float sLowPrecisionResolution;
|
||||
static bool sLowPrecisionResolutionPrefCached = false;
|
||||
|
||||
if (!sLowPrecisionResolutionPrefCached) {
|
||||
int32_t lowPrecisionResolution = 250;
|
||||
sLowPrecisionResolutionPrefCached = true;
|
||||
mozilla::Preferences::AddIntVarCache(&lowPrecisionResolution,
|
||||
"layers.low-precision-resolution",
|
||||
250);
|
||||
sLowPrecisionResolution = lowPrecisionResolution / 1000.f;
|
||||
}
|
||||
|
||||
return sLowPrecisionResolution;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxPlatform::UseReusableTileStore()
|
||||
{
|
||||
|
@ -409,6 +409,9 @@ public:
|
||||
// it into a buffer at a lower precision. Requires tiled buffers.
|
||||
static bool UseLowPrecisionBuffer();
|
||||
|
||||
// Retrieve the resolution that a low precision buffer should render at.
|
||||
static float GetLowPrecisionResolution();
|
||||
|
||||
// Retain some invalid tiles when the valid region of a layer changes and
|
||||
// excludes previously valid tiles.
|
||||
static bool UseReusableTileStore();
|
||||
|
@ -524,6 +524,7 @@ pref("layers.offmainthreadcomposition.enabled", true);
|
||||
pref("layers.async-video.enabled", true);
|
||||
pref("layers.progressive-paint", true);
|
||||
pref("layers.low-precision-buffer", true);
|
||||
pref("layers.low-precision-resolution", 250);
|
||||
|
||||
pref("notification.feature.enabled", true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user