mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1023882 - Part 1 - Small refactorings. r=Cwiiis
This commit is contained in:
parent
5a4aed03f9
commit
08aa2460d4
@ -183,6 +183,17 @@ ClientTiledThebesLayer::BeginPaint()
|
||||
TILING_PRLOG_OBJ(("TILING 0x%p: Scroll offset %s\n", this, tmpstr.get()), mPaintData.mScrollOffset);
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledThebesLayer::UseFastPath()
|
||||
{
|
||||
const FrameMetrics& parentMetrics = GetParent()->GetFrameMetrics();
|
||||
bool multipleTransactionsNeeded = gfxPrefs::UseProgressiveTilePainting()
|
||||
|| gfxPrefs::UseLowPrecisionBuffer()
|
||||
|| !parentMetrics.mCriticalDisplayPort.IsEmpty();
|
||||
bool isFixed = GetIsFixedPosition() || GetParent()->GetIsFixedPosition();
|
||||
return !multipleTransactionsNeeded || isFixed || parentMetrics.mDisplayPort.IsEmpty();
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::EndPaint(bool aFinish)
|
||||
{
|
||||
@ -222,8 +233,8 @@ ClientTiledThebesLayer::RenderLayer()
|
||||
TILING_PRLOG_OBJ(("TILING 0x%p: Initial visible region %s\n", this, tmpstr.get()), mVisibleRegion);
|
||||
TILING_PRLOG_OBJ(("TILING 0x%p: Initial valid region %s\n", this, tmpstr.get()), mValidRegion);
|
||||
|
||||
nsIntRegion invalidRegion = mVisibleRegion;
|
||||
invalidRegion.Sub(invalidRegion, mValidRegion);
|
||||
nsIntRegion invalidRegion;
|
||||
invalidRegion.Sub(mVisibleRegion, mValidRegion);
|
||||
if (invalidRegion.IsEmpty()) {
|
||||
EndPaint(true);
|
||||
return;
|
||||
@ -234,17 +245,8 @@ ClientTiledThebesLayer::RenderLayer()
|
||||
ToClientLayer(GetMaskLayer())->RenderLayer();
|
||||
}
|
||||
|
||||
bool isFixed = GetIsFixedPosition() || GetParent()->GetIsFixedPosition();
|
||||
|
||||
// Fast path for no progressive updates, no low-precision updates and no
|
||||
// critical display-port set, or no display-port set, or this is a fixed
|
||||
// position layer/contained in a fixed position layer
|
||||
const FrameMetrics& parentMetrics = GetParent()->GetFrameMetrics();
|
||||
if ((!gfxPrefs::UseProgressiveTilePainting() &&
|
||||
!gfxPrefs::UseLowPrecisionBuffer() &&
|
||||
parentMetrics.mCriticalDisplayPort.IsEmpty()) ||
|
||||
parentMetrics.mDisplayPort.IsEmpty() ||
|
||||
isFixed) {
|
||||
// In some cases we can take a fast path and just be done with it.
|
||||
if (UseFastPath()) {
|
||||
mValidRegion = mVisibleRegion;
|
||||
|
||||
NS_ASSERTION(!ClientManager()->IsRepeatTransaction(), "Didn't paint our mask layer");
|
||||
|
@ -80,6 +80,12 @@ private:
|
||||
*/
|
||||
void BeginPaint();
|
||||
|
||||
/**
|
||||
* Determine if we can use a fast path to just do a single high-precision,
|
||||
* non-progressive paint.
|
||||
*/
|
||||
bool UseFastPath();
|
||||
|
||||
/**
|
||||
* When a paint ends, updates any data necessary to persist until the next
|
||||
* paint. If aFinish is true, this will cause the paint to be marked as
|
||||
|
Loading…
Reference in New Issue
Block a user