Bug 1365495 - Let WebRender premultiply gradient stop colors r=jrmuizel
authorRyan Hunt <rhunt@eqrion.net>
Thu, 18 May 2017 20:30:15 -0400
changeset 361231 1a0568ebe975cafcd2f8e785730a2a13d5ee9a9e
parent 361230 9c8bcb590b888c5c077e3a05625800ed0d6786a8
child 361232 3d821b8e5cbf1c250c476648b43b146d65087082
push id31921
push userryanvm@gmail.com
push dateTue, 30 May 2017 16:13:51 +0000
treeherdermozilla-central@c3cd8c58fa87 [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);
 }