Bug 1255703 - Use image surfaces for basic compositor on Windows r=mattwoodrow

This commit is contained in:
Sotaro Ikeda
2016-05-12 07:23:11 -07:00
parent ff329b1056
commit b358466ee7
5 changed files with 87 additions and 10 deletions

View File

@@ -174,10 +174,11 @@ BasicCompositor::CreateRenderTargetForWindow(const LayoutDeviceIntRect& aRect, c
IntRect rect = aRect.ToUnknownRect();
if (aBufferMode != BufferMode::BUFFER_NONE) {
RefPtr<DrawTarget> target = mWidget->CreateBackBufferDrawTarget(mDrawTarget, aRect, aClearRect);
RefPtr<DrawTarget> target = mWidget->GetBackBufferDrawTarget(mDrawTarget, aRect, aClearRect);
if (!target) {
return nullptr;
}
MOZ_ASSERT(target != mDrawTarget);
rt = new BasicCompositingRenderTarget(target, rect);
} else {
IntRect windowRect = rect;
@@ -590,7 +591,12 @@ BasicCompositor::EndFrame()
if (mTarget || mRenderTarget->mDrawTarget != mDrawTarget) {
// Note: Most platforms require us to buffer drawing to the widget surface.
// That's why we don't draw to mDrawTarget directly.
RefPtr<SourceSurface> source = mRenderTarget->mDrawTarget->Snapshot();
RefPtr<SourceSurface> source;
if (mRenderTarget->mDrawTarget != mDrawTarget) {
source = mWidget->EndBackBufferDrawing();
} else {
source = mRenderTarget->mDrawTarget->Snapshot();
}
RefPtr<DrawTarget> dest(mTarget ? mTarget : mDrawTarget);
nsIntPoint offset = mTarget ? mTargetBounds.TopLeft() : nsIntPoint();