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.

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

mercurial