diff --git a/dom/canvas/test/reftest/reftest.list b/dom/canvas/test/reftest/reftest.list index 4f7e78dbb9c6..1e6915cd5501 100644 --- a/dom/canvas/test/reftest/reftest.list +++ b/dom/canvas/test/reftest/reftest.list @@ -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 diff --git a/gfx/gl/GLScreenBuffer.cpp b/gfx/gl/GLScreenBuffer.cpp index 569d3dce5c49..51145adc51d8 100755 --- a/gfx/gl/GLScreenBuffer.cpp +++ b/gfx/gl/GLScreenBuffer.cpp @@ -403,7 +403,18 @@ GLScreenBuffer::Attach(SharedSurface* surf, const gfx::IntSize& size) } else { // Else something changed, so resize: UniquePtr 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 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();