Backed out changeset 940f2c9adec7 (bug 1409871)

This commit is contained in:
Sebastian Hengst 2017-10-23 23:43:58 +02:00
Родитель 7e404cb4ff
Коммит 1bf364d760
2 изменённых файлов: 1 добавлений и 104 удалений

Просмотреть файл

@ -347,78 +347,6 @@ RotatedBuffer::BorrowDrawTargetForQuadrantUpdate(const IntRect& aBounds,
return mLoanedDrawTarget; return mLoanedDrawTarget;
} }
bool
RemoteRotatedBuffer::Lock(OpenMode aMode)
{
MOZ_ASSERT(!mTarget);
MOZ_ASSERT(!mTargetOnWhite);
bool locked = mClient->Lock(aMode) &&
(!mClientOnWhite || mClientOnWhite->Lock(aMode));
if (!locked) {
Unlock();
return false;
}
mTarget = mClient->BorrowDrawTarget();
if (!mTarget || !mTarget->IsValid()) {
gfxCriticalNote << "Invalid draw target " << hexa(mTarget)
<< "in RemoteRotatedBuffer::Lock";
Unlock();
return false;
}
if (mClientOnWhite) {
mTargetOnWhite = mClientOnWhite->BorrowDrawTarget();
if (!mTargetOnWhite || !mTargetOnWhite->IsValid()) {
gfxCriticalNote << "Invalid draw target(s) " << hexa(mTarget)
<< " and " << hexa(mTargetOnWhite)
<< "in RemoteRotatedBuffer::Lock";
Unlock();
return false;
}
}
return true;
}
void
RemoteRotatedBuffer::Unlock()
{
mTarget = nullptr;
mTargetOnWhite = nullptr;
if (mClient->IsLocked()) {
mClient->Unlock();
}
if (mClientOnWhite && mClientOnWhite->IsLocked()) {
mClientOnWhite->Unlock();
}
}
already_AddRefed<gfx::SourceSurface>
RemoteRotatedBuffer::GetSourceSurface(ContextSource aSource) const
{
if (aSource == ContextSource::BUFFER_BLACK) {
return mTarget->Snapshot();
} else {
MOZ_ASSERT(aSource == ContextSource::BUFFER_WHITE);
return mTargetOnWhite->Snapshot();
}
}
gfx::DrawTarget*
RemoteRotatedBuffer::GetDTBuffer() const
{
return mTarget;
}
gfx::DrawTarget*
RemoteRotatedBuffer::GetDTBufferOnWhite() const
{
return mTargetOnWhite;
}
already_AddRefed<SourceSurface> already_AddRefed<SourceSurface>
SourceRotatedBuffer::GetSourceSurface(ContextSource aSource) const SourceRotatedBuffer::GetSourceSurface(ContextSource aSource) const
{ {

Просмотреть файл

@ -12,7 +12,6 @@
#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed
#include "mozilla/gfx/2D.h" // for DrawTarget, etc #include "mozilla/gfx/2D.h" // for DrawTarget, etc
#include "mozilla/gfx/MatrixFwd.h" // for Matrix #include "mozilla/gfx/MatrixFwd.h" // for Matrix
#include "mozilla/layers/TextureClient.h" // for TextureClient
#include "mozilla/mozalloc.h" // for operator delete #include "mozilla/mozalloc.h" // for operator delete
#include "nsCOMPtr.h" // for already_AddRefed #include "nsCOMPtr.h" // for already_AddRefed
#include "nsDebug.h" // for NS_RUNTIMEABORT #include "nsDebug.h" // for NS_RUNTIMEABORT
@ -27,6 +26,7 @@ class CapturedPaintState;
typedef bool (*PrepDrawTargetForPaintingCallback)(CapturedPaintState*); typedef bool (*PrepDrawTargetForPaintingCallback)(CapturedPaintState*);
class TextureClient;
class PaintedLayer; class PaintedLayer;
// Mixin class for classes which need logic for loaning out a draw target. // Mixin class for classes which need logic for loaning out a draw target.
@ -200,37 +200,6 @@ protected:
bool mDidSelfCopy; bool mDidSelfCopy;
}; };
class RemoteRotatedBuffer : public RotatedBuffer
{
public:
RemoteRotatedBuffer(TextureClient* aClient, TextureClient* aClientOnWhite,
const gfx::IntRect& aBufferRect,
const gfx::IntPoint& aBufferRotation)
: RotatedBuffer(aBufferRect, aBufferRotation)
, mClient(aClient)
, mClientOnWhite(aClientOnWhite)
{ }
bool Lock(OpenMode aMode);
void Unlock();
virtual bool HaveBuffer() const override { return !!mClient; }
virtual bool HaveBufferOnWhite() const override { return !!mClientOnWhite; }
virtual already_AddRefed<gfx::SourceSurface> GetSourceSurface(ContextSource aSource) const override;
protected:
virtual gfx::DrawTarget* GetDTBuffer() const override;
virtual gfx::DrawTarget* GetDTBufferOnWhite() const override;
private:
RefPtr<TextureClient> mClient;
RefPtr<TextureClient> mClientOnWhite;
RefPtr<gfx::DrawTarget> mTarget;
RefPtr<gfx::DrawTarget> mTargetOnWhite;
};
class SourceRotatedBuffer : public RotatedBuffer class SourceRotatedBuffer : public RotatedBuffer
{ {
public: public: