mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Fix PrepareDrawTargetForPainting (bug 1409871 part 16, r=dvander)
CapturedPaintState::mTarget is actually a dual draw target to the black and white draw targets, so this code will have the white draw target cleared black and then white. This isn't incorrect, it's just wasteful. MozReview-Commit-ID: ItgiSmegPK6 --HG-- extra : rebase_source : 9c3c88f463087a75383f1940ddeef6bb68ec35c4
This commit is contained in:
parent
eba630e380
commit
7f1dd327e3
@ -30,7 +30,7 @@ struct MOZ_STACK_CLASS AutoCapturedPaintSetup
|
||||
{
|
||||
AutoCapturedPaintSetup(CapturedPaintState* aState, CompositorBridgeChild* aBridge)
|
||||
: mState(aState)
|
||||
, mTarget(aState->mTarget)
|
||||
, mTarget(aState->mTargetDual)
|
||||
, mRestorePermitsSubpixelAA(mTarget->GetPermitSubpixelAA())
|
||||
, mOldTransform(mTarget->GetTransform())
|
||||
, mBridge(aBridge)
|
||||
@ -186,7 +186,7 @@ PaintThread::AsyncPaintContents(CompositorBridgeChild* aBridge,
|
||||
MOZ_ASSERT(IsOnPaintThread());
|
||||
MOZ_ASSERT(aState);
|
||||
|
||||
DrawTarget* target = aState->mTarget;
|
||||
DrawTarget* target = aState->mTargetDual;
|
||||
DrawTargetCapture* capture = aState->mCapture;
|
||||
|
||||
AutoCapturedPaintSetup setup(aState, aBridge);
|
||||
|
@ -28,12 +28,14 @@ class CapturedPaintState {
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CapturedPaintState)
|
||||
public:
|
||||
CapturedPaintState(nsIntRegion& aRegionToDraw,
|
||||
gfx::DrawTarget* aTargetDual,
|
||||
gfx::DrawTarget* aTarget,
|
||||
gfx::DrawTarget* aTargetOnWhite,
|
||||
const gfx::Matrix& aTargetTransform,
|
||||
SurfaceMode aSurfaceMode,
|
||||
gfxContentType aContentType)
|
||||
: mRegionToDraw(aRegionToDraw)
|
||||
, mTargetDual(aTargetDual)
|
||||
, mTarget(aTarget)
|
||||
, mTargetOnWhite(aTargetOnWhite)
|
||||
, mTargetTransform(aTargetTransform)
|
||||
@ -45,6 +47,7 @@ public:
|
||||
RefPtr<TextureClient> mTextureClient;
|
||||
RefPtr<TextureClient> mTextureClientOnWhite;
|
||||
RefPtr<gfx::DrawTargetCapture> mCapture;
|
||||
RefPtr<gfx::DrawTarget> mTargetDual;
|
||||
RefPtr<gfx::DrawTarget> mTarget;
|
||||
RefPtr<gfx::DrawTarget> mTargetOnWhite;
|
||||
gfx::Matrix mTargetTransform;
|
||||
|
@ -224,7 +224,7 @@ ClientPaintedLayer::PaintOffMainThread()
|
||||
while (RefPtr<CapturedPaintState> captureState =
|
||||
mContentClient->BorrowDrawTargetForRecording(state, &iter))
|
||||
{
|
||||
DrawTarget* target = captureState->mTarget;
|
||||
DrawTarget* target = captureState->mTargetDual;
|
||||
if (!target || !target->IsValid()) {
|
||||
if (target) {
|
||||
mContentClient->ReturnDrawTargetToBuffer(target);
|
||||
|
@ -253,7 +253,7 @@ ContentClient::BorrowDrawTargetForPainting(ContentClient::PaintState& aPaintStat
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return capturedState->mTarget;
|
||||
return capturedState->mTargetDual;
|
||||
}
|
||||
|
||||
RefPtr<CapturedPaintState>
|
||||
@ -282,6 +282,7 @@ ContentClient::BorrowDrawTargetForRecording(ContentClient::PaintState& aPaintSta
|
||||
RefPtr<CapturedPaintState> state =
|
||||
new CapturedPaintState(regionToDraw,
|
||||
result,
|
||||
mBuffer->GetDTBuffer(),
|
||||
mBuffer->GetDTBufferOnWhite(),
|
||||
transform,
|
||||
aPaintState.mMode,
|
||||
|
Loading…
Reference in New Issue
Block a user