Bug 995721 patch 1 - Honor the translation on mShadowTarget in ClientLayerManager::MakeSnapshotIfRequired. r=mattwoodrow

This switches from DrawTarget::CopySurface (which ignores the transform)
to DrawSurface (which honors the transform).
This commit is contained in:
L. David Baron 2014-04-14 11:12:00 -07:00
parent b5bb8d4250
commit 8f4c6c0e7e

View File

@ -281,8 +281,9 @@ ClientLayerManager::MakeSnapshotIfRequired()
if (CompositorChild* remoteRenderer = GetRemoteRenderer()) {
nsIntRect bounds;
mWidget->GetBounds(bounds);
IntSize widgetSize = bounds.Size().ToIntSize();
SurfaceDescriptor inSnapshot, snapshot;
if (mForwarder->AllocSurfaceDescriptor(bounds.Size().ToIntSize(),
if (mForwarder->AllocSurfaceDescriptor(widgetSize,
gfxContentType::COLOR_ALPHA,
&inSnapshot) &&
// The compositor will usually reuse |snapshot| and return
@ -290,9 +291,11 @@ ClientLayerManager::MakeSnapshotIfRequired()
// responsible for freeing |snapshot|.
remoteRenderer->SendMakeSnapshot(inSnapshot, &snapshot)) {
RefPtr<DataSourceSurface> surf = GetSurfaceForDescriptor(snapshot);
mShadowTarget->GetDrawTarget()->CopySurface(surf,
IntRect(0, 0, bounds.Size().width, bounds.Size().height),
IntPoint(0, 0));
DrawTarget* dt = mShadowTarget->GetDrawTarget();
Rect widgetRect(Point(0, 0), Size(widgetSize.width, widgetSize.height));
dt->DrawSurface(surf, widgetRect, widgetRect,
DrawSurfaceOptions(),
DrawOptions(1.0f, CompositionOp::OP_OVER));
}
if (IsSurfaceDescriptorValid(snapshot)) {
mForwarder->DestroySharedSurface(&snapshot);