Skia: Add NEON intrinsic D32_A8_Black and D32_A8_Opaque

If NEON support is indiciated via __ARM_HAVE_NEON flag then use
an optimized NEON intrinsics version of the D32_A8_Black and D32_A8_Opaque
masking function.

Change-Id: I20d2bf15515d960b73e635784a0daf29302e1f12
SkLanguage and SkPaintOptionsAndroid optimization

(1) Global linked list to manage SkLanguage and SkPaintOptionsAndroid
    objects
(2) All copy constructor overheads associated with above classes are
    changed to simple pointer assignment
(3) All string related operations in SkLanguage class are replaced with
    simple pointer manipulation. Also saving on string allocations.
(4) SkLangList and SkPaintOptionsAndroidList are 2 new classes created
    to manage the global linked list
(5) SkLanguages and SkPaintOptionsAndroids are 2 new singleton classes
    created to work with the global linked list class (See 4)

Change-Id: Id1d8357569e79f7e3da403b56a08db937afb07eb
SkDraw::drawRect optimization

New class in SkDeviceLooper.cpp falls in in the critical code path of
SkDraw::drawRect().  This new class SkDeviceLooper does nothing except
for bound checking. It copies the modified rect bounds into new pointer
variables and returns them back "if needed". The additional overhead of
creating an object of SkDeviceLooper class and calling member functions
reduces performance.  This patch creates a pre-check condition and if
it succeeds we know for sure SkDeviceLooper won't change the rect
bounds. Under this condition, we avoid using the SkDeviceLooper class.

Change-Id: I11fa13ace8d50d52069e1780a14874e4c34133f2
Skia: Fix special case in D32_A8_Opaque and _Black

Neon optimization implemented for D32_A8_Opaque and D32_A8_Black
is not using the right mask for width>=2 and width<4 case. This
is fixed in this patch by handling 4 different cases: width >=8,
4<=width<7, 2<=width<4, and residual case.

Change-Id: I20bf1cc28eac08402d4133aac663ebfc393edbe0
SkBlitter_RGB16: Add device-specific optimization hooks

Change-Id: I18bf4825669fef6fcc10e5d48271e7ea9abb3ed6
(cherry picked from commit 5d5e3dd98e15a5d25fcddf41f00dc5989942d094)
(cherry picked from commit afbd633b035a8b8f6017f52f6ad398a076aee841)
(cherry picked from commit 814fe785689f0b018283fbc2b02a2d230f0221cb)
skia: NEON blit optimizations from Samsung

 * Improves performance across the board

Change-Id: I3aa66f69140acf3992fbeb6346de4444195fdf92

Conflicts:
	Android.mk
Support for HW JPEG Decoder in SKIA

Add support to use HW JPEG Decoder in SKIA
through dynamic loading of vendor specific
library. Vendor library to provide APIs to
check if HW decode is possible for a stream
and if so decode the stream. Methods
allocPixelRef and getPrefConfig in
SkImageDecoder made public because vendor
lib has access only to the SkImageDecoder
and not its derived class.

Change-Id: Ie6e9366603a3a3923d7f041d7601589dadf75ac8
skia: fix path to openGL headers

Change-Id: I0c6770717e64c5bed3ab2408c52b90ae8b0b7b68
Modify sample buffer size for larger displays.

Modifies the intermediate buffer size for sample pixel indexes, used in the
sample proc function calls. If the buffer is not large enough, the job is split
into several calls. This would impact the performance of SIMD optimizations.

Change-Id: I86848d1c44fe338258b40f6ee6a576289cebd496
Signed-off-by: Henrik Smiding <henrik.smiding@stericsson.com>
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
ARM Skia NEON patches - 20 - New improved BitmapProcState code

BitmapProcState: new factorised code

This one basically factorises the clamp and repeat transformations with
some performance improvements. It has the benefit of being faster, much
easier to maintain (nearly three times less code for more work
done :-)), and more complete (all persp transformations weren't optimised
in the previous version).

