Merge "Incorporate alpha attribute when painting VectorDrawable"
diff --git a/bridge/src/android/graphics/drawable/VectorDrawable_Delegate.java b/bridge/src/android/graphics/drawable/VectorDrawable_Delegate.java
index 49f8691..8fc2c41 100644
--- a/bridge/src/android/graphics/drawable/VectorDrawable_Delegate.java
+++ b/bridge/src/android/graphics/drawable/VectorDrawable_Delegate.java
@@ -1133,7 +1133,8 @@
}
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 @@
}
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
diff --git a/bridge/tests/res/testApp/MyApplication/golden/vector_drawable.png b/bridge/tests/res/testApp/MyApplication/golden/vector_drawable.png
index 55d6a20..466eca8 100644
--- a/bridge/tests/res/testApp/MyApplication/golden/vector_drawable.png
+++ b/bridge/tests/res/testApp/MyApplication/golden/vector_drawable.png
Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/src/main/res/drawable/multi_path.xml b/bridge/tests/res/testApp/MyApplication/src/main/res/drawable/multi_path.xml
index 32e6e73..0998b25 100644
--- a/bridge/tests/res/testApp/MyApplication/src/main/res/drawable/multi_path.xml
+++ b/bridge/tests/res/testApp/MyApplication/src/main/res/drawable/multi_path.xml
@@ -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>