Permalink
Browse files

Qt specific hack: Qt uses different byte ordering than Skia.

Set offsets to make things visually correct.

Reviewed-by: John Brooks <john.brooks@dereferenced.net>
  • Loading branch information...
rburchell committed Nov 12, 2010
1 parent f99d33e commit 7530425f0ef6e39a0ee666daaff0c18029fee5dd
Showing with 18 additions and 0 deletions.
  1. +18 −0 include/config/SkUserConfig.h
@@ -42,6 +42,24 @@
commented out, so including it will have no effect.
*/
+#ifndef SK_A32_SHIFT
+ // Qt hack: match Qt's byte ordering.
+ // | Little | Big
+ // Qt | BGRA | ARGB
+ // Skia | RGBA | RGBA
+ #ifdef SK_CPU_BENDIAN
+ #define SK_R32_SHIFT 16
+ #define SK_G32_SHIFT 8
+ #define SK_B32_SHIFT 0
+ #define SK_A32_SHIFT 24
+ #else
+ #define SK_R32_SHIFT 16
+ #define SK_G32_SHIFT 8
+ #define SK_B32_SHIFT 0
+ #define SK_A32_SHIFT 24
+ #endif
+#endif
+
///////////////////////////////////////////////////////////////////////////////
/* Scalars (the fractional value type in skia) can be implemented either as

0 comments on commit 7530425

Please sign in to comment.