Skip to content

Commit c608732

Browse files
committed
chore(canvas-native): format
1 parent 36a27c8 commit c608732

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+359
-401
lines changed

packages/canvas/src-native/canvas-native/canvas-core/Cargo.lock

Lines changed: 234 additions & 234 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/canvas/src-native/canvas-native/canvas-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ lazy_static = "1.4.0"
2424
css-color-parser = "0.1.2"
2525
reqwest = { version = "0.11", features = ["blocking"] }
2626
openssl = { version = "0.10", features = ["vendored"] }
27-
phf = {version = "0.8.0", features = ["macros"]}
27+
phf = { version = "0.8.0", features = ["macros"] }
2828
rgb = "0.8.25"
2929
log = "0.4.8"
3030
stringreader = "0.1.1"

packages/canvas/src-native/canvas-native/canvas-core/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use std::{env, fmt};
12
use std::borrow::Borrow;
23
use std::fmt::{Display, Formatter};
34
use std::path::PathBuf;
4-
use std::{env, fmt};
55

66
use bindgen;
77

@@ -88,7 +88,7 @@ fn main() {
8888
println!("cargo:rustc-link-search=native={}", include_dir);
8989
println!("cargo:rustc-link-lib=jnigraphics"); // the "-l" flag
9090
println!("cargo:rustc-link-lib=android"); // the "-l" flag
91-
// the resulting bindings.
91+
// the resulting bindings.
9292
let bindings = bindgen::Builder::default()
9393
// The input header we would like to generate
9494
// bindings for.

packages/canvas/src-native/canvas-native/canvas-core/src/android/context.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
use std::str::FromStr;
22

33
use jni::errors::Error;
4+
use jni::JNIEnv;
45
use jni::objects::{JClass, JObject, JString, JValue, ReleaseMode};
56
use jni::sys::{
6-
jboolean, jbyteArray, jfloat, jfloatArray, jint, jlong, jobject, jstring, JNI_FALSE, JNI_TRUE,
7+
jboolean, jbyteArray, jfloat, jfloatArray, jint, jlong, JNI_FALSE, JNI_TRUE, jobject, jstring,
78
};
8-
use jni::JNIEnv;
99
use skia_safe::Rect;
1010

1111
use crate::common::context::compositing::composite_operation_type::CompositeOperationType;
12+
use crate::common::context::Context;
1213
use crate::common::context::drawing_paths::fill_rule::FillRule;
1314
use crate::common::context::fill_and_stroke_styles::paint::PaintStyle;
1415
use crate::common::context::fill_and_stroke_styles::pattern::Repetition;
@@ -22,7 +23,6 @@ use crate::common::context::pixel_manipulation::image_data::ImageData;
2223
use crate::common::context::text_styles::text_align::TextAlign;
2324
use crate::common::context::text_styles::text_baseline::TextBaseLine;
2425
use crate::common::context::text_styles::text_direction::TextDirection;
25-
use crate::common::context::Context;
2626
use crate::common::ffi::paint_style_value::{PaintStyleValue, PaintStyleValueType};
2727
use crate::common::utils::color::to_parsed_color;
2828
use crate::common::utils::image::{from_image_slice, from_image_slice_encoded, to_image};
@@ -121,14 +121,14 @@ fn get_style(env: JNIEnv, context: jlong, is_fill: bool) -> jobject {
121121
"(Ljava/lang/String;J)Lorg/json/JSONObject;",
122122
value_args.as_slice(),
123123
)
124-
.unwrap();
124+
.unwrap();
125125
env.call_method(
126126
json,
127127
"put",
128128
"(Ljava/lang/String;I)Lorg/json/JSONObject;",
129129
value_type_args.as_slice(),
130130
)
131-
.unwrap();
131+
.unwrap();
132132
json.into_inner()
133133
}
134134
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pub(crate) mod surface_texture;
2-
mod texture_render;
2+
pub mod texture_render;
33
pub mod webgl2_rendering_context;
44
pub mod webgl_rendering_context;

