mozilla-bmo1005535.patch
branchfirefox37
changeset 844 86fa73db98e5
child 869 0dd25a92df97
equal deleted inserted replaced
843:0d861c33ec70 844:86fa73db98e5
       
     1 # HG changeset patch
       
     2 # Parent b7eb1ce0237d6125b75bc8ff1cb3afc328d6e78c
       
     3 # User Steve Singer <steve@ssinger.info>
       
     4 # Parent  d7af74fb513bcca581012f17ea248b1692db5d97
       
     5 Bug 1005535 - Get skia GPU building on big endian.
       
     6 
       
     7 diff --git a/configure.in b/configure.in
       
     8 --- a/configure.in
       
     9 +++ b/configure.in
       
    10 @@ -8198,21 +8198,21 @@ dnl Skia
       
    11  dnl ========================================================
       
    12  if test "$MOZ_ENABLE_SKIA"; then
       
    13    AC_DEFINE(MOZ_ENABLE_SKIA)
       
    14    AC_DEFINE(USE_SKIA)
       
    15    if test "${MOZ_WIDGET_TOOLKIT}" = "android" -o x"$MOZ_WIDGET_TOOLKIT" = x"gonk"; then
       
    16      AC_DEFINE(SK_BUILD_FOR_ANDROID_NDK)
       
    17    fi
       
    18  
       
    19 -  if test "${CPU_ARCH}" != "ppc" -a "${CPU_ARCH}" != "ppc64" -a "${CPU_ARCH}" != "sparc" -a -z "$MOZ_DISABLE_SKIA_GPU" ; then
       
    20 +  #if test "${CPU_ARCH}" != "ppc" -a "${CPU_ARCH}" != "ppc64" -a "${CPU_ARCH}" != "sparc" -a -z "$MOZ_DISABLE_SKIA_GPU" ; then
       
    21      MOZ_ENABLE_SKIA_GPU=1
       
    22      AC_DEFINE(USE_SKIA_GPU)
       
    23      AC_SUBST(MOZ_ENABLE_SKIA_GPU)
       
    24 -  fi
       
    25 +  #fi
       
    26  fi
       
    27  AC_SUBST(MOZ_ENABLE_SKIA)
       
    28  
       
    29  dnl ========================================================
       
    30  dnl Check for nss-shared-helper
       
    31  dnl ========================================================
       
    32  
       
    33    PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper,
       
    34 diff --git a/gfx/skia/trunk/include/config/SkUserConfig.h b/gfx/skia/trunk/include/config/SkUserConfig.h
       
    35 --- a/gfx/skia/trunk/include/config/SkUserConfig.h
       
    36 +++ b/gfx/skia/trunk/include/config/SkUserConfig.h
       
    37 @@ -192,16 +192,17 @@
       
    38  
       
    39  #if defined(SK_CPU_ARM32) || defined(SK_CPU_ARM64)
       
    40  #  define SK_BARRIERS_PLATFORM_H "skia/SkBarriers_arm.h"
       
    41  #else
       
    42  #  define SK_BARRIERS_PLATFORM_H "skia/SkBarriers_x86.h"
       
    43  #endif
       
    44  
       
    45  // On all platforms we have this byte order
       
    46 +
       
    47  #define SK_A32_SHIFT 24
       
    48  #define SK_R32_SHIFT 16
       
    49  #define SK_G32_SHIFT 8
       
    50  #define SK_B32_SHIFT 0
       
    51  
       
    52  #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
       
    53  
       
    54  #define SK_SUPPORT_LEGACY_GETDEVICE
       
    55 diff --git a/gfx/skia/trunk/include/core/SkColorPriv.h b/gfx/skia/trunk/include/core/SkColorPriv.h
       
    56 --- a/gfx/skia/trunk/include/core/SkColorPriv.h
       
    57 +++ b/gfx/skia/trunk/include/core/SkColorPriv.h
       
    58 @@ -27,37 +27,27 @@
       
    59   *  For easier compatibility with Skia's GPU backend, we further restrict these
       
    60   *  to either (in memory-byte-order) RGBA or BGRA. Note that this "order" does
       
    61   *  not directly correspond to the same shift-order, since we have to take endianess
       
    62   *  into account.
       
    63   *
       
    64   *  Here we enforce this constraint.
       
    65   */
       
    66  
       
    67 -#ifdef SK_CPU_BENDIAN
       
    68 -    #define SK_RGBA_R32_SHIFT   24
       
    69 -    #define SK_RGBA_G32_SHIFT   16
       
    70 -    #define SK_RGBA_B32_SHIFT   8
       
    71 -    #define SK_RGBA_A32_SHIFT   0
       
    72  
       
    73 -    #define SK_BGRA_B32_SHIFT   24
       
    74 -    #define SK_BGRA_G32_SHIFT   16
       
    75 -    #define SK_BGRA_R32_SHIFT   8
       
    76 -    #define SK_BGRA_A32_SHIFT   0
       
    77 -#else
       
    78      #define SK_RGBA_R32_SHIFT   0
       
    79      #define SK_RGBA_G32_SHIFT   8
       
    80      #define SK_RGBA_B32_SHIFT   16
       
    81      #define SK_RGBA_A32_SHIFT   24
       
    82  
       
    83      #define SK_BGRA_B32_SHIFT   0
       
    84      #define SK_BGRA_G32_SHIFT   8
       
    85      #define SK_BGRA_R32_SHIFT   16
       
    86      #define SK_BGRA_A32_SHIFT   24
       
    87 -#endif
       
    88 +
       
    89  
       
    90  #if defined(SK_PMCOLOR_IS_RGBA) && defined(SK_PMCOLOR_IS_BGRA)
       
    91      #error "can't define PMCOLOR to be RGBA and BGRA"
       
    92  #endif
       
    93  
       
    94  #define LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA  \
       
    95      (SK_A32_SHIFT == SK_RGBA_A32_SHIFT &&    \
       
    96       SK_R32_SHIFT == SK_RGBA_R32_SHIFT &&    \
       
    97 diff --git a/gfx/skia/trunk/include/core/SkImageInfo.h b/gfx/skia/trunk/include/core/SkImageInfo.h
       
    98 --- a/gfx/skia/trunk/include/core/SkImageInfo.h
       
    99 +++ b/gfx/skia/trunk/include/core/SkImageInfo.h
       
   100 @@ -83,19 +83,20 @@ enum SkColorType {
       
   101  
       
   102      kLastEnum_SkColorType = kIndex_8_SkColorType,
       
   103  
       
   104  #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
       
   105      kN32_SkColorType = kBGRA_8888_SkColorType,
       
   106  #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
       
   107      kN32_SkColorType = kRGBA_8888_SkColorType,
       
   108  #else
       
   109 -#error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order"
       
   110 +     kN32_SkColorType = kBGRA_8888_SkColorType
       
   111  #endif
       
   112  
       
   113 +
       
   114  #ifdef SK_SUPPORT_LEGACY_N32_NAME
       
   115      kPMColor_SkColorType = kN32_SkColorType
       
   116  #endif
       
   117  };
       
   118  
       
   119  static int SkColorTypeBytesPerPixel(SkColorType ct) {
       
   120      static const uint8_t gSize[] = {
       
   121          0,  // Unknown
       
   122 diff --git a/gfx/skia/trunk/include/gpu/GrTypes.h b/gfx/skia/trunk/include/gpu/GrTypes.h
       
   123 --- a/gfx/skia/trunk/include/gpu/GrTypes.h
       
   124 +++ b/gfx/skia/trunk/include/gpu/GrTypes.h
       
   125 @@ -304,25 +304,23 @@ enum GrPixelConfig {
       
   126       * Byte order is r, g, b, a.  This color format is 32 bits per channel
       
   127       */
       
   128      kRGBA_float_GrPixelConfig,
       
   129      kLast_GrPixelConfig = kRGBA_float_GrPixelConfig
       
   130  };
       
   131  static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
       
   132  
       
   133  // Aliases for pixel configs that match skia's byte order.
       
   134 -#ifndef SK_CPU_LENDIAN
       
   135 -    #error "Skia gpu currently assumes little endian"
       
   136 -#endif
       
   137 +
       
   138  #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
       
   139      static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
       
   140  #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
       
   141      static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfig;
       
   142  #else
       
   143 -    #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
       
   144 +    static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
       
   145  #endif
       
   146  
       
   147  // Returns true if the pixel config is a GPU-specific compressed format
       
   148  // representation.
       
   149  static inline bool GrPixelConfigIsCompressed(GrPixelConfig config) {
       
   150      switch (config) {
       
   151          case kETC1_GrPixelConfig:
       
   152          case kLATC_GrPixelConfig: