gfx/skia/patches/archive/0006-Bug-751814-ARM-EDSP-ARMv6-Skia-fixes.patch

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 From 94916fbbc7865c6fe23a57d6edc48c6daf93dda8 Mon Sep 17 00:00:00 2001
     2 From: George Wright <gwright@mozilla.com>
     3 Date: Fri, 18 May 2012 14:16:08 -0400
     4 Subject: [PATCH 06/10]     Bug 755869 - [9] Re-apply bug 751814 - Various
     5  Skia fixes for ARM without EDSP and ARMv6+
     6  r=mattwoodrow
     8 ---
     9  gfx/skia/include/core/SkMath.h                   |    5 +--
    10  gfx/skia/include/core/SkPostConfig.h             |   45 ++++++++++++++++++++++
    11  gfx/skia/src/opts/SkBitmapProcState_opts_arm.cpp |    6 +-
    12  gfx/skia/src/opts/SkBlitRow_opts_arm.cpp         |    9 ++++
    13  4 files changed, 58 insertions(+), 7 deletions(-)
    15 diff --git a/gfx/skia/include/core/SkMath.h b/gfx/skia/include/core/SkMath.h
    16 index 5889103..7a4b707 100644
    17 --- a/gfx/skia/include/core/SkMath.h
    18 +++ b/gfx/skia/include/core/SkMath.h
    19 @@ -153,10 +153,7 @@ static inline bool SkIsPow2(int value) {
    20      With this requirement, we can generate faster instructions on some
    21      architectures.
    22  */
    23 -#if defined(__arm__) \
    24 -  && !defined(__thumb__) \
    25 -  && !defined(__ARM_ARCH_4T__) \
    26 -  && !defined(__ARM_ARCH_5T__)
    27 +#ifdef SK_ARM_HAS_EDSP
    28      static inline int32_t SkMulS16(S16CPU x, S16CPU y) {
    29          SkASSERT((int16_t)x == x);
    30          SkASSERT((int16_t)y == y);
    31 diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h
    32 index 041fe2a..03105e4 100644
    33 --- a/gfx/skia/include/core/SkPostConfig.h
    34 +++ b/gfx/skia/include/core/SkPostConfig.h
    35 @@ -311,3 +311,48 @@
    36  #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
    37  #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 1
    38  #endif
    39 +
    40 +//////////////////////////////////////////////////////////////////////
    41 +// ARM defines
    42 +
    43 +#if defined(__GNUC__) && defined(__arm__)
    44 +
    45 +#  define SK_ARM_ARCH 3
    46 +
    47 +#  if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) \
    48 +   || defined(_ARM_ARCH_4)
    49 +#    undef SK_ARM_ARCH
    50 +#    define SK_ARM_ARCH 4
    51 +#  endif
    52 +
    53 +#  if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
    54 +   || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
    55 +   || defined(__ARM_ARCH_5TEJ__) || defined(_ARM_ARCH_5)
    56 +#    undef SK_ARM_ARCH
    57 +#    define SK_ARM_ARCH 5
    58 +#  endif
    59 + 
    60 +#  if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
    61 +   || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
    62 +   || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
    63 +   || defined(__ARM_ARCH_6M__) || defined(_ARM_ARCH_6)
    64 +#    undef SK_ARM_ARCH
    65 +#    define SK_ARM_ARCH 6
    66 +#  endif
    67 +
    68 +#  if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
    69 +   || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
    70 +   || defined(__ARM_ARCH_7EM__) || defined(_ARM_ARCH_7)
    71 +#    undef SK_ARM_ARCH
    72 +#    define SK_ARM_ARCH 7
    73 +#  endif
    74 +
    75 +#  undef SK_ARM_HAS_EDSP
    76 +#  if defined(__thumb2__) && (SK_ARM_ARCH >= 6) \
    77 +   || !defined(__thumb__) \
    78 +   && ((SK_ARM_ARCH > 5) || defined(__ARM_ARCH_5E__) \
    79 +       || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__))
    80 +#    define SK_ARM_HAS_EDSP 1
    81 +#  endif
    82 +
    83 +#endif
    84 diff --git a/gfx/skia/src/opts/SkBitmapProcState_opts_arm.cpp b/gfx/skia/src/opts/SkBitmapProcState_opts_arm.cpp
    85 index 20d62e1..deb1bfe 100644
    86 --- a/gfx/skia/src/opts/SkBitmapProcState_opts_arm.cpp
    87 +++ b/gfx/skia/src/opts/SkBitmapProcState_opts_arm.cpp
    88 @@ -11,7 +11,7 @@
    89  #include "SkColorPriv.h"
    90  #include "SkUtils.h"
    92 -#if __ARM_ARCH__ >= 6 && !defined(SK_CPU_BENDIAN)
    93 +#if SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN)
    94  void SI8_D16_nofilter_DX_arm(
    95      const SkBitmapProcState& s,
    96      const uint32_t* SK_RESTRICT xy,
    97 @@ -182,7 +182,7 @@ void SI8_opaque_D32_nofilter_DX_arm(const SkBitmapProcState& s,
    99      s.fBitmap->getColorTable()->unlockColors(false);
   100  }
   101 -#endif //__ARM_ARCH__ >= 6 && !defined(SK_CPU_BENDIAN)
   102 +#endif // SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN)
   104  ///////////////////////////////////////////////////////////////////////////////
   106 @@ -200,7 +200,7 @@ void SkBitmapProcState::platformProcs() {
   108      switch (fBitmap->config()) {
   109          case SkBitmap::kIndex8_Config:
   110 -#if __ARM_ARCH__ >= 6 && !defined(SK_CPU_BENDIAN)
   111 +#if SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN)
   112              if (justDx && !doFilter) {
   113  #if 0   /* crashing on android device */
   114                  fSampleProc16 = SI8_D16_nofilter_DX_arm;
   115 diff --git a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
   116 index 2490371..c928888 100644
   117 --- a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
   118 +++ b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
   119 @@ -675,8 +675,13 @@ static void __attribute((noinline,optimize("-fomit-frame-pointer"))) S32A_Blend_
   120                    /* dst1_scale and dst2_scale*/
   121                    "lsr    r9, r5, #24                \n\t" /* src >> 24 */
   122                    "lsr    r10, r6, #24               \n\t" /* src >> 24 */
   123 +#ifdef SK_ARM_HAS_EDSP
   124                    "smulbb r9, r9, %[alpha]           \n\t" /* r9 = SkMulS16 r9 with src_scale */
   125                    "smulbb r10, r10, %[alpha]         \n\t" /* r10 = SkMulS16 r10 with src_scale */
   126 +#else
   127 +                  "mul    r9, r9, %[alpha]           \n\t" /* r9 = SkMulS16 r9 with src_scale */
   128 +                  "mul    r10, r10, %[alpha]         \n\t" /* r10 = SkMulS16 r10 with src_scale */
   129 +#endif
   130                    "lsr    r9, r9, #8                 \n\t" /* r9 >> 8 */
   131                    "lsr    r10, r10, #8               \n\t" /* r10 >> 8 */
   132                    "rsb    r9, r9, #256               \n\t" /* dst1_scale = r9 = 255 - r9 + 1 */
   133 @@ -745,7 +750,11 @@ static void __attribute((noinline,optimize("-fomit-frame-pointer"))) S32A_Blend_
   135                    "lsr    r6, r5, #24                \n\t" /* src >> 24 */
   136                    "and    r8, r12, r5, lsr #8        \n\t" /* ag = r8 = r5 masked by r12 lsr by #8 */
   137 +#ifdef SK_ARM_HAS_EDSP
   138                    "smulbb r6, r6, %[alpha]           \n\t" /* r6 = SkMulS16 with src_scale */
   139 +#else
   140 +                  "mul    r6, r6, %[alpha]           \n\t" /* r6 = SkMulS16 with src_scale */
   141 +#endif
   142                    "and    r9, r12, r5                \n\t" /* rb = r9 = r5 masked by r12 */
   143                    "lsr    r6, r6, #8                 \n\t" /* r6 >> 8 */
   144                    "mul    r8, r8, %[alpha]           \n\t" /* ag = r8 times scale */
   145 -- 
   146 1.7.5.4

mercurial