Bug 893301. Rename BufferProviders. r=mattwoodrow

This commit is contained in:
Nicholas Cameron 2013-11-28 10:16:35 +13:00
parent 16c6b58eb5
commit 4d7d27aa4c
3 changed files with 65 additions and 65 deletions

View File

@ -281,14 +281,14 @@ RotatedContentBuffer::GetContextForQuadrantUpdate(const nsIntRect& aBounds,
gfxContentType
RotatedContentBuffer::BufferContentType()
{
if (mBufferProvider) {
return mBufferProvider->GetContentType();
if (mDeprecatedBufferProvider) {
return mDeprecatedBufferProvider->GetContentType();
}
if (mNewBufferProvider || mDTBuffer) {
if (mBufferProvider || mDTBuffer) {
SurfaceFormat format;
if (mNewBufferProvider) {
format = mNewBufferProvider->AsTextureClientDrawTarget()->GetFormat();
if (mBufferProvider) {
format = mBufferProvider->AsTextureClientDrawTarget()->GetFormat();
} else if (mDTBuffer) {
format = mDTBuffer->GetFormat();
}
@ -310,10 +310,10 @@ bool
RotatedContentBuffer::EnsureBuffer()
{
if (!mDTBuffer) {
if (mBufferProvider) {
mDTBuffer = mBufferProvider->LockDrawTarget();
} else if (mNewBufferProvider) {
mDTBuffer = mNewBufferProvider->AsTextureClientDrawTarget()->GetAsDrawTarget();
if (mDeprecatedBufferProvider) {
mDTBuffer = mDeprecatedBufferProvider->LockDrawTarget();
} else if (mBufferProvider) {
mDTBuffer = mBufferProvider->AsTextureClientDrawTarget()->GetAsDrawTarget();
}
}
@ -325,11 +325,11 @@ bool
RotatedContentBuffer::EnsureBufferOnWhite()
{
if (!mDTBufferOnWhite) {
if (mBufferProviderOnWhite) {
mDTBufferOnWhite = mBufferProviderOnWhite->LockDrawTarget();
} else if (mNewBufferProviderOnWhite) {
if (mDeprecatedBufferProviderOnWhite) {
mDTBufferOnWhite = mDeprecatedBufferProviderOnWhite->LockDrawTarget();
} else if (mBufferProviderOnWhite) {
mDTBufferOnWhite =
mNewBufferProviderOnWhite->AsTextureClientDrawTarget()->GetAsDrawTarget();
mBufferProviderOnWhite->AsTextureClientDrawTarget()->GetAsDrawTarget();
}
}
@ -340,13 +340,13 @@ RotatedContentBuffer::EnsureBufferOnWhite()
bool
RotatedContentBuffer::HaveBuffer() const
{
return mDTBuffer || mBufferProvider || mNewBufferProvider;
return mDTBuffer || mDeprecatedBufferProvider || mBufferProvider;
}
bool
RotatedContentBuffer::HaveBufferOnWhite() const
{
return mDTBufferOnWhite || mBufferProviderOnWhite || mNewBufferProviderOnWhite;
return mDTBufferOnWhite || mDeprecatedBufferProviderOnWhite || mBufferProviderOnWhite;
}
static void

View File

@ -158,10 +158,10 @@ public:
};
RotatedContentBuffer(BufferSizePolicy aBufferSizePolicy)
: mBufferProvider(nullptr)
: mDeprecatedBufferProvider(nullptr)
, mDeprecatedBufferProviderOnWhite(nullptr)
, mBufferProvider(nullptr)
, mBufferProviderOnWhite(nullptr)
, mNewBufferProvider(nullptr)
, mNewBufferProviderOnWhite(nullptr)
, mBufferSizePolicy(aBufferSizePolicy)
{
MOZ_COUNT_CTOR(RotatedContentBuffer);
@ -179,10 +179,10 @@ public:
{
mDTBuffer = nullptr;
mDTBufferOnWhite = nullptr;
mDeprecatedBufferProvider = nullptr;
mDeprecatedBufferProviderOnWhite = nullptr;
mBufferProvider = nullptr;
mBufferProviderOnWhite = nullptr;
mNewBufferProvider = nullptr;
mNewBufferProviderOnWhite = nullptr;
mBufferRect.SetEmpty();
}
@ -295,51 +295,51 @@ protected:
* unset the provider when inactive, by calling
* SetBufferProvider(nullptr).
*/
void SetBufferProvider(DeprecatedTextureClient* aClient)
{
// Only this buffer provider can give us a buffer. If we
// already have one, something has gone wrong.
MOZ_ASSERT((!aClient || !mDTBuffer) && !mNewBufferProvider);
mBufferProvider = aClient;
if (!mBufferProvider) {
mDTBuffer = nullptr;
}
}
void SetBufferProviderOnWhite(DeprecatedTextureClient* aClient)
{
// Only this buffer provider can give us a buffer. If we
// already have one, something has gone wrong.
MOZ_ASSERT((!aClient || !mDTBufferOnWhite) && !mNewBufferProviderOnWhite);
mBufferProviderOnWhite = aClient;
if (!mBufferProviderOnWhite) {
mDTBufferOnWhite = nullptr;
}
}
// new texture client versions
void SetNewBufferProvider(TextureClient* aClient)
void SetDeprecatedBufferProvider(DeprecatedTextureClient* aClient)
{
// Only this buffer provider can give us a buffer. If we
// already have one, something has gone wrong.
MOZ_ASSERT((!aClient || !mDTBuffer) && !mBufferProvider);
mNewBufferProvider = aClient;
if (!mNewBufferProvider) {
mDeprecatedBufferProvider = aClient;
if (!mDeprecatedBufferProvider) {
mDTBuffer = nullptr;
}
}
}
void SetNewBufferProviderOnWhite(TextureClient* aClient)
void SetDeprecatedBufferProviderOnWhite(DeprecatedTextureClient* aClient)
{
// Only this buffer provider can give us a buffer. If we
// already have one, something has gone wrong.
MOZ_ASSERT((!aClient || !mDTBufferOnWhite) && !mBufferProviderOnWhite);
mNewBufferProviderOnWhite = aClient;
if (!mNewBufferProviderOnWhite) {
mDeprecatedBufferProviderOnWhite = aClient;
if (!mDeprecatedBufferProviderOnWhite) {
mDTBufferOnWhite = nullptr;
}
}
// new texture client versions
void SetBufferProvider(TextureClient* aClient)
{
// Only this buffer provider can give us a buffer. If we
// already have one, something has gone wrong.
MOZ_ASSERT((!aClient || !mDTBuffer) && !mDeprecatedBufferProvider);
mBufferProvider = aClient;
if (!mBufferProvider) {
mDTBuffer = nullptr;
}
}
void SetBufferProviderOnWhite(TextureClient* aClient)
{
// Only this buffer provider can give us a buffer. If we
// already have one, something has gone wrong.
MOZ_ASSERT((!aClient || !mDTBufferOnWhite) && !mDeprecatedBufferProviderOnWhite);
mBufferProviderOnWhite = aClient;
if (!mBufferProviderOnWhite) {
mDTBufferOnWhite = nullptr;
}
}
@ -379,10 +379,10 @@ protected:
* when we're using surfaces that require explicit map/unmap. Only one
* may be used at a time.
*/
DeprecatedTextureClient* mBufferProvider;
DeprecatedTextureClient* mBufferProviderOnWhite;
TextureClient* mNewBufferProvider;
TextureClient* mNewBufferProviderOnWhite;
DeprecatedTextureClient* mDeprecatedBufferProvider;
DeprecatedTextureClient* mDeprecatedBufferProviderOnWhite;
TextureClient* mBufferProvider;
TextureClient* mBufferProviderOnWhite;
BufferSizePolicy mBufferSizePolicy;
};

View File

@ -128,10 +128,10 @@ ContentClientRemoteBuffer::BeginPaint()
// XXX: So we might not have a DeprecatedTextureClient yet.. because it will
// only be created by CreateBuffer.. which will deliver a locked surface!.
if (mTextureClient) {
SetNewBufferProvider(mTextureClient);
SetBufferProvider(mTextureClient);
}
if (mTextureClientOnWhite) {
SetNewBufferProviderOnWhite(mTextureClientOnWhite);
SetBufferProviderOnWhite(mTextureClientOnWhite);
}
}
@ -140,8 +140,8 @@ ContentClientRemoteBuffer::EndPaint()
{
// XXX: We might still not have a texture client if PaintThebes
// decided we didn't need one yet because the region to draw was empty.
SetNewBufferProvider(nullptr);
SetNewBufferProviderOnWhite(nullptr);
SetBufferProvider(nullptr);
SetBufferProviderOnWhite(nullptr);
for (size_t i = 0; i < mOldTextures.Length(); ++i) {
RemoveTextureClient(mOldTextures[i]);
}
@ -326,10 +326,10 @@ DeprecatedContentClientRemoteBuffer::BeginPaint()
// XXX: So we might not have a DeprecatedTextureClient yet.. because it will
// only be created by CreateBuffer.. which will deliver a locked surface!.
if (mDeprecatedTextureClient) {
SetBufferProvider(mDeprecatedTextureClient);
SetDeprecatedBufferProvider(mDeprecatedTextureClient);
}
if (mDeprecatedTextureClientOnWhite) {
SetBufferProviderOnWhite(mDeprecatedTextureClientOnWhite);
SetDeprecatedBufferProviderOnWhite(mDeprecatedTextureClientOnWhite);
}
}
@ -338,8 +338,8 @@ DeprecatedContentClientRemoteBuffer::EndPaint()
{
// XXX: We might still not have a texture client if PaintThebes
// decided we didn't need one yet because the region to draw was empty.
SetBufferProvider(nullptr);
SetBufferProviderOnWhite(nullptr);
SetDeprecatedBufferProvider(nullptr);
SetDeprecatedBufferProviderOnWhite(nullptr);
mOldTextures.Clear();
if (mDeprecatedTextureClient) {