зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1444447 - Correctly copy drawn surfaces to the full window render target in BasicCompositor r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D27969 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
fee1df6e9b
Коммит
b99475265f
|
@ -1060,21 +1060,21 @@ void BasicCompositor::TryToEndRemoteDrawing(bool aForceToEnd) {
|
|||
if (mRenderTarget->mDrawTarget != mDrawTarget || mFullWindowRenderTarget) {
|
||||
RefPtr<SourceSurface> source;
|
||||
|
||||
// Note: Most platforms require us to buffer drawing to the widget
|
||||
// surface. That's why we don't draw to mDrawTarget directly.
|
||||
IntPoint srcOffset = mTarget ? mTargetBounds.TopLeft() : IntPoint();
|
||||
IntPoint dstOffset = mRenderTarget->GetOrigin();
|
||||
|
||||
if (mRenderTarget->mDrawTarget != mDrawTarget) {
|
||||
source = mWidget->EndBackBufferDrawing();
|
||||
|
||||
// Note: Most platforms require us to buffer drawing to the widget
|
||||
// surface. That's why we don't draw to mDrawTarget directly.
|
||||
nsIntPoint offset = mTarget ? mTargetBounds.TopLeft() : nsIntPoint();
|
||||
|
||||
// The source DrawTarget is clipped to the invalidation region, so we have
|
||||
// to copy the individual rectangles in the region or else we'll draw
|
||||
// blank pixels.
|
||||
for (auto iter = mInvalidRegion.RectIter(); !iter.Done(); iter.Next()) {
|
||||
const LayoutDeviceIntRect& r = iter.Get();
|
||||
mDrawTarget->CopySurface(source,
|
||||
r.ToUnknownRect() - mRenderTarget->GetOrigin(),
|
||||
r.TopLeft().ToUnknownPoint() - offset);
|
||||
mDrawTarget->CopySurface(source, r.ToUnknownRect() - srcOffset,
|
||||
r.TopLeft().ToUnknownPoint() - dstOffset);
|
||||
}
|
||||
} else {
|
||||
source = mRenderTarget->mDrawTarget->Snapshot();
|
||||
|
@ -1084,7 +1084,8 @@ void BasicCompositor::TryToEndRemoteDrawing(bool aForceToEnd) {
|
|||
for (auto iter = mInvalidRegion.RectIter(); !iter.Done(); iter.Next()) {
|
||||
const LayoutDeviceIntRect& r = iter.Get();
|
||||
mFullWindowRenderTarget->mDrawTarget->CopySurface(
|
||||
source, r.ToUnknownRect(), r.TopLeft().ToUnknownPoint());
|
||||
source, r.ToUnknownRect() - srcOffset,
|
||||
r.TopLeft().ToUnknownPoint() - dstOffset);
|
||||
}
|
||||
|
||||
mFullWindowRenderTarget->mDrawTarget->Flush();
|
||||
|
|
Загрузка…
Ссылка в новой задаче