Bug 1290081 - Make canvas layer transactions asynchronous. r=sotaro

This commit is contained in:
Nicolas Silva 2016-07-29 20:19:23 +02:00
Родитель 400d747599
Коммит 63733308d3
2 изменённых файлов: 3 добавлений и 8 удалений

Просмотреть файл

@ -98,8 +98,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
mBufferProviderTexture = nullptr;
AutoRemoveTexture autoRemove(this);
if (mBackBuffer &&
(mBackBuffer->IsImmutable() || mBackBuffer->GetSize() != aSize)) {
if (mBackBuffer && (mBackBuffer->IsReadLocked() || mBackBuffer->GetSize() != aSize)) {
autoRemove.mTexture = mBackBuffer;
mBackBuffer = nullptr;
}
@ -122,6 +121,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
NS_WARNING("Failed to allocate the TextureClient");
return;
}
mBackBuffer->EnableReadLock();
MOZ_ASSERT(mBackBuffer->CanExposeDrawTarget());
bufferCreated = true;

Просмотреть файл

@ -90,16 +90,11 @@ ClientCanvasLayer::RenderLayer()
RenderMaskLayers(this);
if (!mCanvasClient) {
TextureFlags flags = TextureFlags::IMMEDIATE_UPLOAD;
TextureFlags flags = TextureFlags::DEFAULT;
if (mOriginPos == gl::OriginPos::BottomLeft) {
flags |= TextureFlags::ORIGIN_BOTTOM_LEFT;
}
if (!mGLContext) {
// We don't support locking for buffer surfaces currently
flags |= TextureFlags::IMMEDIATE_UPLOAD;
}
if (!mIsAlphaPremultiplied) {
flags |= TextureFlags::NON_PREMULTIPLIED;
}