Add an RAII class to lock and unlock textures. (bug 1222863 part 1, r=nical)
This commit is contained in:
@@ -650,12 +650,11 @@ CairoImage::GetTextureClient(CompositableClient *aClient)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!textureClient->Lock(OpenMode::OPEN_WRITE_ONLY)) {
|
||||
TextureClientAutoLock autoLock(textureClient, OpenMode::OPEN_WRITE_ONLY);
|
||||
if (!autoLock.Succeeded()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TextureClientAutoUnlock autoUnlock(textureClient);
|
||||
|
||||
textureClient->UpdateFromSurface(surface);
|
||||
|
||||
textureClient->SyncWithObject(forwarder->GetSyncObject());
|
||||
|
||||
Reference in New Issue
Block a user