Verified Commit 0b96dace authored by Bob Owen's avatar Bob Owen Committed by ma1
Browse files

Bug 2045767 - a=dmeehan DONTBUILD

parent 7386233a
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -4863,14 +4863,20 @@ bool DrawTargetWebgl::ReadIntoSkia() {
    } else {
      // If there's no existing snapshot and we can successfully map the Skia
      // target for reading, then try to read into that.
      bool readInto = false;
      if (!mSnapshot && mSkia->LockBits(&data, &size, &stride, &format)) {
        (void)ReadInto(data, stride);
        if (size == GetSize()) {
          readInto = ReadInto(data, stride);
        }
        mSkia->ReleaseBits(data);
      } else if (RefPtr<SourceSurface> snapshot = Snapshot()) {
      }
      if (!readInto) {
        if (RefPtr<SourceSurface> snapshot = Snapshot()) {
          // Otherwise, fall back to getting a snapshot from WebGL if available
          // and then copying that to Skia.
          mSkia->CopySurface(snapshot, GetRect(), IntPoint(0, 0));
        }
      }
      didReadback = true;
    }
  }