Skip to content

Commit

Permalink
Update to 7.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Jul 15, 2021
1 parent dd2b001 commit 3ac3c37
Show file tree
Hide file tree
Showing 429 changed files with 138,170 additions and 2,445 deletions.
8 changes: 4 additions & 4 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ configurations.all {
}

dependencies {
implementation 'androidx.core:core:1.5.0'
implementation 'androidx.core:core:1.6.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
Expand All @@ -26,7 +26,7 @@ dependencies {
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-config:21.0.0'
implementation 'com.google.firebase:firebase-datatransport:18.0.0'
implementation 'com.google.firebase:firebase-datatransport:18.0.1'
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
Expand Down Expand Up @@ -299,7 +299,7 @@ android {
}
}

defaultConfig.versionCode = 2360
defaultConfig.versionCode = 2372

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand All @@ -318,7 +318,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionName "7.8.0"
versionName "7.8.1"

vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ target_include_directories(${NATIVE_LIB} PUBLIC
lz4)

target_link_libraries(${NATIVE_LIB}
-Wl,--whole-archive rnnoise voipandroid -Wl,--no-whole-archive
-Wl,--whole-archive rnnoise openh264 voipandroid -Wl,--no-whole-archive
tgvoip
tgcalls
tgcalls_tp
Expand Down
26 changes: 13 additions & 13 deletions TMessagesProj/jni/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ std::vector<std::pair<float, float>> gatherPositions(std::vector<std::pair<float
return result;
}

static float *pixelCache = nullptr;
thread_local static float *pixelCache = nullptr;

JNIEXPORT void Java_org_telegram_messenger_Utilities_generateGradient(JNIEnv *env, jclass clazz, jobject bitmap, jboolean unpin, jint phase, jfloat progress, jint width, jint height, jint stride, jintArray colors) {
if (!bitmap) {
Expand Down Expand Up @@ -1217,29 +1217,29 @@ JNIEXPORT void Java_org_telegram_messenger_Utilities_generateGradient(JNIEnv *en
std::vector<std::pair<float, float>> current = gatherPositions(positions, phase);

auto colorsArray = (uint8_t *) env->GetIntArrayElements(colors, nullptr);
/*float *newPixelCache = nullptr;
float *newPixelCache = nullptr;
if (pixelCache == nullptr) {
newPixelCache = new float[width * height * 2];
}*/
}
float directPixelY;
float centerDistanceY;
float centerDistanceY2;
int32_t colorsCount = colorsArray[12] == 0 ? 3 : 4;

for (int y = 0; y < height; y++) {
//if (pixelCache == nullptr) {
if (pixelCache == nullptr) {
directPixelY = (float) y / (float) height;
centerDistanceY = directPixelY - 0.5f;
centerDistanceY2 = centerDistanceY * centerDistanceY;
//}
}
uint32_t offset = y * stride;
for (int x = 0; x < width; x++) {
float pixelX;
float pixelY;
/*if (pixelCache != nullptr) {
if (pixelCache != nullptr) {
pixelX = pixelCache[(y * width + x) * 2];
pixelX = pixelCache[(y * width + x) * 2 + 1];
} else {*/
pixelY = pixelCache[(y * width + x) * 2 + 1];
} else {
float directPixelX = (float) x / (float) width;

float centerDistanceX = directPixelX - 0.5f;
Expand All @@ -1250,9 +1250,9 @@ JNIEXPORT void Java_org_telegram_messenger_Utilities_generateGradient(JNIEnv *en
float sinTheta = sinf(theta);
float cosTheta = cosf(theta);

pixelX = /*newPixelCache[(y * width + x) * 2] =*/ std::max(0.0f, std::min(1.0f, 0.5f + centerDistanceX * cosTheta - centerDistanceY * sinTheta));
pixelY = /*newPixelCache[(y * width + x) * 2 + 1] =*/ std::max(0.0f, std::min(1.0f, 0.5f + centerDistanceX * sinTheta + centerDistanceY * cosTheta));
//}
pixelX = newPixelCache[(y * width + x) * 2] = std::max(0.0f, std::min(1.0f, 0.5f + centerDistanceX * cosTheta - centerDistanceY * sinTheta));
pixelY = newPixelCache[(y * width + x) * 2 + 1] = std::max(0.0f, std::min(1.0f, 0.5f + centerDistanceX * sinTheta + centerDistanceY * cosTheta));
}

float distanceSum = 0.0f;

Expand Down Expand Up @@ -1282,10 +1282,10 @@ JNIEXPORT void Java_org_telegram_messenger_Utilities_generateGradient(JNIEnv *en
pixels[offset + x * 4 + 3] = 0xff;
}
}
/*if (newPixelCache != nullptr) {
if (newPixelCache != nullptr) {
delete [] pixelCache;
pixelCache = newPixelCache;
}*/
}

env->ReleaseIntArrayElements(colors, (jint *) colorsArray, JNI_ABORT);

Expand Down
Loading

1 comment on commit 3ac3c37

@huezo
Copy link

@huezo huezo commented on 3ac3c37 Jul 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DrKLO Please update the Telegram version of Appgalery!!
https://appgallery.huawei.com/#/app/C101184875

Please sign in to comment.