Bug 843618 - When reading back the results of clayer ompositing to draw them to a non-deefault rendering context, don't depend on the size of the rendering context's target surface --- it could be anything. r=jrmuizel, a=lsblakk

This commit is contained in:
Robert O'Callahan 2013-03-21 00:22:58 +13:00
Родитель 4612e26fd0
Коммит 6ce29e1418
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -1156,9 +1156,10 @@ BasicShadowLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
} else if (mShadowTarget) {
if (mWidget) {
if (CompositorChild* remoteRenderer = mWidget->GetRemoteRenderer()) {
nsRefPtr<gfxASurface> target = mShadowTarget->OriginalSurface();
nsIntRect bounds;
mWidget->GetBounds(bounds);
SurfaceDescriptor inSnapshot, snapshot;
if (AllocBuffer(target->GetSize(), target->GetContentType(),
if (AllocBuffer(bounds.Size(), gfxASurface::CONTENT_COLOR_ALPHA,
&inSnapshot) &&
// The compositor will usually reuse |snapshot| and return
// it through |outSnapshot|, but if it doesn't, it's
@ -1167,8 +1168,6 @@ BasicShadowLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
AutoOpenSurface opener(OPEN_READ_ONLY, snapshot);
gfxASurface* source = opener.Get();
gfxContextAutoSaveRestore restore(mShadowTarget);
mShadowTarget->SetOperator(gfxContext::OPERATOR_OVER);
mShadowTarget->DrawSurface(source, source->GetSize());
}
if (IsSurfaceDescriptorValid(snapshot)) {