Bug 1000640 - Use new StreamTextureClient/Host with OMTC. - r=mattwoodrow

This commit is contained in:
Jeff Gilbert
2014-06-04 15:20:26 -07:00
parent b94f099755
commit c1ad500e63
27 changed files with 601 additions and 418 deletions

View File

@@ -84,61 +84,5 @@ SharedTextureClientOGL::IsAllocated() const
return mHandle != 0;
}
StreamTextureClientOGL::StreamTextureClientOGL(TextureFlags aFlags)
: TextureClient(aFlags)
, mIsLocked(false)
{
}
StreamTextureClientOGL::~StreamTextureClientOGL()
{
// the data is owned externally.
}
bool
StreamTextureClientOGL::Lock(OpenMode mode)
{
MOZ_ASSERT(!mIsLocked);
if (!IsValid() || !IsAllocated()) {
return false;
}
mIsLocked = true;
return true;
}
void
StreamTextureClientOGL::Unlock()
{
MOZ_ASSERT(mIsLocked);
mIsLocked = false;
}
bool
StreamTextureClientOGL::ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor)
{
if (!IsAllocated()) {
return false;
}
gfx::SurfaceStreamHandle handle = mStream->GetShareHandle();
aOutDescriptor = SurfaceStreamDescriptor(handle, false);
return true;
}
void
StreamTextureClientOGL::InitWith(gfx::SurfaceStream* aStream)
{
MOZ_ASSERT(!IsAllocated());
mStream = aStream;
mGL = mStream->GLContext();
}
bool
StreamTextureClientOGL::IsAllocated() const
{
return mStream != 0;
}
} // namespace
} // namespace