Skip to content

Commit

Permalink
12
Browse files Browse the repository at this point in the history
12
  • Loading branch information
umerov1999 committed Feb 9, 2023
1 parent 1cf929e commit 6eda78d
Show file tree
Hide file tree
Showing 86 changed files with 11,813 additions and 11,239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ abstract class AbsVKApiInterceptor(private val version: String) :
.build()
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ internal class CustomTokenVKApiInterceptor(
return accountType
}
override val accountId: Long = account_id ?: -1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class DefaultVKApiInterceptor internal constructor(
get() = Settings.get()
.accounts()
.getType(accountId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ interface IOtherVKRestProvider {
fun provideAuthServiceRest(): Single<SimplePostHttp>
fun provideLongpollRest(): Single<SimplePostHttp>
fun provideLocalServerRest(): Single<SimplePostHttp>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ interface IVKMethodHttpClientFactory {
customDeviceName: String?,
config: ProxyConfig?
): OkHttpClient.Builder
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ interface IVKRestProvider {
@AccountType type: Int,
customDeviceName: String?
): Single<OkHttpClient.Builder>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ internal class VKApies private constructor(
wallApi = WallApi(accountId, restProvider)
otherApi = OtherApi(accountId, provider)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class VKApiGroupLongpollUpdates {
var ts: String? = null
val count: Int
get() = 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ class VKApiLongpollUpdates {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ open class VKResponse {
@SerialName("execute_errors")
var executeErrors: List<Error>? = null
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ class VKPhotoAlbumsAdapter(private val context: Context, private var data: List<
val title: TextView = itemView.findViewById(R.id.item_local_album_name)
val counterText: TextView = itemView.findViewById(R.id.counter)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,4 @@ class BigVKPhotosAdapter(
setData(DATA_TYPE_UPLOAD, uploads)
setData(DATA_TYPE_PHOTO, photoWrappers)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ interface IVKPhotosView : IMvpView, IErrorView, IToolbarView {
const val ACTION_SHOW_PHOTOS = "dev.ragnarok.fenrir.ACTION_SHOW_PHOTOS"
const val ACTION_SELECT_PHOTOS = "dev.ragnarok.fenrir.ACTION_SELECT_PHOTOS"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -603,4 +603,4 @@ class VKPhotosPresenter(
refreshOwnerInfoIfNeed()
refreshAlbumInfoIfNeed()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -750,4 +750,4 @@ object VKLinkParser {
@Throws(Exception::class)
fun parse(string: String?): Optional<AbsLink>
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ class VKPhotosSelectableSource : AbsSelectableSource {
return arrayOfNulls(size)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ open class VKPlace {
return null
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ class VKPushRegistration {
this.gmcToken = gmcToken
return this
}
}
}
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ buildscript {
ext.appFileGalleryVersionName = "1.999"

//androidx libraries
ext.activityVersion = "1.7.0-alpha04"
ext.annotationVersion = "1.6.0-beta01"
ext.appcompatVersion = "1.6.0"
ext.activityVersion = "1.7.0-beta01"
ext.annotationVersion = "1.6.0-rc01"
ext.appcompatVersion = "1.6.1"
ext.biometricVersion = "1.2.0-alpha05"
ext.browserVersion = "1.5.0-rc01"
ext.browserVersion = "1.5.0"
ext.cameraVersion = "1.2.1"
ext.cardviewVersion = "1.0.0"
ext.collectionVersion = "1.3.0-alpha02"
Expand All @@ -27,20 +27,20 @@ buildscript {
ext.customviewVersion = "1.2.0-alpha02"
ext.customviewPoolingcontainerVersion = "1.0.0"
ext.dynamicanimationVersion = "1.1.0-alpha03"
ext.drawerlayoutVersion = "1.2.0-alpha01"
ext.exifinterfaceVersion = "1.3.5"
ext.fragmentVersion = "1.6.0-alpha04"
ext.lifecycleVersion = "2.6.0-alpha05"
ext.drawerlayoutVersion = "1.2.0-beta01"
ext.exifinterfaceVersion = "1.3.6"
ext.fragmentVersion = "1.6.0-alpha05"
ext.lifecycleVersion = "2.6.0-beta01"
ext.loaderVersion = "1.1.0"
ext.mediaVersion = "1.6.0"
ext.recyclerviewVersion = "1.3.0-beta02"
ext.mediaVersion = "1.7.0-alpha01"
ext.recyclerviewVersion = "1.3.0-rc01"
ext.savedStateVersion = "1.2.0"
ext.swiperefreshlayoutVersion = "1.2.0-alpha01"
ext.tracingVersion = "1.1.0"
ext.transitionVersion = "1.4.1"
ext.vectordrawableVersion = "1.2.0-beta01"
ext.webkitVersion = "1.6.0"
ext.workVersion = "2.8.0-rc01"
ext.workVersion = "2.8.0"

//firebase libraries
ext.firebaseDatatransportVersion = "18.1.7"
Expand Down
8 changes: 8 additions & 0 deletions firebase-installations/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("com.android.library")
id("kotlin-android")
}

android {
Expand Down Expand Up @@ -47,13 +48,20 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
encoding = "utf-8"
}
kotlinOptions {
jvmTarget = "1.8"
}
}

static def asStringVar(String str) {
return "\"$str\""
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
implementation("org.jetbrains.kotlin:kotlin-parcelize-runtime:$kotlin_version")
implementation("org.jetbrains.kotlin:kotlin-android-extensions-runtime:$kotlin_version")
compileOnly("org.jetbrains.kotlin:kotlin-annotations-jvm:$kotlin_version")
implementation("com.google.firebase:firebase-common:$firebaseCommonVersion")
implementation("com.google.firebase:firebase-installations-interop:$firebaseInstallationsInteropVersion")
implementation("com.google.firebase:firebase-components:$firebaseComponentsVersion")
Expand Down
14 changes: 11 additions & 3 deletions image/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("com.android.library")
id("kotlin-android")
}

android {
Expand All @@ -18,17 +19,24 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
encoding = "utf-8"
}
kotlinOptions {
jvmTarget = "1.8"
}

}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
implementation("org.jetbrains.kotlin:kotlin-parcelize-runtime:$kotlin_version")
implementation("org.jetbrains.kotlin:kotlin-android-extensions-runtime:$kotlin_version")
compileOnly("org.jetbrains.kotlin:kotlin-annotations-jvm:$kotlin_version")
implementation("androidx.annotation:annotation:$annotationVersion")
implementation("androidx.appcompat:appcompat:$appcompatVersion")
//implementation("androidx.recyclerview:recyclerview:$recyclerviewVersion")
implementation project(path: ":viewpager2")
implementation("androidx.core:core:$coreVersion")
implementation("androidx.activity:activity:$activityVersion")
implementation("androidx.fragment:fragment:$fragmentVersion")
implementation("androidx.core:core-ktx:$coreVersion")
implementation("androidx.activity:activity-ktx:$activityVersion")
implementation("androidx.fragment:fragment-ktx:$fragmentVersion")
implementation project(path: ":material")
implementation("androidx.constraintlayout:constraintlayout:$constraintlayoutVersion")
implementation("io.reactivex.rxjava3:rxjava:$rxJavaVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ bool SwRenderer::viewport(const RenderRegion& vp)
}


bool SwRenderer::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t cs)
bool SwRenderer::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t colorSpace)
{
if (!buffer || stride == 0 || w == 0 || h == 0 || w > stride) return false;

Expand All @@ -306,7 +306,7 @@ bool SwRenderer::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t
surface->stride = stride;
surface->w = w;
surface->h = h;
surface->cs = cs;
surface->cs = colorSpace;

vport.x = vport.y = 0;
vport.w = surface->w;
Expand Down Expand Up @@ -661,6 +661,13 @@ SwRenderer::SwRenderer():mpool(globalMpool)
}


uint32_t SwRenderer::colorSpace()
{
if (surface) return surface->cs;
return tvg::SwCanvas::ARGB8888;
}


bool SwRenderer::init(uint32_t threads)
{
if ((initEngineCnt++) > 0) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ class SwRenderer : public RenderMethod

bool clear() override;
bool sync() override;
bool target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t cs);
bool target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t colorSpace);
bool mempool(bool shared);

Compositor* target(const RenderRegion& region) override;
bool beginComposite(Compositor* cmp, CompositeMethod method, uint32_t opacity) override;
bool endComposite(Compositor* cmp) override;
void clearCompositors();

uint32_t colorSpace() override;

static SwRenderer* gen();
static bool init(uint32_t threads);
static int32_t init();
Expand Down
3 changes: 2 additions & 1 deletion libfenrir/src/main/jni/thorvg/src/lib/tvgLoadModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class LoadModule
float vw = 0;
float vh = 0;
float w = 0, h = 0; //default image size
uint32_t colorSpace = SwCanvas::ARGB8888;

virtual ~LoadModule() {}

Expand All @@ -49,7 +50,7 @@ class LoadModule

virtual bool read() = 0;
virtual bool close() = 0;
virtual unique_ptr<Surface> bitmap() { return nullptr; }
virtual unique_ptr<Surface> bitmap(uint32_t colorSpace) { return nullptr; }
virtual unique_ptr<Paint> paint() { return nullptr; }
};

Expand Down
4 changes: 3 additions & 1 deletion libfenrir/src/main/jni/thorvg/src/lib/tvgPictureImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct Picture::Impl
void* rdata = nullptr; //engine data
float w = 0, h = 0;
bool resizing = false;
uint32_t rendererColorSpace = 0;

~Impl()
{
Expand Down Expand Up @@ -104,7 +105,7 @@ struct Picture::Impl
}
}
free(surface);
if ((surface = loader->bitmap().release())) {
if ((surface = loader->bitmap(rendererColorSpace).release())) {
loader->close();
return RenderUpdateFlag::Image;
}
Expand All @@ -128,6 +129,7 @@ struct Picture::Impl

void* update(RenderMethod &renderer, const RenderTransform* pTransform, uint32_t opacity, Array<RenderData>& clips, RenderUpdateFlag pFlag, bool clipper)
{
rendererColorSpace = renderer.colorSpace();
auto flag = reload();

if (surface) {
Expand Down
2 changes: 2 additions & 0 deletions libfenrir/src/main/jni/thorvg/src/lib/tvgRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ class RenderMethod
virtual Compositor* target(const RenderRegion& region) = 0;
virtual bool beginComposite(Compositor* cmp, CompositeMethod method, uint32_t opacity) = 0;
virtual bool endComposite(Compositor* cmp) = 0;

virtual uint32_t colorSpace() = 0;
};

}
Expand Down
35 changes: 28 additions & 7 deletions libfenrir/src/main/jni/thorvg/src/loaders/raw/tvgRawLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@
/* Internal Class Implementation */
/************************************************************************/

static inline uint32_t CHANGE_COLORSPACE(uint32_t c)
{
return (c & 0xff000000) + ((c & 0x00ff0000)>>16) + (c & 0x0000ff00) + ((c & 0x000000ff)<<16);
}


static void _changeColorSpace(uint32_t* data, uint32_t w, uint32_t h)
{
auto buffer = data;
for (uint32_t y = 0; y < h; ++y, buffer += w) {
auto src = buffer;
for (uint32_t x = 0; x < w; ++x, ++src) {
*src = CHANGE_COLORSPACE(*src);
}
}
}

/************************************************************************/
/* External Class Implementation */
/************************************************************************/
Expand All @@ -55,7 +72,7 @@ bool RawLoader::open(const uint32_t* data, uint32_t w, uint32_t h, bool copy)
if (!content) return false;
memcpy((void*)content, data, sizeof(uint32_t) * w * h);
}
else content = data;
else content = const_cast<uint32_t*>(data);

return true;
}
Expand All @@ -73,16 +90,20 @@ bool RawLoader::close()
}


unique_ptr<Surface> RawLoader::bitmap()
unique_ptr<Surface> RawLoader::bitmap(uint32_t colorSpace)
{
if (!content) return nullptr;
if (this->colorSpace != colorSpace) {
this->colorSpace = colorSpace;
_changeColorSpace(content, w, h);
}

auto surface = static_cast<Surface*>(malloc(sizeof(Surface)));
surface->buffer = (uint32_t*)(content);
surface->stride = (uint32_t)w;
surface->w = (uint32_t)w;
surface->h = (uint32_t)h;
surface->cs = SwCanvas::ARGB8888;
surface->buffer = content;
surface->stride = static_cast<uint32_t>(w);
surface->w = static_cast<uint32_t>(w);
surface->h = static_cast<uint32_t>(h);
surface->cs = colorSpace;

return unique_ptr<Surface>(surface);
}
Loading

0 comments on commit 6eda78d

Please sign in to comment.