Remove PaintState::mDidSelfCopy. (bug 1409871 part 9, r=nical)

Miscellaneous cleanup, PaintState doesn't need to know this as no one uses
this information outside of the content client classes.

MozReview-Commit-ID: 6K8LxEPvp4V

--HG--
extra : rebase_source : 8bef61a47f423dd83ac9ea39b84f064bd7681e0c
This commit is contained in:
Ryan Hunt 2017-10-12 17:24:50 -04:00
parent cb31baf93b
commit f84be40adb
7 changed files with 9 additions and 34 deletions

View File

@ -747,7 +747,6 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
MOZ_ASSERT(mDTBufferOnWhite && mDTBufferOnWhite->IsValid());
mDTBufferOnWhite->CopyRect(srcRect, dest);
}
result.mDidSelfCopy = true;
mDidSelfCopy = true;
// Don't set destBuffer; we special-case self-copies, and
// just did the necessary work above.
@ -784,13 +783,12 @@ RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
// Buffer unrotate moves all the pixels, note that
// we self copied for SyncBackToFrontBuffer
result.mDidSelfCopy = true;
mDidSelfCopy = true;
mBufferRect = destBufferRect;
mBufferRotation = IntPoint(0, 0);
}
if (!result.mDidSelfCopy) {
if (!mDidSelfCopy) {
destBufferRect = ComputeBufferRect(neededRegion.GetBounds());
CreateBuffer(result.mContentType, destBufferRect, bufferFlags,
&destDTBuffer, &destDTBufferOnWhite);

View File

@ -339,8 +339,7 @@ public:
* by RotatedContentBuffer and must be redrawn on the screen.
* mRegionToInvalidate is set when the buffer has changed from
* opaque to transparent or vice versa, since the details of rendering can
* depend on the buffer type. mDidSelfCopy is true if we kept our buffer
* but used MovePixels() to shift its content.
* depend on the buffer type.
*/
struct PaintState {
PaintState()
@ -349,7 +348,6 @@ public:
, mMode(SurfaceMode::SURFACE_NONE)
, mClip(DrawRegionClip::NONE)
, mContentType(gfxContentType::SENTINEL)
, mDidSelfCopy(false)
{}
nsIntRegion mRegionToDraw;
@ -357,7 +355,6 @@ public:
SurfaceMode mMode;
DrawRegionClip mClip;
ContentType mContentType;
bool mDidSelfCopy;
};
enum {

View File

@ -182,7 +182,6 @@ BasicPaintedLayer::Validate(LayerManager::DrawPaintedLayerCallback aCallback,
PaintBuffer(ctx,
state.mRegionToDraw, state.mRegionToDraw, state.mRegionToInvalidate,
state.mDidSelfCopy,
state.mClip,
aCallback, aCallbackData);
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) PaintThebes", this));

View File

@ -103,7 +103,6 @@ protected:
const nsIntRegion& aRegionToDraw,
const nsIntRegion& aExtendedRegionToDraw,
const nsIntRegion& aRegionToInvalidate,
bool aDidSelfCopy,
DrawRegionClip aClip,
LayerManager::DrawPaintedLayerCallback aCallback,
void* aCallbackData)

View File

@ -90,8 +90,7 @@ ClientPaintedLayer::UpdateContentClient(PaintState& aState)
// so deleting this Hold for whatever reason will break things.
ClientManager()->Hold(this);
contentClientRemote->Updated(aState.mRegionToDraw,
mVisibleRegion.ToUnknownRegion(),
aState.mDidSelfCopy);
mVisibleRegion.ToUnknownRegion());
}
bool

View File

@ -415,11 +415,10 @@ ContentClientRemoteBuffer::CreateBuffer(ContentType aType,
nsIntRegion
ContentClientRemoteBuffer::GetUpdatedRegion(const nsIntRegion& aRegionToDraw,
const nsIntRegion& aVisibleRegion,
bool aDidSelfCopy)
const nsIntRegion& aVisibleRegion)
{
nsIntRegion updatedRegion;
if (mIsNewBuffer || aDidSelfCopy) {
if (mIsNewBuffer || mDidSelfCopy) {
// A buffer reallocation clears both buffers. The front buffer has all the
// content by now, but the back buffer is still clear. Here, in effect, we
// are saying to copy all of the pixels of the front buffer to the back.
@ -442,12 +441,10 @@ ContentClientRemoteBuffer::GetUpdatedRegion(const nsIntRegion& aRegionToDraw,
void
ContentClientRemoteBuffer::Updated(const nsIntRegion& aRegionToDraw,
const nsIntRegion& aVisibleRegion,
bool aDidSelfCopy)
const nsIntRegion& aVisibleRegion)
{
nsIntRegion updatedRegion = GetUpdatedRegion(aRegionToDraw,
aVisibleRegion,
aDidSelfCopy);
aVisibleRegion);
MOZ_ASSERT(mTextureClient);
if (mTextureClientOnWhite) {
@ -549,14 +546,6 @@ ContentClientDoubleBuffered::DestroyFrontBuffer()
}
}
void
ContentClientDoubleBuffered::Updated(const nsIntRegion& aRegionToDraw,
const nsIntRegion& aVisibleRegion,
bool aDidSelfCopy)
{
ContentClientRemoteBuffer::Updated(aRegionToDraw, aVisibleRegion, aDidSelfCopy);
}
void
ContentClientDoubleBuffered::SwapBuffers(const nsIntRegion& aFrontUpdatedRegion)
{

View File

@ -239,8 +239,7 @@ public:
virtual void EndPaint(nsTArray<ReadbackProcessor::Update>* aReadbackUpdates = nullptr) override;
virtual void Updated(const nsIntRegion& aRegionToDraw,
const nsIntRegion& aVisibleRegion,
bool aDidSelfCopy);
const nsIntRegion& aVisibleRegion);
// Expose these protected methods from the superclass.
virtual const gfx::IntRect& BufferRect() const
@ -264,8 +263,7 @@ protected:
void DestroyBuffers();
virtual nsIntRegion GetUpdatedRegion(const nsIntRegion& aRegionToDraw,
const nsIntRegion& aVisibleRegion,
bool aDidSelfCopy);
const nsIntRegion& aVisibleRegion);
void BuildTextureClients(gfx::SurfaceFormat aFormat,
const gfx::IntRect& aRect,
@ -330,10 +328,6 @@ public:
mFrontBuffer = Nothing();
}
virtual void Updated(const nsIntRegion& aRegionToDraw,
const nsIntRegion& aVisibleRegion,
bool aDidSelfCopy) override;
virtual void SwapBuffers(const nsIntRegion& aFrontUpdatedRegion) override;
virtual void BeginPaint() override;