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
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 21 Mar 2013 00:22:58 +1300
changeset 125608 f9c27df9eeb6e4b95057a15df10cc5a81e2c29c2
parent 125607 fc48d16f075aff743756cf70cb1756375505d96e
child 125609 1ebe2c99c1e43f6087e61a5fecd6c2d0a9b0229a
push id24461
push useremorley@mozilla.com
push dateThu, 21 Mar 2013 11:51:51 +0000
treeherdermozilla-central@a73a2b5c423b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs843618
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
gfx/layers/basic/BasicLayerManager.cpp
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -1148,29 +1148,28 @@ BasicShadowLayerManager::EndTransaction(
     mRepeatTransaction = false;
     mIsRepeatTransaction = true;
     BasicLayerManager::BeginTransaction();
     BasicShadowLayerManager::EndTransaction(aCallback, aCallbackData, aFlags);
     mIsRepeatTransaction = false;
   } 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
             // responsible for freeing |snapshot|.
             remoteRenderer->SendMakeSnapshot(inSnapshot, &snapshot)) {
           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)) {
           ShadowLayerForwarder::DestroySharedSurface(&snapshot);
         }
       }
     }
     mShadowTarget = nullptr;