It also introduces the use of can_truncate_to_fixed_for_decal where
useful.

The effect on benchmarks ranges from a 5% penalty to a 25% gain on a
Cortex-A9 and from a 5% penalty to a 100% gain on a Cortex-A15.

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=
R=djsollen@google.com, mtklein@google.com, luisjoseromeroesclusa@hotmail.com, reed@google.com

Author: kevin.petit.arm@gmail.com

Review URL: https://codereview.chromium.org/23835006

Change-Id: Ifb1a610730548f6e487dbb60bebcf69150186ed1
git-svn-id: http://skia.googlecode.com/svn/trunk@13218 2bbb7eff-a529-9590-31e7-b0007b416f81
ARM Skia NEON patches - 27 - S32A_D565_Blend

BlitRow565: new intrinsics version of S32A_D565_Blend

This new version is basically a rewrite of the existing code with
a few speed and accuracy improvements. There is a switch to enable
pixel perfect results at the cost of a (quite big) decrease of
performances (disabled in this patch).

Here are the benchmark results (speedup vs. existing code):

+-------+------------+------------+
| count | Cortex -A9 | Cortex-A15 |
+-------+------------+------------+
| 1     | +103.6%    | +12%       |
+-------+------------+------------+
| 2     | +3.6%      | +21.6%     |
+-------+------------+------------+
| 4     | +0.8%      | -0.8%      |
+-------+------------+------------+
| 8     | +3.9%      | -1%        |
+-------+------------+------------+
| 16    | +14.7%     | +5.7%      |
+-------+------------+------------+
| 64    | +18.1%     | +13.2%     |
+-------+------------+------------+
| 256   | +16.3%     | +27.4%     |
+-------+------------+------------+
| 1024  | +78.2%     | +17.4%     |
+-------+------------+------------+

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=skia:
R=djsollen@google.com, mtklein@google.com, halcanary@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/156113005

Change-Id: I92a1a6dfdb813b77ba05b245a3fdbb5e02458981
git-svn-id: http://skia.googlecode.com/svn/trunk@13438 2bbb7eff-a529-9590-31e7-b0007b416f81
ARM Skia NEON patches - 20bis - BitmapProcState accurracy

Use SkFractionalInt for some calculations to improve accuracy.

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=skia:2175
NOTRY=true
R=djsollen@google.com, mtklein@google.com, hshi@chromium.org

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/167433002

Change-Id: I2452ff401cc584084f44ec3a27240aa564eb19bc
git-svn-id: http://skia.googlecode.com/svn/trunk@13518 2bbb7eff-a529-9590-31e7-b0007b416f81
ARM Skia NEON patches - 12 - S32_Blend

Blitrow32: S32_Blend fix and little speed improvement

- the results are now exactly similar as the C code
- the speed has improved, especially for small values of count

+-------+-----------+------------+
| count | Cortex-A9 | Cortex-A15 |
+-------+-----------+------------+
| 1     | +30%      | +18%       |
+-------+-----------+------------+
| 2     | 0         | 0          |
+-------+-----------+------------+
| 4     | - <1%     | +14%       |
+-------+-----------+------------+
| > 4   | -0.5..+5% | -0.5..+4%  |
+-------+-----------+------------+

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=skia:

Committed: http://code.google.com/p/skia/source/detail?r=13532

R=djsollen@google.com, mtklein@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/158973002

Change-Id: I75a4d2a31313664b4df057ea58821899646a1577
git-svn-id: http://skia.googlecode.com/svn/trunk@13543 2bbb7eff-a529-9590-31e7-b0007b416f81
ARM Skia NEON patches - 25 - S32A_D565_Opaque_Dither clean/bugfix/speed

BlitRow565: S32A_D565_Opaque_Dither: some improvements

    - Supports ARGB and ABGR
    - Less magic numbers
    - Reduced instruction count : 5-25% speedup
    - Fixed indentation, removed some commented and useless code

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=skia:
R=djsollen@google.com, mtklein@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/177963003