packages/canvas/src-native/canvas-native/canvas-core/src/android/gl/surface_texture.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern "system" {
2525
#[doc = " \\param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture()"]
2626
pub fn ASurfaceTexture_release(st: *mut ASurfaceTexture);
2727
}
28+
2829
extern "system" {
2930
#[doc = " Returns a reference to an ANativeWindow (i.e. the Producer) for this SurfaceTexture."]
3031
#[doc = " This is equivalent to Java's: Surface sur = new Surface(surfaceTexture);"]
@@ -37,6 +38,7 @@ extern "system" {
3738
#[doc = " returned if \\p st is null or if it's not an instance of android.graphics.SurfaceTexture"]
3839
pub fn ASurfaceTexture_acquireANativeWindow(st: *mut ASurfaceTexture) -> *mut ANativeWindow;
3940
}
41+
4042
extern "system" {
4143
#[doc = " Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread. A"]
4244
#[doc = " new OpenGL ES texture object is created and populated with the SurfaceTexture image frame"]
@@ -58,6 +60,7 @@ extern "system" {
5860
texName: u32,
5961
) -> ::std::os::raw::c_int;
6062
}
63+
6164
extern "system" {
6265
#[doc = " Detach the SurfaceTexture from the OpenGL ES context that owns the OpenGL ES texture object."]
6366
#[doc = " This call must be made with the OpenGL ES context current on the calling thread. The OpenGL"]
@@ -75,6 +78,7 @@ extern "system" {
7578
#[doc = " \\return 0 on success, negative posix error code otherwise (see <errno.h>)"]
7679
pub fn ASurfaceTexture_detachFromGLContext(st: *mut ASurfaceTexture) -> ::std::os::raw::c_int;
7780
}
81+
7882
extern "system" {
7983
#[doc = " Update the texture image to the most recent frame from the image stream. This may only be"]
8084
#[doc = " called while the OpenGL ES context that owns the texture is current on the calling thread."]
@@ -86,6 +90,7 @@ extern "system" {
8690
#[doc = " \\return 0 on success, negative posix error code otherwise (see <errno.h>)"]
8791
pub fn ASurfaceTexture_updateTexImage(st: *mut ASurfaceTexture) -> ::std::os::raw::c_int;
8892
}
93+
8994
extern "system" {
9095
#[doc = " Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by"]
9196
#[doc = " the most recent call to updateTexImage."]
@@ -105,6 +110,7 @@ extern "system" {
105110
#[doc = " 16 elements."]
106111
pub fn ASurfaceTexture_getTransformMatrix(st: *mut ASurfaceTexture, mtx: *mut f32);
107112
}
113+
108114
extern "system" {
109115
#[doc = " Retrieve the timestamp associated with the texture image set by the most recent call to"]
110116
#[doc = " updateTexImage."]

packages/canvas/src-native/canvas-native/canvas-core/src/android/gl/texture_render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::os::raw::c_void;
22

3+
use jni::JNIEnv;
34
use jni::objects::{JClass, JObject, ReleaseMode};
45
use jni::sys::{jboolean, jfloatArray, jint};
5-
use jni::JNIEnv;
66

77
const SURFACE_TEXTURE_CLASS: &'static str = "android/graphics/SurfaceTexture";
88

packages/canvas/src-native/canvas-native/canvas-core/src/android/gl/webgl2_rendering_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
use std::os::raw::c_void;
66

7+
use jni::JNIEnv;
78
use jni::objects::{JByteBuffer, JClass, JObject, ReleaseMode};
89
use jni::sys::{
910
jboolean, jbyteArray, jdouble, jdoubleArray, jfloatArray, jint, jintArray, jlong, jlongArray,
10-
jshortArray, JNI_TRUE,
11+
JNI_TRUE, jshortArray,
1112
};
12-
use jni::JNIEnv;
1313

1414
use crate::common::context::image_asset::ImageAsset;
1515

packages/canvas/src-native/canvas-native/canvas-core/src/android/gl/webgl_rendering_context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use std::os::raw::c_void;
66

77
use jni::errors::Error;
8+
use jni::JNIEnv;
89
use jni::objects::{AutoPrimitiveArray, JByteBuffer, JClass, JObject, ReleaseMode};
910
use jni::sys::{
10-
jboolean, jbyteArray, jfloatArray, jint, jintArray, jlong, jobject, jshortArray, JNI_TRUE,
11+
jboolean, jbyteArray, jfloatArray, jint, jintArray, jlong, JNI_TRUE, jobject, jshortArray,
1112
};
12-
use jni::JNIEnv;
1313
use skia_safe::RCHandle;
1414

1515
use crate::common::context::image_asset::ImageAsset;

packages/canvas/src-native/canvas-native/canvas-core/src/android/gradient.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::ffi::CStr;
22
use std::os::raw::{c_char, c_float, c_longlong};
33

4-
use jni::objects::{JClass, JString};
54
use jni::JNIEnv;
5+
use jni::objects::{JClass, JString};
66

77
use crate::common::context::fill_and_stroke_styles::paint::PaintStyle;
88

0 commit comments

Comments
 (0)