aboutsummaryrefslogtreecommitdiffstats
path: root/ports/servoshell/egl/android.rs
Commit message (Collapse)AuthorAgeFilesLines
* libservo: Expose a `ServoBuilder` (#36549)Martin Robinson6 days1-4/+3
| | | | | | | | | Expose a `ServoBuilder` for easily creating Servo instances using default values. This change enables removing `EmbedderTraits`. Testing: This is covered by `Servo` unit tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Migrate to the 2024 edition (#35755)Simon Wülker2025-03-131-28/+28
| | | | | | | | | | | | | | | | | | | | | | * Migrate to 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow unsafe_op_in_unsafe_fn lint This lint warns by default in the 2024 edition, but is *way* too noisy for servo. We might enable it in the future, but not now. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Compile using the 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-1/+1
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* libservo: Clean up interfaces for alert()/confirm()/prompt() (#35579)Delan Azabani2025-02-271-18/+37
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* libservo: Move size handling to `RenderContext` from `WindowMethods` (#35621)Martin Robinson2025-02-251-7/+1
| | | | | | | | | | | | | | | | | | | | | This is the first step toward removing `WindowMethods`, which will gradually be integrated into the `WebView` and `WebViewDelegate`. Sizing of the `WebView` is now handled by the a size associated with a `RenderingContext`. `WebView`s will eventually just paint the entire size of their `RenderingContext`. Notes: - This is transitionary step so now there is a `WebView::resize` and a `WebView::move_resize`. The first is the future which will resize the `WebView` and its associated `RenderingContext`. The second is a function that the virtual `WebView`s that will soon be replaced by a the one-`WebView` per `WebView` model. - We do not need to call `WebView::move_resize` at as much any longer because the default size of the `WebView` is to take up the whole `RenderingContext`. - `SurfmanRenderingContext` is no longer exposed in the API, as a surfman context doesn't naturally have a size unless a surface is bound to it. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Expose `SoftwareRenderingContext` and `WindowRenderingContext` ↵Martin Robinson2025-02-181-10/+29
| | | | | | | | | | | | | | (#35501) Expose two easy-to-use wrappers around `SurfmanRenderingContext` that make the API simpler to use: - `WindowRenderingContext`: This `RenderingContext` is a newtype around `SurfmanRenderingContext` takes a `raw-window-handle` display and window and creates a full window rendering context. - `SoftwareRenderingContext`: is wraps `SurfmanRenderingContext` and adds a swap chain in order to expose a software GL rendering context. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Don't bounce ready-to-present frame notifications to the ↵Martin Robinson2025-02-121-9/+0
| | | | | | | | | | | | | | | Constellation (#35369) Instead of telling the Constellation to tell the embedder that new frames are ready, have the compositor tell the embedder directly. This should reduce frame latency. Now, after processing compositor updates, run any pending `WebView::new_frame_ready` delegate methods. This change also removes the `refresh` call from the Java interface as that was the only other place that the compositor was rendering the WebRender scene outside of event looping spinning. This `refresh` call was completely unused. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Add a `ClipboardDelegate` and a default implementation (#35297)Martin Robinson2025-02-071-6/+0
| | | | | | | | | | | | | | | | | Add a `ClipboardDelegate` to the `WebView` API and a default implementation in libservo for this delegate that works on Mac, Windows, and Linux. Support for Android will be added in the future. This means that embedders do not need to do anything special to get clipboard support, but can choose to override it or implement it for other platforms. In addition, this adds support for handling fetches of clipboard contents and renames things to reflect that eventually other types of clipboard content will be supported. Part of this is removing the string argument from the `ClipboardEventType::Paste` enum because script will need to get other types of content from the clipboard than just a string. It now talks to the embedder to get this information directly. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Migrate Android and OHOS ports to the delegate API (#35315)Mukilan Thiyagarajan2025-02-061-12/+5
| | | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Combine `LoadStart, `HeadParsed`, and `LoadComplete` messages (#35260)Martin Robinson2025-02-031-12/+14
| | | | | | | | | These will be a single method in the upcoming `WebView` delegate, so it makes sense to also combine the internal message to match this. In addition, since `LoadStatus` is now exposed to the API if there is ever the need to add more statuses or to move to an event-based version, the API is already set up for this. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Move Android `MediaSessionAction` conversion to servoshell (#35225)Martin Robinson2025-01-301-1/+15
| | | | | | | The conversion of an integer into a `MediaSessionAction` is Android-specific and thus shouldn't be used throughout the source code. This change moves the conversion to the Android port of servoshell. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* servoshell: Port Android / OHOS servoshell to use the WebView API (#35192)Martin Robinson2025-01-291-21/+6
| | | Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Fix some clippy issues on the Android build (#35147)Martin Robinson2025-01-231-32/+22
| | | | | This fixes a variety of clippy issues that show up on the Android build. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-141-13/+0
| | | | | | | | | | | | | | | | | | | Flatten and simplify Servo's preferences code. In addition, have both preferences and options passed in as arguments to `Servo::new()` and make sure not to use the globally set preferences in `servoshell` (as much as possible now). Instead of a complex procedural macro to generate preferences, just expose a very simple derive macro that adds string based getters and setters. - All command-line parsing is moved to servoshell. - There is no longer the concept of a missing preference. - Preferences no longer have to be part of the resources bundle because they now have reasonable default values. - servoshell specific preferences are no longer part of the preferences exposed by the Servo API. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* servoshell: Remove duplicate egl bindings on android/ohos (#34716)Jonathan Schwender2024-12-201-4/+1
| | | | | | | | | | - The default value for SwapInterval is 1, so setting it to 1 changes nothing - We don't clear the screen immediately anymore, which was the only useage of the egl bindings this saves us from duplicated EGL bindings. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* andrdoid: Fix some compiler warnings (#34070)Martin Robinson2024-10-301-12/+2
| | | | | | | This removes unused code in order to reduce the number of compiler warnings on the Android build. Some of this code might be used in the future and it can be restored from git commit history. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* ohos: Bundle resource files in hap (#33513)Jonathan Schwender2024-09-241-0/+1
| | | | | | | | | | Bundle resource files into the .hap, so they are available as files in the application sandbox, instead of included into the shared library. This should slightly reduce the binary size in debug and release mode. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* android/ohos: Fix wrong production cfg (#33488)Jonathan Schwender2024-09-181-1/+1
| | | | | Our build script sets `servo_production` and not `production`. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* ohos: Present on vsync signals (#33117)Jonathan Schwender2024-08-301-1/+5
| | | | | | | | | Rely on callbacks from the vertical synchronization driver, to drive presentation. Future commits will base animation updates and touchless gestures like fling off these vsync events. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* android: Remove unused imports in android.rs (#33218)Jonathan Schwender2024-08-281-2/+0
| | | Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* ohos/android: Redirect stdout/stderr to `log` sink (#32858)Jonathan Schwender2024-08-151-86/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ohos: redirect stdout/stderr to logging sink Based on the existing android `redirect_stdout_to_logcat` implementation, but using the safe abstractions from `nix` and dumping to the `log` sink, instead of directly writing the log. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * android: Use new shared implementation for logcat redirection. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * servoshell: Register cfg(production) Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Update ports/servoshell/egl/log.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> * Change info! to debug! to match original behavior on android Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Add OpenHarmony support to servoshell (#32594)Jonathan Schwender2024-06-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Generate EGL bindings for ohos Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Adjust servoshell `bin` error message for android/ohos Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * ohos: disable WebGL offscreen buffers are not implemented yet on ohos. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Add OpenHarmony support to servoshell Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Share ResourceReaderInstance Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Share android/ohos HostTrait Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Share servo glue Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Pass Init options from ArkTS to Servo Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * f rebase ResourceReaderMethods Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * fixup! Share ResourceReaderInstance Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Fix typo Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Update Cargo.lock Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * ohos: Move WebGL check to webgl thread Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Remove commented code Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Remove commented and duplicate / unused code Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Replace null-byte terminated string literals with C-string literals (#32631)Mu Xian Ming2024-06-281-2/+2
| | | | Signed-off-by: Mu Xianming <mu.xianming@lmwn.com> Co-authored-by: Mu Xianming <mu.xianming@lmwn.com>
* android: Rename the Android app to reflect servo.org ownership and ↵Martin Robinson2024-06-241-28/+28
| | | | | `servoshell` (#32554) Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Move android port code to servoshell (#32533)Jonathan Schwender2024-06-191-0/+941
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>