NewTextureSource* BufferTextureHost::GetTextureSources() { MOZ_ASSERT(mLocked, "should never be called while not locked"); if (!MaybeUpload(mPartialUpdate ? &mMaybeUpdatedRegion : nullptr)) { return nullptr; } return mFirstSource; }
bool BufferTextureHost::Lock() { MOZ_ASSERT(!mLocked); if (!MaybeUpload(!mNeedsFullUpdate ? &mMaybeUpdatedRegion : nullptr)) { return false; } mLocked = !!mFirstSource; return mLocked; }
void BufferTextureHost::Updated(const nsIntRegion* aRegion) { ++mUpdateSerial; if (aRegion) { mPartialUpdate = true; mMaybeUpdatedRegion = *aRegion; } else { mPartialUpdate = false; } if (GetFlags() & TEXTURE_IMMEDIATE_UPLOAD) { DebugOnly<bool> result = MaybeUpload(mPartialUpdate ? &mMaybeUpdatedRegion : nullptr); MOZ_ASSERT(result); } }
void BufferTextureHost::Updated(const nsIntRegion* aRegion) { ++mUpdateSerial; if (aRegion) { mPartialUpdate = true; mMaybeUpdatedRegion = *aRegion; } else { mPartialUpdate = false; } if (GetFlags() & TextureFlags::IMMEDIATE_UPLOAD) { DebugOnly<bool> result = MaybeUpload(mPartialUpdate ? &mMaybeUpdatedRegion : nullptr); NS_WARN_IF_FALSE(result, "Failed to upload a texture"); } }
void BufferTextureHost::UpdatedInternal(const nsIntRegion* aRegion) { ++mUpdateSerial; // If the last frame wasn't uploaded yet, and we -don't- have a partial update, // we still need to update the full surface. if (aRegion && !mNeedsFullUpdate) { mMaybeUpdatedRegion.OrWith(*aRegion); } else { mNeedsFullUpdate = true; } if (GetFlags() & TextureFlags::IMMEDIATE_UPLOAD) { DebugOnly<bool> result = MaybeUpload(!mNeedsFullUpdate ? &mMaybeUpdatedRegion : nullptr); NS_WARN_IF_FALSE(result, "Failed to upload a texture"); } }