aboutsummaryrefslogtreecommitdiff
path: root/core/image
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-07-08 21:07:53 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2024-07-08 21:07:53 +0200
commit2d8d0dd8515a4598d6e027f28818614c117ae0c4 (patch)
treecf038003add5ddda2ef71395fe78a801c8a2abb0 /core/image
parent1a20b78633038614635da99b5e634015d4ce7d6e (diff)
fix `@(optimization_mode)` usage in builtin collections
Diffstat (limited to 'core/image')
-rw-r--r--core/image/bmp/bmp.odin4
-rw-r--r--core/image/common.odin6
-rw-r--r--core/image/qoi/qoi.odin4
3 files changed, 7 insertions, 7 deletions
diff --git a/core/image/bmp/bmp.odin b/core/image/bmp/bmp.odin
index a50ad8996..057c2ffa0 100644
--- a/core/image/bmp/bmp.odin
+++ b/core/image/bmp/bmp.odin
@@ -122,7 +122,7 @@ load_from_bytes :: proc(data: []byte, options := Options{}, allocator := context
return img, err
}
-@(optimization_mode="speed")
+@(optimization_mode="favor_size")
load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.allocator) -> (img: ^Image, err: Error) {
context.allocator = allocator
options := options
@@ -743,4 +743,4 @@ destroy :: proc(img: ^Image) {
@(init, private)
_register :: proc() {
image.register(.BMP, load_from_bytes, destroy)
-} \ No newline at end of file
+}
diff --git a/core/image/common.odin b/core/image/common.odin
index 07152e7db..2b1f71711 100644
--- a/core/image/common.odin
+++ b/core/image/common.odin
@@ -1376,7 +1376,7 @@ expand_grayscale :: proc(img: ^Image, allocator := context.allocator) -> (ok: bo
/*
Helper functions to read and write data from/to a Context, etc.
*/
-@(optimization_mode="speed")
+@(optimization_mode="favor_size")
read_data :: proc(z: $C, $T: typeid) -> (res: T, err: compress.General_Error) {
if r, e := compress.read_data(z, T); e != .None {
return {}, .Stream_Too_Short
@@ -1385,7 +1385,7 @@ read_data :: proc(z: $C, $T: typeid) -> (res: T, err: compress.General_Error) {
}
}
-@(optimization_mode="speed")
+@(optimization_mode="favor_size")
read_u8 :: proc(z: $C) -> (res: u8, err: compress.General_Error) {
if r, e := compress.read_u8(z); e != .None {
return {}, .Stream_Too_Short
@@ -1405,4 +1405,4 @@ write_bytes :: proc(buf: ^bytes.Buffer, data: []u8) -> (err: compress.General_Er
return .Resize_Failed
}
return nil
-} \ No newline at end of file
+}
diff --git a/core/image/qoi/qoi.odin b/core/image/qoi/qoi.odin
index 989e7ca6e..5cf252fcc 100644
--- a/core/image/qoi/qoi.odin
+++ b/core/image/qoi/qoi.odin
@@ -170,7 +170,7 @@ load_from_bytes :: proc(data: []byte, options := Options{}, allocator := context
return img, err
}
-@(optimization_mode="speed")
+@(optimization_mode="favor_size")
load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.allocator) -> (img: ^Image, err: Error) {
context.allocator = allocator
options := options
@@ -373,4 +373,4 @@ qoi_hash :: #force_inline proc(pixel: RGBA_Pixel) -> (index: u8) {
@(init, private)
_register :: proc() {
image.register(.QOI, load_from_bytes, destroy)
-} \ No newline at end of file
+}