Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aghajari committed Aug 14, 2021
1 parent bb93fc5 commit 7ad983f
Show file tree
Hide file tree
Showing 22 changed files with 262 additions and 274 deletions.
141 changes: 75 additions & 66 deletions AXrLottie/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply plugin: 'com.android.library'
plugins {
id 'com.android.library'
}

android {
compileSdkVersion 30
Expand All @@ -13,6 +15,7 @@ android {
consumerProguardFiles "consumer-rules.pro"
externalNativeBuild {
cmake {
arguments "-DANDROID_ARM_NEON=OFF"
cppFlags "-std=c++14"
}
}
Expand All @@ -36,70 +39,18 @@ android {

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.annotation:annotation:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.annotation:annotation:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

// PUBLISH

//JCenter
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

def artifact = new Properties()
artifact.load(new FileInputStream("deploy.settings"))

version=artifact.version
group=artifact.groupId

install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
groupId artifact.groupId
artifactId artifact.id
version artifact.version
name artifact.id // pom.project.name must be same as bintray.pkg.name
url artifact.siteUrl
inceptionYear '2020' // HARDCODED
licenses {
license { // HARDCODED
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
connection artifact.gitUrl
developerConnection artifact.gitUrl
url artifact.siteUrl
}
}
}
}

def properties = new Properties()
properties.load(new FileInputStream("local.properties"))

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = "Aghajari"
name = artifact.id
websiteUrl = artifact.siteUrl
vcsUrl = artifact.gitUrl
licenses = artifact.licenses
publish = true
version {
name = artifact.version
}
}
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
Expand All @@ -111,6 +62,12 @@ task javadoc(type: Javadoc) {
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

afterEvaluate {
javadoc.classpath += files(android.libraryVariants.collect { variant ->
variant.javaCompileProvider.get().classpath.files
})
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
Expand All @@ -121,13 +78,65 @@ artifacts {
archives sourcesJar
}

repositories {
maven { url 'https://maven.google.com' }
mavenCentral()
signing {
useInMemoryPgpKeys(
rootProject.ext["signing.keyId"],
rootProject.ext["signing.key"],
rootProject.ext["signing.password"],
)
sign publishing.publications
}

tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
}

def artifact = new Properties()
artifact.load(new FileInputStream("deploy.settings"))

version = artifact.version
group = artifact.groupId
archivesBaseName = artifact.id

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId artifact.groupId
artifactId artifact.id
version artifact.version
from components.release

pom {
name = artifact.id
packaging = 'aar'
description = 'AXrLottie (Android) Renders animations and vectors exported in the bodymovin JSON format. (Using rLottie)'
url = artifact.siteUrl

scm {
connection = artifact.gitUrl
developerConnection = artifact.gitUrl
url = artifact.siteUrl
}

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id = 'Aghajari'
name = 'AmirHossein Aghajari'
email = '[email protected]'
}
}
}
}
}
}
}
Binary file removed AXrLottie/output/aar/AXrLottie-release.aar
Binary file not shown.
14 changes: 12 additions & 2 deletions AXrLottie/src/main/cpp/src/lottie/lottieitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,21 @@ void renderer::CompLayer::renderMatteLayer(VPainter *painter, const VRle &mask,
srcBitmap.updateLuma();
}

auto clip = layerPainter.clipBoundingRect();

// if the layer has only one renderer then use it as the clip rect
// when blending 2 buffer and copy back to final buffer to avoid
// unnecessary pixel processing.
if (layer->renderList().size() == 1)
{
clip = layer->renderList()[0]->rle().boundingRect();
}

// 2.3 draw src buffer as mask
layerPainter.drawBitmap(VPoint(), srcBitmap);
layerPainter.drawBitmap(clip, srcBitmap, clip);
layerPainter.end();
// 3. draw the result buffer into painter
painter->drawBitmap(VPoint(), layerBitmap);
painter->drawBitmap(clip, layerBitmap, clip);

cache.release_surface(srcBitmap);
cache.release_surface(layerBitmap);
Expand Down
2 changes: 1 addition & 1 deletion AXrLottie/src/main/cpp/src/lottie/lottieitem_capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void renderer::Layer::buildLayerNode()
auto ptPtr = reinterpret_cast<const float *>(pts.data());
auto elmPtr = reinterpret_cast<const char *>(elm.data());
cNode.mPath.ptPtr = ptPtr;
cNode.mPath.ptCount = pts.size();
cNode.mPath.ptCount = 2 * pts.size();
cNode.mPath.elmPtr = elmPtr;
cNode.mPath.elmCount = elm.size();
cNode.mAlpha = uchar(mask.mCombinedAlpha * 255.0f);
Expand Down
2 changes: 1 addition & 1 deletion AXrLottie/src/main/cpp/src/lottie/lottiemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void model::Dash::getDashInfo(int frameNo, std::vector<float> &result) const
{
result.clear();

if (mData.empty()) return;
if (mData.size() <= 1) return;

if (result.capacity() < mData.size()) result.reserve(mData.size() + 1);

Expand Down
9 changes: 4 additions & 5 deletions AXrLottie/src/main/cpp/src/lottie/lottiemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,9 @@ class Layer : public Group {
int inFrame() const noexcept { return mInFrame; }
int outFrame() const noexcept { return mOutFrame; }
int startFrame() const noexcept { return mStartFrame; }
Color solidColor() const noexcept { return mExtra->mSolidColor; }
Color solidColor() const noexcept {
return mExtra ? mExtra->mSolidColor : Color();
}
bool autoOrient() const noexcept { return mAutoOrient; }
int timeRemap(int frameNo) const;
VSize layerSize() const { return mLayerSize; }
Expand All @@ -705,10 +707,7 @@ class Layer : public Group {
{
return mTransform ? mTransform->opacity(frameNo) : 1.0f;
}
Asset *asset() const
{
return (mExtra && mExtra->mAsset) ? mExtra->mAsset : nullptr;
}
Asset *asset() const { return mExtra ? mExtra->mAsset : nullptr; }
struct Extra {
Color mSolidColor;
std::string mPreCompRefId;
Expand Down
Loading

0 comments on commit 7ad983f

Please sign in to comment.