[librsvg/wip/aruiz/rust-pixbuf-loader: 173/188] use different values for different channels to ensure pixel order
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/wip/aruiz/rust-pixbuf-loader: 173/188] use different values for different channels to ensure pixel order
- Date: Tue, 6 Sep 2022 01:19:41 +0000 (UTC)
commit 60c6a5377ee1c62fdfb8a2e57bff5282d09b9fe7
Author: Alberto Ruiz <aruiz redhat com>
Date: Fri Jul 29 00:16:05 2022 +0100
use different values for different channels to ensure pixel order
gdk-pixbuf-loader/src/lib.rs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gdk-pixbuf-loader/src/lib.rs b/gdk-pixbuf-loader/src/lib.rs
index e24f784be..ac6770c90 100644
--- a/gdk-pixbuf-loader/src/lib.rs
+++ b/gdk-pixbuf-loader/src/lib.rs
@@ -341,7 +341,7 @@ mod tests {
xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs2" />
<g id="layer1">
- <rect style="fill:#000000;stroke-width:0.130147" id="rect31"
+ <rect style="fill:#aa1144;stroke-width:0.130147" id="rect31"
width="26.458334" height="26.458334"
x="-3.1789145e-07" y="-3.1789145e-07" />
</g>
@@ -366,15 +366,15 @@ mod tests {
let pixels = gdk_pixbuf_sys::gdk_pixbuf_get_pixels(pb);
// Upper left pixel, black with full opacity #000000ff
- assert_eq!(*pixels, 0x00);
- assert_eq!(*pixels.offset(1), 0x00);
- assert_eq!(*pixels.offset(2), 0x00);
+ assert_eq!(*pixels, 0xaa);
+ assert_eq!(*pixels.offset(1), 0x11);
+ assert_eq!(*pixels.offset(2), 0x44);
assert_eq!(*pixels.offset(3), 0xff);
// Bottom left pixel
- assert_eq!(*pixels.offset((stride * 99) as isize), 0x00);
- assert_eq!(*pixels.offset((stride * 99) as isize + 1), 0x00);
- assert_eq!(*pixels.offset((stride * 99) as isize + 2), 0x00);
+ assert_eq!(*pixels.offset((stride * 99) as isize), 0xaa);
+ assert_eq!(*pixels.offset((stride * 99) as isize + 1), 0x11);
+ assert_eq!(*pixels.offset((stride * 99) as isize + 2), 0x44);
assert_eq!(*pixels.offset((stride * 99) as isize + 3), 0xff);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]