зеркало из https://github.com/mozilla/gecko-dev.git
Bug 801176 - part7-v1: Don't remove TextureClient until the frame update is done. r=roc
--- gfx/layers/client/CanvasClient.cpp | 10 ++++++++-- gfx/layers/client/CanvasClient.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-)
This commit is contained in:
Родитель
8f02812e74
Коммит
34112c9d96
|
@ -87,7 +87,6 @@ CanvasClient2D::UpdateAsync(AsyncCanvasRenderer* aRenderer)
|
|||
void
|
||||
CanvasClient2D::UpdateRenderer(gfx::IntSize aSize, Renderer& aRenderer)
|
||||
{
|
||||
AutoRemoveTexture autoRemove(this);
|
||||
ClientCanvasLayer* layer = nullptr;
|
||||
AsyncCanvasRenderer* asyncRenderer = nullptr;
|
||||
if (aRenderer.constructed<ClientCanvasLayer*>()) {
|
||||
|
@ -98,7 +97,7 @@ CanvasClient2D::UpdateRenderer(gfx::IntSize aSize, Renderer& aRenderer)
|
|||
|
||||
if (mBuffer &&
|
||||
(mBuffer->IsImmutable() || mBuffer->GetSize() != aSize)) {
|
||||
autoRemove.mTexture = mBuffer;
|
||||
mPrevBuffer = mBuffer;
|
||||
mBuffer = nullptr;
|
||||
}
|
||||
|
||||
|
@ -155,6 +154,13 @@ CanvasClient2D::UpdateRenderer(gfx::IntSize aSize, Renderer& aRenderer)
|
|||
void
|
||||
CanvasClient2D::Updated()
|
||||
{
|
||||
AutoRemoveTexture autoRemove(this);
|
||||
|
||||
if (mPrevBuffer) {
|
||||
autoRemove.mTexture = mPrevBuffer;
|
||||
mPrevBuffer = nullptr;
|
||||
}
|
||||
|
||||
if (mBufferCreated && !AddTextureClient(mBuffer)) {
|
||||
mBuffer = nullptr;
|
||||
return;
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
CanvasClient2D(CompositableForwarder* aLayerForwarder,
|
||||
TextureFlags aFlags)
|
||||
: CanvasClient(aLayerForwarder, aFlags),
|
||||
mPrevBuffer(nullptr),
|
||||
mBufferCreated(false),
|
||||
mUpdated(false)
|
||||
{
|
||||
|
@ -128,6 +129,7 @@ private:
|
|||
TextureFlags aFlags,
|
||||
ClientCanvasLayer* aLayer);
|
||||
|
||||
RefPtr<TextureClient> mPrevBuffer;
|
||||
RefPtr<TextureClient> mBuffer;
|
||||
bool mBufferCreated;
|
||||
bool mUpdated;
|
||||
|
|
Загрузка…
Ссылка в новой задаче