From ee1f87921bb98964d2c82d8c7c4cf64ba3834b52 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Fri, 10 Apr 2015 11:12:51 +0200 Subject: [PATCH] Backed out changeset 1610ee9ba5d8 (bug 1151821) for m1 test failures --- gfx/2d/DrawTargetD2D1.cpp | 53 --------------------------------------- gfx/2d/DrawTargetD2D1.h | 2 -- 2 files changed, 55 deletions(-) diff --git a/gfx/2d/DrawTargetD2D1.cpp b/gfx/2d/DrawTargetD2D1.cpp index b47ac5c1b1e0..a2c9b291a1b9 100644 --- a/gfx/2d/DrawTargetD2D1.cpp +++ b/gfx/2d/DrawTargetD2D1.cpp @@ -951,40 +951,7 @@ DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern) if (patternSupported) { if (D2DSupportsCompositeMode(aOp)) { - D2D1_RECT_F rect; - bool isAligned; - RefPtr tmpBitmap; - bool clipIsComplex = mPushedClips.size() && !GetDeviceSpaceClipRect(rect, isAligned); - - if (clipIsComplex) { - // Make sure all clips are popped, and restore clipped out area if the - // operation is not bound by the mask. - PopAllClips(); - - if (!IsOperatorBoundByMask(aOp)) { - HRESULT hr = mDC->CreateBitmap(D2DIntSize(mSize), D2D1::BitmapProperties(D2DPixelFormat(mFormat)), byRef(tmpBitmap)); - if (FAILED(hr)) { - gfxCriticalError(CriticalLog::DefaultOptions(Factory::ReasonableSurfaceSize(mSize))) << "[D2D1.1] 6CreateBitmap failure " << mSize << " Code: " << hexa(hr); - // For now, crash in this scenario; this should happen because tmpBitmap is - // null and CopyFromBitmap call below dereferences it. - // return; - } - mDC->Flush(); - - tmpBitmap->CopyFromBitmap(nullptr, mBitmap, nullptr); - } - } mDC->DrawImage(image, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2DCompositionMode(aOp)); - - if (tmpBitmap) { - RefPtr brush; - RefPtr inverseGeom = GetInverseClippedGeometry(); - mDC->CreateBitmapBrush(tmpBitmap, byRef(brush)); - - mDC->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND_COPY); - mDC->FillGeometry(inverseGeom, brush); - mDC->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND_SOURCE_OVER); - } return; } @@ -1101,8 +1068,6 @@ DrawTargetD2D1::GetClippedGeometry(IntRect *aClipBounds) return mCurrentClippedGeometry; } - MOZ_ASSERT(mPushedClips.size()); - mCurrentClipBounds = IntRect(IntPoint(0, 0), mSize); // if pathGeom is null then pathRect represents the path. @@ -1182,24 +1147,6 @@ DrawTargetD2D1::GetClippedGeometry(IntRect *aClipBounds) return mCurrentClippedGeometry; } -TemporaryRef -DrawTargetD2D1::GetInverseClippedGeometry() -{ - IntRect bounds; - RefPtr geom = GetClippedGeometry(&bounds); - RefPtr rectGeom; - RefPtr inverseGeom; - - factory()->CreateRectangleGeometry(D2D1::RectF(0, 0, mSize.width, mSize.height), byRef(rectGeom)); - factory()->CreatePathGeometry(byRef(inverseGeom)); - RefPtr sink; - inverseGeom->Open(byRef(sink)); - rectGeom->CombineWithGeometry(geom, D2D1_COMBINE_MODE_EXCLUDE, D2D1::IdentityMatrix(), sink); - sink->Close(); - - return inverseGeom; -} - void DrawTargetD2D1::PopAllClips() { diff --git a/gfx/2d/DrawTargetD2D1.h b/gfx/2d/DrawTargetD2D1.h index f18df2ca19c8..447a3e230e7f 100644 --- a/gfx/2d/DrawTargetD2D1.h +++ b/gfx/2d/DrawTargetD2D1.h @@ -175,8 +175,6 @@ private: // bounds to correctly reflect the total clip. This is in device space. TemporaryRef GetClippedGeometry(IntRect *aClipBounds); - TemporaryRef GetInverseClippedGeometry(); - bool GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAligned); void PopAllClips();