Bug 1365495 - Let WebRender premultiply gradient stop colors r=jrmuizel
authorRyan Hunt <rhunt@eqrion.net>
Thu, 18 May 2017 20:30:15 -0400
changeset 409348 1a0568ebe975cafcd2f8e785730a2a13d5ee9a9e
parent 409347 9c8bcb590b888c5c077e3a05625800ed0d6786a8
child 409349 3d821b8e5cbf1c250c476648b43b146d65087082
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1365495
milestone55.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 1365495 - Let WebRender premultiply gradient stop colors r=jrmuizel WebRender now expects a non-premultiplied gradient stop color in the API.
layout/painting/nsCSSRenderingGradients.cpp
--- a/layout/painting/nsCSSRenderingGradients.cpp
+++ b/layout/painting/nsCSSRenderingGradients.cpp
@@ -1008,21 +1008,20 @@ nsCSSGradientRenderer::BuildWebRenderPar
                                                 LayoutDevicePoint& aLineStart,
                                                 LayoutDevicePoint& aLineEnd,
                                                 LayoutDeviceSize& aGradientRadius)
 {
   aMode = mGradient->mRepeating ? WrGradientExtendMode::Repeat : WrGradientExtendMode::Clamp;
 
   aStops.SetLength(mStops.Length());
   for(uint32_t i = 0; i < mStops.Length(); i++) {
-    Float alpha = mStops[i].mColor.a * aOpacity;
-    aStops[i].color.r = mStops[i].mColor.r * alpha;
-    aStops[i].color.g = mStops[i].mColor.g * alpha;
-    aStops[i].color.b = mStops[i].mColor.b * alpha;
-    aStops[i].color.a = alpha;
+    aStops[i].color.r = mStops[i].mColor.r;
+    aStops[i].color.g = mStops[i].mColor.g;
+    aStops[i].color.b = mStops[i].mColor.b;
+    aStops[i].color.a = mStops[i].mColor.a * aOpacity;
     aStops[i].offset = mStops[i].mPosition;
   }
 
   aLineStart = LayoutDevicePoint(mLineStart.x, mLineStart.y);
   aLineEnd = LayoutDevicePoint(mLineEnd.x, mLineEnd.y);
   aGradientRadius = LayoutDeviceSize(mRadiusX, mRadiusY);
 }