Change-Id: I4f6083372e653fda5224b0f74dc5affbaa4c8f8f
git-svn-id: http://skia.googlecode.com/svn/trunk@13577 2bbb7eff-a529-9590-31e7-b0007b416f81
ARM Skia NEON patches - 22 - S32_D565_Blend

BlitRow565: new NEON version of S32_D565_Blend

This new implementation brings a good speedup in most cases and
gives exact results (removes one mismatch in gm).

Here are the benchmark results (speedup vs. existing S32A_D565_Blend):

+-------+-----------+------------+
| count | Cortex-A9 | Cortex-A15 |
+-------+-----------+------------+
| 1     | -26,7%    | -27,5%     |
+-------+-----------+------------+
| 2     | 0%        | +53%       |
+-------+-----------+------------+
| 4     | +38,3%    | +26,5%     |
+-------+-----------+------------+
| 8     | +10,9%    |  -4,5%     |
+-------+-----------+------------+
| 16    | +18,2%    | +1,6%      |
+-------+-----------+------------+
| 64    | +22,3%    | +8,75%     |
+-------+-----------+------------+
| 256   | +12,3%    | +11,2%     |
+-------+-----------+------------+
| 1024  | +79,2%    | +10,9%     |
+-------+-----------+------------+

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=skia:
R=djsollen@google.com, mtklein@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/181523002

Change-Id: I9307ea4ee185e0319aed20ef9708cef5552c561b
git-svn-id: http://skia.googlecode.com/svn/trunk@14103 2bbb7eff-a529-9590-31e7-b0007b416f81
ARM Skia NEON patches - 36 - Color32

Convert Color32 to intrinsics

This change is performance-neutral for high values of count and is
a big improvement for values smaller than 64.

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=skia:
R=djsollen@google.com, mtklein@google.com, borenet@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/258173005

Change-Id: Id7173a61efc6ebf8812149d2084e2b27c07fec52
git-svn-id: http://skia.googlecode.com/svn/trunk@14435 2bbb7eff-a529-9590-31e7-b0007b416f81
Remove the unused SkCachePreload_arm

Signed-off-by: Kévin PETIT <kevin.petit@arm.com>

BUG=skia:
R=djsollen@google.com, mtklein@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/263553008

Change-Id: I7312ca230cd98ec335970c4f503b3b04d2ec7db3
git-svn-id: http://skia.googlecode.com/svn/trunk@14456 2bbb7eff-a529-9590-31e7-b0007b416f81
Always inline Filter_32_*_neon functions

The functions are rather performance critical and already marked
'inline'. However, Chrome for Android will not have these functions
inlined due to it being compiled with -Os and a small -finline-limit.

This avoids one call in the filtering functions.

Does not increase the library size.

BUG=chromium:363073
R=mtklein@google.com

Author: kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/280403005

Change-Id: I3a1191a3b6f0afe8c035ab0af745280883680efc
git-svn-id: http://skia.googlecode.com/svn/trunk@14709 2bbb7eff-a529-9590-31e7-b0007b416f81
Fix SkBlitRow_opts_arm so that it works on ARM v4t.
Original Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=901208

R=reed@google.com, mtklein@google.com, reed1
BUG=skia:

Author: george@mozilla.com

Review URL: https://codereview.chromium.org/337853003

Change-Id: I822ef24123f2ae10815d99f25d07ee06e2c47af9
Add optimization of Skia S32A_Opaque blitter

Adds optimization of Skia S32A_Opaque_BlitRow32 blitter using ARM NEON
instruction set. Special cases for when alpha is zero or opaque.
Improves performance platform wide.

Change-Id: I0ffeb23b128e61cfe581ad121f227631d2918686
Signed-off-by: Henrik Smiding <henrik.smiding@stericsson.com>
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>