Loading core/jni/android_graphics_drawable_VectorDrawable.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,11 @@ static void setAllowCaching(JNIEnv*, jobject, jlong treePtr, jboolean allowCachi tree->setAllowCaching(allowCaching); } static void setAntiAlias(JNIEnv*, jobject, jlong treePtr, jboolean aa) { VectorDrawable::Tree* tree = reinterpret_cast<VectorDrawable::Tree*>(treePtr); tree->setAntiAlias(aa); } /** * Draw */ Loading Loading @@ -363,6 +368,7 @@ static const JNINativeMethod gMethods[] = { {"nSetRendererViewportSize", "(JFF)V", (void*)setTreeViewportSize}, {"nSetRootAlpha", "(JF)Z", (void*)setRootAlpha}, {"nGetRootAlpha", "(J)F", (void*)getRootAlpha}, {"nSetAntiAlias", "(JZ)V", (void*)setAntiAlias}, {"nSetAllowCaching", "(JZ)V", (void*)setAllowCaching}, {"nCreateFullPath", "()J", (void*)createEmptyFullPath}, Loading graphics/java/android/graphics/drawable/VectorDrawable.java +9 −0 Original line number Diff line number Diff line Loading @@ -896,6 +896,13 @@ public class VectorDrawable extends Drawable { return mVectorState.getNativeRenderer(); } /** * @hide */ public void setAntiAlias(boolean aa) { nSetAntiAlias(mVectorState.mNativeTree.get(), aa); } static class VectorDrawableState extends ConstantState { // Variables below need to be copied (deep copy if applicable) for mutation. int[] mThemeAttrs; Loading Loading @@ -2269,6 +2276,8 @@ public class VectorDrawable extends Drawable { @FastNative private static native float nGetRootAlpha(long rendererPtr); @FastNative private static native void nSetAntiAlias(long rendererPtr, boolean aa); @FastNative private static native void nSetAllowCaching(long rendererPtr, boolean allowCaching); @FastNative Loading libs/hwui/VectorDrawable.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ void FullPath::draw(SkCanvas* outCanvas, bool useStagingData) { if (needsFill) { paint.setStyle(SkPaint::Style::kFill_Style); paint.setAntiAlias(true); paint.setAntiAlias(mAntiAlias); outCanvas->drawPath(renderPath, paint); } Loading @@ -182,7 +182,7 @@ void FullPath::draw(SkCanvas* outCanvas, bool useStagingData) { } if (needsStroke) { paint.setStyle(SkPaint::Style::kStroke_Style); paint.setAntiAlias(true); paint.setAntiAlias(mAntiAlias); paint.setStrokeJoin(SkPaint::Join(properties.getStrokeLineJoin())); paint.setStrokeCap(SkPaint::Cap(properties.getStrokeLineCap())); paint.setStrokeMiter(properties.getStrokeMiterLimit()); Loading libs/hwui/VectorDrawable.h +13 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,7 @@ public: virtual void onPropertyChanged(Properties* properties) = 0; virtual ~Node() {} virtual void syncProperties() = 0; virtual void setAntiAlias(bool aa) = 0; protected: std::string mName; Loading Loading @@ -354,6 +355,7 @@ public: } } } virtual void setAntiAlias(bool aa) { mAntiAlias = aa; } protected: const SkPath& getUpdatedPath(bool useStagingData, SkPath* tempStagingPath) override; Loading @@ -365,6 +367,8 @@ private: // Intermediate data for drawing, render thread only SkPath mTrimmedSkPath; // Default to use AntiAlias bool mAntiAlias = true; }; class ANDROID_API ClipPath : public Path { Loading @@ -373,6 +377,7 @@ public: ClipPath(const char* path, size_t strLength) : Path(path, strLength) {} ClipPath() : Path() {} void draw(SkCanvas* outCanvas, bool useStagingData) override; virtual void setAntiAlias(bool aa) {} }; class ANDROID_API Group : public Node { Loading Loading @@ -476,6 +481,12 @@ public: } } virtual void setAntiAlias(bool aa) { for (auto& child : mChildren) { child->setAntiAlias(aa); } } private: GroupProperties mProperties = GroupProperties(this); GroupProperties mStagingProperties = GroupProperties(this); Loading Loading @@ -641,6 +652,8 @@ public: */ void updateCache(sp<skiapipeline::VectorDrawableAtlas>& atlas, GrContext* context); void setAntiAlias(bool aa) { mRootNode->setAntiAlias(aa); } private: class Cache { public: Loading Loading
core/jni/android_graphics_drawable_VectorDrawable.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,11 @@ static void setAllowCaching(JNIEnv*, jobject, jlong treePtr, jboolean allowCachi tree->setAllowCaching(allowCaching); } static void setAntiAlias(JNIEnv*, jobject, jlong treePtr, jboolean aa) { VectorDrawable::Tree* tree = reinterpret_cast<VectorDrawable::Tree*>(treePtr); tree->setAntiAlias(aa); } /** * Draw */ Loading Loading @@ -363,6 +368,7 @@ static const JNINativeMethod gMethods[] = { {"nSetRendererViewportSize", "(JFF)V", (void*)setTreeViewportSize}, {"nSetRootAlpha", "(JF)Z", (void*)setRootAlpha}, {"nGetRootAlpha", "(J)F", (void*)getRootAlpha}, {"nSetAntiAlias", "(JZ)V", (void*)setAntiAlias}, {"nSetAllowCaching", "(JZ)V", (void*)setAllowCaching}, {"nCreateFullPath", "()J", (void*)createEmptyFullPath}, Loading
graphics/java/android/graphics/drawable/VectorDrawable.java +9 −0 Original line number Diff line number Diff line Loading @@ -896,6 +896,13 @@ public class VectorDrawable extends Drawable { return mVectorState.getNativeRenderer(); } /** * @hide */ public void setAntiAlias(boolean aa) { nSetAntiAlias(mVectorState.mNativeTree.get(), aa); } static class VectorDrawableState extends ConstantState { // Variables below need to be copied (deep copy if applicable) for mutation. int[] mThemeAttrs; Loading Loading @@ -2269,6 +2276,8 @@ public class VectorDrawable extends Drawable { @FastNative private static native float nGetRootAlpha(long rendererPtr); @FastNative private static native void nSetAntiAlias(long rendererPtr, boolean aa); @FastNative private static native void nSetAllowCaching(long rendererPtr, boolean allowCaching); @FastNative Loading
libs/hwui/VectorDrawable.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ void FullPath::draw(SkCanvas* outCanvas, bool useStagingData) { if (needsFill) { paint.setStyle(SkPaint::Style::kFill_Style); paint.setAntiAlias(true); paint.setAntiAlias(mAntiAlias); outCanvas->drawPath(renderPath, paint); } Loading @@ -182,7 +182,7 @@ void FullPath::draw(SkCanvas* outCanvas, bool useStagingData) { } if (needsStroke) { paint.setStyle(SkPaint::Style::kStroke_Style); paint.setAntiAlias(true); paint.setAntiAlias(mAntiAlias); paint.setStrokeJoin(SkPaint::Join(properties.getStrokeLineJoin())); paint.setStrokeCap(SkPaint::Cap(properties.getStrokeLineCap())); paint.setStrokeMiter(properties.getStrokeMiterLimit()); Loading
libs/hwui/VectorDrawable.h +13 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,7 @@ public: virtual void onPropertyChanged(Properties* properties) = 0; virtual ~Node() {} virtual void syncProperties() = 0; virtual void setAntiAlias(bool aa) = 0; protected: std::string mName; Loading Loading @@ -354,6 +355,7 @@ public: } } } virtual void setAntiAlias(bool aa) { mAntiAlias = aa; } protected: const SkPath& getUpdatedPath(bool useStagingData, SkPath* tempStagingPath) override; Loading @@ -365,6 +367,8 @@ private: // Intermediate data for drawing, render thread only SkPath mTrimmedSkPath; // Default to use AntiAlias bool mAntiAlias = true; }; class ANDROID_API ClipPath : public Path { Loading @@ -373,6 +377,7 @@ public: ClipPath(const char* path, size_t strLength) : Path(path, strLength) {} ClipPath() : Path() {} void draw(SkCanvas* outCanvas, bool useStagingData) override; virtual void setAntiAlias(bool aa) {} }; class ANDROID_API Group : public Node { Loading Loading @@ -476,6 +481,12 @@ public: } } virtual void setAntiAlias(bool aa) { for (auto& child : mChildren) { child->setAntiAlias(aa); } } private: GroupProperties mProperties = GroupProperties(this); GroupProperties mStagingProperties = GroupProperties(this); Loading Loading @@ -641,6 +652,8 @@ public: */ void updateCache(sp<skiapipeline::VectorDrawableAtlas>& atlas, GrContext* context); void setAntiAlias(bool aa) { mRootNode->setAntiAlias(aa); } private: class Cache { public: Loading