Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 301d4684 authored by Jerome Gaillard's avatar Jerome Gaillard Committed by Diego Perez
Browse files

Incorporate alpha attribute when painting VectorDrawable

When painting a vector drawable, alpha transparency can come from
the path color, or from the overall android:alpha attribute.
Include both when drawing.

Bug: http://b.android.com/206667
Change-Id: Id946fdeaf72b981597787f5357ef3a90a471c584
(cherry picked from commit 8cae3b0ce6f527e7b90d46755ffaf6d3d4d65114)
parent 4a1bd499
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1133,7 +1133,8 @@ public class VectorDrawable_Delegate {
                    }

                    final Paint fillPaint = mFillPaint;
                    fillPaint.setColor(applyAlpha(fullPath.mFillColor, fullPath.mFillAlpha));
                    fillPaint.setColor(applyAlpha(applyAlpha(fullPath.mFillColor, fullPath
                      .mFillAlpha), getRootAlpha()));
                    Paint_Delegate fillPaintDelegate = Paint_Delegate.getDelegate(fillPaint
                            .getNativeInstance());
                    // mFillPaint can not be null at this point so we will have a delegate
@@ -1162,7 +1163,8 @@ public class VectorDrawable_Delegate {
                    }

                    strokePaint.setStrokeMiter(fullPath.mStrokeMiterlimit);
                    strokePaint.setColor(applyAlpha(fullPath.mStrokeColor, fullPath.mStrokeAlpha));
                    strokePaint.setColor(applyAlpha(applyAlpha(fullPath.mStrokeColor, fullPath
                      .mStrokeAlpha), getRootAlpha()));
                    Paint_Delegate strokePaintDelegate = Paint_Delegate.getDelegate(strokePaint
                            .getNativeInstance());
                    // mStrokePaint can not be null at this point so we will have a delegate
−85 B (5.74 KiB)
Loading image diff...
+3 −2
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@
        android:height="76dp"
        android:width="76dp"
        android:viewportHeight="48"
        android:viewportWidth="48">
        android:viewportWidth="48"
        android:alpha="0.6">

    <group
        android:name="root"
@@ -79,7 +80,7 @@
            android:fillType="nonZero"
            android:strokeWidth="1"
            android:strokeColor="#AABBCC"
            android:fillColor="#AAEFCC"
            android:fillColor="#40AAEFCC"
            android:pathData="M0,-40 l0, 10 l10, 0 l0, -10 l-10,0 m5,0 l0, 10 l10, 0 l0, -10 l-10,0"
        />
    </group>