Bug 1042052 - Add TextureClient::CreateSimilar and have component alpha buffer be of the same type. r=sotaro

This commit is contained in:
Nicolas Silva
2014-07-25 11:24:46 +02:00
parent b669c155bc
commit f8d771a884
16 changed files with 169 additions and 55 deletions

View File

@@ -55,6 +55,21 @@ GrallocTextureClientOGL::~GrallocTextureClientOGL()
}
}
TemporaryRef<TextureClient>
GrallocTextureClientOGL::CreateSimilar(TextureFlags aFlags,
TextureAllocationFlags aAllocFlags) const
{
RefPtr<TextureClient> tex = new GrallocTextureClientOGL(
mAllocator, mFormat, mBackend, mFlags | aFlags
);
if (!tex->AllocateForSurface(mSize, aAllocFlags)) {
return nullptr;
}
return tex;
}
void
GrallocTextureClientOGL::InitWith(MaybeMagicGrallocBufferHandle aHandle, gfx::IntSize aSize)
{