forked from google/skia
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bind Skottie's Animation Builder (#114)
- Loading branch information
1 parent
8990028
commit 53d2065
Showing
12 changed files
with
218 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2024 Microsoft Corporation. All rights reserved. | ||
* | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#ifndef sk_linker_DEFINED | ||
#define sk_linker_DEFINED | ||
|
||
#include "include/c/sk_types.h" | ||
|
||
SK_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
SK_C_API void sk_linker_keep_alive(void); | ||
|
||
SK_C_PLUS_PLUS_END_GUARD | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2014 Google Inc. | ||
* Copyright 2015 Xamarin Inc. | ||
* Copyright 2017 Microsoft Corporation. All rights reserved. | ||
* | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#ifndef skresources_resource_provider_DEFINED | ||
#define skresources_resource_provider_DEFINED | ||
|
||
#include "include/c/sk_types.h" | ||
|
||
SK_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
SK_C_API void skresources_resource_provider_ref(skresources_resource_provider_t* instance); | ||
SK_C_API void skresources_resource_provider_unref(skresources_resource_provider_t* instance); | ||
SK_C_API void skresources_resource_provider_delete(skresources_resource_provider_t *instance); | ||
|
||
SK_C_API sk_data_t* skresources_resource_provider_load(skresources_resource_provider_t *instance, const char* path, const char* name); | ||
SK_C_API skresources_image_asset_t* skresources_resource_provider_load_image_asset(skresources_resource_provider_t *instance, const char* path, const char* name, const char* id); | ||
SK_C_API skresources_external_track_asset_t* skresources_resource_provider_load_audio_asset(skresources_resource_provider_t *instance, const char* path, const char* name, const char* id); | ||
SK_C_API sk_typeface_t* skresources_resource_provider_load_typeface(skresources_resource_provider_t *instance, const char* name, const char* url); | ||
|
||
SK_C_API skresources_resource_provider_t* skresources_file_resource_provider_make(sk_string_t* base_dir, bool predecode); | ||
SK_C_API skresources_resource_provider_t* skresources_caching_resource_provider_proxy_make(skresources_resource_provider_t* rp); | ||
SK_C_API skresources_resource_provider_t* skresources_data_uri_resource_provider_proxy_make(skresources_resource_provider_t* rp, bool predecode); | ||
|
||
SK_C_PLUS_PLUS_END_GUARD | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "include/c/sk_linker.h" | ||
|
||
#include "src/c/sk_types_priv.h" | ||
|
||
#include "include/core/SkCubicMap.h" | ||
#include "include/utils/SkAnimCodecPlayer.h" | ||
|
||
#include "src/utils/SkJSON.h" | ||
#include "src/utils/SkOSPath.h" | ||
|
||
void sk_linker_keep_alive(void) { | ||
// This function is needed on Tizen to ensure required types are kept alive | ||
// It is not meant to be executed. | ||
|
||
skjson::ObjectValue* a = nullptr; | ||
auto r = (*a)["tmp"].getType(); | ||
|
||
SkCubicMap* b = nullptr; | ||
(*b).computeYFromX((int)r); | ||
|
||
SkAnimCodecPlayer* c = nullptr; | ||
(*c).seek((uint32_t)123); | ||
|
||
SkOSPath::Join(nullptr, nullptr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "modules/skresources/include/SkResources.h" | ||
#include "include/c/skresources_resource_provider.h" | ||
|
||
#include "src/c/sk_types_priv.h" | ||
|
||
void skresources_resource_provider_ref(skresources_resource_provider_t* instance) { | ||
SkSafeRef(AsSkResourcesResourceProvider(instance)); | ||
} | ||
void skresources_resource_provider_unref(skresources_resource_provider_t* instance) { | ||
SkSafeUnref(AsSkResourcesResourceProvider(instance)); | ||
} | ||
void skresources_resource_provider_delete(skresources_resource_provider_t *instance) { | ||
delete AsSkResourcesResourceProvider(instance); | ||
} | ||
|
||
sk_data_t* skresources_resource_provider_load(skresources_resource_provider_t *instance, const char* path, const char* name) { | ||
return ToData(AsSkResourcesResourceProvider(instance)->load(path, name).release()); | ||
} | ||
skresources_image_asset_t* skresources_resource_provider_load_image_asset(skresources_resource_provider_t *instance, const char* path, const char* name, const char* id) { | ||
return ToSkResourcesImageAsset(AsSkResourcesResourceProvider(instance)->loadImageAsset(path, name, id).release()); | ||
} | ||
skresources_external_track_asset_t* skresources_resource_provider_load_audio_asset(skresources_resource_provider_t *instance, const char* path, const char* name, const char* id) { | ||
return ToSkResourcesExternalTrackAsset(AsSkResourcesResourceProvider(instance)->loadAudioAsset(path, name, id).release()); | ||
} | ||
sk_typeface_t* skresources_resource_provider_load_typeface(skresources_resource_provider_t *instance, const char* name, const char* url) { | ||
return ToTypeface(AsSkResourcesResourceProvider(instance)->loadTypeface(name, url).release()); | ||
} | ||
|
||
skresources_resource_provider_t* skresources_file_resource_provider_make(sk_string_t* base_dir, bool predecode){ | ||
return ToSkResourcesResourceProvider(skresources::FileResourceProvider::Make(AsString(*base_dir), predecode).release()); | ||
} | ||
skresources_resource_provider_t* skresources_caching_resource_provider_proxy_make(skresources_resource_provider_t* rp) { | ||
return ToSkResourcesResourceProvider(skresources::CachingResourceProvider::Make(sk_ref_sp(AsSkResourcesResourceProvider(rp))).release()); | ||
} | ||
skresources_resource_provider_t* skresources_data_uri_resource_provider_proxy_make(skresources_resource_provider_t* rp, bool predecode) { | ||
return ToSkResourcesResourceProvider(skresources::DataURIResourceProviderProxy::Make(sk_ref_sp(AsSkResourcesResourceProvider(rp)), predecode).release()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters