Bug 979350 - fixup rebase failures
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 12 May 2014 12:51:08 +1200
changeset 182539 d64fb8e9ef3f76aea2e7f9f57187213334bf9ad7
parent 182538 02eb695c8640d0526df1c63ed50ca79a59118431
child 182540 0276c57cffba7814152b8f0e65ddf4b8f744620d
push id26764
push usercbook@mozilla.com
push dateMon, 12 May 2014 11:35:17 +0000
treeherdermozilla-central@a64ed5aba131 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs979350
milestone32.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 979350 - fixup rebase failures
gfx/layers/basic/BasicThebesLayer.cpp
--- a/gfx/layers/basic/BasicThebesLayer.cpp
+++ b/gfx/layers/basic/BasicThebesLayer.cpp
@@ -122,48 +122,38 @@ BasicThebesLayer::PaintThebes(gfxContext
     maskTransform = mask.GetTransform();
   }
 
   if (!IsHidden() && !clipExtents.IsEmpty()) {
     mContentClient->DrawTo(this, aContext->GetDrawTarget(), opacity,
                            effectiveOperator,
                            maskSurface, &maskTransform);
   }
-
-  for (uint32_t i = 0; i < readbackUpdates.Length(); ++i) {
-    ReadbackProcessor::Update& update = readbackUpdates[i];
-    nsIntPoint offset = update.mLayer->GetBackgroundLayerOffset();
-    nsRefPtr<gfxContext> ctx =
-      update.mLayer->GetSink()->BeginUpdate(update.mUpdateRect + offset,
-                                            update.mSequenceCounter);
-    if (ctx) {
-      NS_ASSERTION(opacity == 1.0, "Should only read back opaque layers");
-      ctx->Translate(gfxPoint(offset.x, offset.y));
-      mContentClient->DrawTo(this, ctx->GetDrawTarget(), 1.0,
-                             CompositionOpForOp(ctx->CurrentOperator()),
-                             maskSurface, &maskTransform);
-      update.mLayer->GetSink()->EndUpdate(ctx, update.mUpdateRect + offset);
-    }
-  }
 }
 
 void
 BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
-                           void* aCallbackData)
+                           void* aCallbackData,
+                           ReadbackProcessor* aReadback)
 {
   if (!mContentClient) {
     // This client will have a null Forwarder, which means it will not have
     // a ContentHost on the other side.
     mContentClient = new ContentClientBasic();
   }
 
   if (!BasicManager()->IsRetained()) {
     return;
   }
 
+  nsTArray<ReadbackProcessor::Update> readbackUpdates;
+  if (aReadback && UsedForReadback()) {
+    aReadback->GetThebesLayerUpdates(this, &readbackUpdates);
+  }
+
   uint32_t flags = 0;
 #ifndef MOZ_WIDGET_ANDROID
   if (BasicManager()->CompositorMightResample()) {
     flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
   }
   if (!(flags & RotatedContentBuffer::PAINT_WILL_RESAMPLE)) {
     if (MayResample()) {
       flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;