Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

gg: Android specific asset load in create_image function #19015

Merged
merged 2 commits into from Jul 31, 2023
Merged

gg: Android specific asset load in create_image function #19015

merged 2 commits into from Jul 31, 2023

Conversation

ArtemkaKun
Copy link
Contributor

@ArtemkaKun ArtemkaKun commented Jul 30, 2023

Before, loading an image on Android must be handled separately from the create_image function, and the created image doesn't contain a path value.

This PR unifies the create_image function to automatically handle the loading of images on Android (with the same code that was used manually) and implements setup of path value for images loaded on Android.

馃 Generated by Copilot at f0bca41

This pull request improves the image loading functionality of the gg module for android platforms. It adds support for reading images from apk assets using the android_asset prefix, and streamlines the logic for initializing the Sokol backend in vlib/gg/image.c.v.

馃 Generated by Copilot at f0bca41

  • Add support for loading images from apk assets on android (link)
  • Refactor the code for handling Sokol initialization (link, link)

@ArtemkaKun ArtemkaKun added Breaking Change This PR introduces changes that break backward compatibility. Requires manual review. OS: Android Bugs/feature requests, that are specific to Android OS. labels Jul 30, 2023
@ArtemkaKun
Copy link
Contributor Author

I introduced fix to V UI to fix CI fail there -> vlang/ui#538

@JalonSolov
Copy link
Contributor

Looks like all the errors boil down to:

src/picture.v:99:14: error: `dd` is immutable, declare it with `mut` to make it mutable
   97 |         } else if mut pic.ui.dd is DrawDeviceContext {
   98 |             dd := pic.ui.dd
   99 |             if img := dd.create_image(pic.path) {
      |                       ~~
  100 |                 pic.image = img
  101 |                 u.resource_cache[pic.path] = pic.image

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Good work.

@spytheman spytheman merged commit 0f861db into vlang:master Jul 31, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change This PR introduces changes that break backward compatibility. Requires manual review. OS: Android Bugs/feature requests, that are specific to Android OS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants