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

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

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