Bug 1258168: Push ClearType compatible clipping layers when the last pushed layer was marked as opaque. r=jrmuizel draft
authorBas Schouten <bschouten@mozilla.com>
Sun, 20 Mar 2016 19:51:46 +0100
changeset 342697 fc736599b8e44c34e22a78053dfa55ad47963d16
parent 342267 1bbc2f4a30650d7098af495fe7e5d76b95091ce0
child 516606 df3c11af9e45194e420cd6c1f9168c9e920feeaf
push id13442
push userbschouten@mozilla.com
push dateSun, 20 Mar 2016 18:51:39 +0000
reviewersjrmuizel
bugs1258168
milestone48.0a1
Bug 1258168: Push ClearType compatible clipping layers when the last pushed layer was marked as opaque. r=jrmuizel MozReview-Commit-ID: IM1srXx7CfB
gfx/2d/DrawTargetD2D1.cpp
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/DrawTargetD2D1.cpp
@@ -1781,17 +1781,17 @@ DrawTargetD2D1::OptimizeSourceSurface(So
 }
 
 void
 DrawTargetD2D1::PushD2DLayer(ID2D1DeviceContext *aDC, ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform,
                              bool aForceIgnoreAlpha, const D2D1_RECT_F& aMaxRect)
 {
   D2D1_LAYER_OPTIONS1 options = D2D1_LAYER_OPTIONS1_NONE;
 
-  if (aDC->GetPixelFormat().alphaMode == D2D1_ALPHA_MODE_IGNORE || aForceIgnoreAlpha) {
+  if (CurrentLayer().mIsOpaque || aForceIgnoreAlpha) {
     options = D2D1_LAYER_OPTIONS1_IGNORE_ALPHA | D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND;
   }
 
   mDC->PushLayer(D2D1::LayerParameters1(aMaxRect, aGeometry,
                                         D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, aTransform,
                                         1.0, nullptr, options), nullptr);
 }