Bug 927995 - Handle antialias+preserveDrawingBuffer properly. - r=kamidphish

This commit is contained in:
Jeff Gilbert 2015-03-16 12:16:50 -07:00
parent 0f541272f0
commit d8509a9780
2 changed files with 23 additions and 7 deletions

View File

@ -59,11 +59,11 @@ fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersG
== webgl-color-test.html?frame=6&__&________&_______&_____ wrapper.html?colors-no-alpha.png
== webgl-color-test.html?frame=6&aa&________&_______&_____ wrapper.html?colors-no-alpha.png
== webgl-color-test.html?frame=6&__&preserve&_______&_____ wrapper.html?colors-no-alpha.png
fails-if(winWidget&&layersGPUAccelerated&&d2d) == webgl-color-test.html?frame=6&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png
== webgl-color-test.html?frame=6&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png
== webgl-color-test.html?frame=6&__&________&premult&_____ wrapper.html?colors-no-alpha.png
== webgl-color-test.html?frame=6&aa&________&premult&_____ wrapper.html?colors-no-alpha.png
== webgl-color-test.html?frame=6&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png
fails-if(winWidget&&layersGPUAccelerated&&d2d) == webgl-color-test.html?frame=6&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
== webgl-color-test.html?frame=6&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d) == webgl-color-test.html?frame=6&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d) == webgl-color-test.html?frame=6&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d) == webgl-color-test.html?frame=6&__&preserve&_______&alpha wrapper.html?colors-non-premult.png
@ -93,11 +93,11 @@ fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersG
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&_______&_____ wrapper.html?colors-no-alpha.png
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&_______&_____ wrapper.html?colors-no-alpha.png
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&_______&_____ wrapper.html?colors-no-alpha.png
fails-if(winWidget&&layersGPUAccelerated&&d2d) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&_______&_____ wrapper.html?colors-no-alpha.png
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&premult&_____ wrapper.html?colors-no-alpha.png
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&premult&_____ wrapper.html?colors-no-alpha.png
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&premult&_____ wrapper.html?colors-no-alpha.png
random-if(winWidget&&layersGPUAccelerated&&d2d) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&preserve&premult&_____ wrapper.html?colors-no-alpha.png
fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&aa&________&_______&alpha wrapper.html?colors-non-premult.png
fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d) pref(webgl.force-layers-readback,true) == webgl-color-test.html?frame=6&readback&__&preserve&_______&alpha wrapper.html?colors-non-premult.png

View File

@ -403,7 +403,18 @@ GLScreenBuffer::Attach(SharedSurface* surf, const gfx::IntSize& size)
} else {
// Else something changed, so resize:
UniquePtr<DrawBuffer> draw;
bool drawOk = CreateDraw(size, &draw); // Can be null.
bool drawOk = true;
/* Don't change out the draw buffer unless we resize. In the
* preserveDrawingBuffer:true case, prior contents of the buffer must
* be retained. If we're using a draw buffer, it's an MSAA buffer, so
* even if we copy the previous frame into the (single-sampled) read
* buffer, if we need to re-resolve from draw to read (as triggered by
* drawing), we'll need the old MSAA content to still be in the draw
* buffer.
*/
if (!mDraw || size != Size())
drawOk = CreateDraw(size, &draw); // Can be null.
UniquePtr<ReadBuffer> read = CreateRead(surf);
bool readOk = !!read;
@ -414,7 +425,9 @@ GLScreenBuffer::Attach(SharedSurface* surf, const gfx::IntSize& size)
return false;
}
mDraw = Move(draw);
if (draw)
mDraw = Move(draw);
mRead = Move(read);
}
@ -427,6 +440,8 @@ GLScreenBuffer::Attach(SharedSurface* surf, const gfx::IntSize& size)
mRead->SetReadBuffer(mUserReadBufferMode);
}
RequireBlit();
return true;
}
@ -450,7 +465,8 @@ GLScreenBuffer::Swap(const gfx::IntSize& size)
if (ShouldPreserveBuffer() &&
mFront &&
mBack)
mBack &&
!mDraw)
{
auto src = mFront->Surf();
auto dest = mBack->Surf();