-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
956 additions
and
416 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/canvas/src-native/canvas-native/.idea/dictionaries/triniwiz.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
2 changes: 0 additions & 2 deletions
2
packages/canvas/src-native/canvas-native/canvas-2d/src/lib.rs
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
9 changes: 9 additions & 0 deletions
9
packages/canvas/src-native/canvas-native/canvas-c/cbindgen.toml
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,9 @@ | ||
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" | ||
language = "C" | ||
namespace = "ffi" | ||
include_guard = "CBINDGEN_BINDINGS_H" | ||
|
||
[defines] | ||
"target_os = ios" = "TARGET_OS_IOS" | ||
"target_os = macos" = "TARGET_OS_MACOS" | ||
"target_os = android" = "TARGET_OS_ANDROID" |
118 changes: 118 additions & 0 deletions
118
packages/canvas/src-native/canvas-native/canvas-c/src/buffers.rs
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,118 @@ | ||
use bytes::{Bytes, BytesMut}; | ||
|
||
pub struct U8BufferMut(BytesMut); | ||
|
||
impl Default for U8BufferMut { | ||
fn default() -> Self { | ||
Self(BytesMut::default()) | ||
} | ||
} | ||
|
||
#[derive(Clone)] | ||
pub struct U8Buffer(Bytes); | ||
|
||
impl U8Buffer { | ||
pub fn get_buffer(&self) -> &[u8] { | ||
self.0.as_ref() | ||
} | ||
} | ||
|
||
impl Default for U8Buffer { | ||
fn default() -> Self { | ||
Self(Bytes::default()) | ||
} | ||
} | ||
|
||
impl From<Vec<u8>> for U8Buffer { | ||
fn from(value: Vec<u8>) -> Self { | ||
U8Buffer(bytes::Bytes::from(value)) | ||
} | ||
} | ||
|
||
pub struct U16Buffer(Vec<u16>); | ||
|
||
impl U16Buffer { | ||
pub fn get_buffer(&self) -> &[u16] { | ||
self.0.as_slice() | ||
} | ||
} | ||
|
||
impl Default for U16Buffer { | ||
fn default() -> Self { | ||
Self(Vec::new()) | ||
} | ||
} | ||
|
||
impl From<Vec<u16>> for U16Buffer { | ||
fn from(value: Vec<u16>) -> Self { | ||
Self(value) | ||
} | ||
} | ||
|
||
pub struct F32Buffer(Vec<f32>); | ||
|
||
impl F32Buffer { | ||
pub fn get_buffer(&self) -> &[f32] { | ||
self.0.as_slice() | ||
} | ||
} | ||
|
||
impl Default for F32Buffer { | ||
fn default() -> Self { | ||
Self(Vec::new()) | ||
} | ||
} | ||
|
||
impl From<Vec<f32>> for F32Buffer { | ||
fn from(value: Vec<f32>) -> Self { | ||
Self(value) | ||
} | ||
} | ||
|
||
pub struct I32Buffer(Vec<i32>); | ||
|
||
impl I32Buffer { | ||
pub fn get_buffer(&self) -> &[i32] { | ||
self.0.as_slice() | ||
} | ||
} | ||
|
||
impl Default for I32Buffer { | ||
fn default() -> Self { | ||
Self(Vec::new()) | ||
} | ||
} | ||
|
||
impl From<Vec<i32>> for I32Buffer { | ||
fn from(value: Vec<i32>) -> Self { | ||
Self(value) | ||
} | ||
} | ||
|
||
pub struct U32Buffer(Vec<u32>); | ||
|
||
impl U32Buffer { | ||
pub fn get_buffer(&self) -> &[u32] { | ||
self.0.as_slice() | ||
} | ||
} | ||
|
||
impl Default for U32Buffer { | ||
fn default() -> Self { | ||
Self(Vec::new()) | ||
} | ||
} | ||
|
||
impl From<Vec<u32>> for U32Buffer { | ||
fn from(value: Vec<u32>) -> Self { | ||
Self(value) | ||
} | ||
} | ||
|
||
pub struct StringBuffer(Vec<String>); | ||
|
||
impl From<Vec<String>> for StringBuffer { | ||
fn from(value: Vec<String>) -> Self { | ||
Self(value) | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.