Implementing Color32 functions for Neon platforms.

Besides the raw processing improvement provided by Neon, the code uses memory
preteches (pld) which seem to improve performance greatly when dealing with
very large counts.

This was tested using bench where color32 accounts for the majority of the
workload:
bench -match rects_1 -config 8888 -repeat 500 -forceBlend 1
(the forceBlend is there so that the Color32 code does not go through the
special cases where alpha == 0xFF as it would transform color32 into
a sk_memset32.

Numbers averaged over 3 runs:
bench name      | Before | Neon, no pld | Neon with pld | full boost
rrects_1        | 153.9  | 128.3        | 92            | 1.66x
rects_1_stroke_4| 32.8   | 31.4         | 28.45         | 1.15x
rects_1         | 125.35 | 97.2         | 63.59         | 1.97x

Credits: various googletv team members.

Committed on behalf of evannier.
Review URL: http://codereview.appspot.com/5569077/

git-svn-id: http://skia.googlecode.com/svn/trunk@4779 2bbb7eff-a529-9590-31e7-b0007b416f81
Landing arm patch from contributor.

http://codereview.appspot.com/5649055

git-svn-id: http://skia.googlecode.com/svn/trunk@3541 2bbb7eff-a529-9590-31e7-b0007b416f81
Squashed commit of font rendering fixes from Skia master

When guessing at the dest, use linear space instead of color space.
http://codereview.appspot.com/5732044/
--this line, and those below, will be ignored--

M    src/ports/SkFontHost_FreeType.cpp

git-svn-id: http://skia.googlecode.com/svn/trunk@3313 2bbb7eff-a529-9590-31e7-b0007b416f81

Don't override the user's hinting level.
http://codereview.appspot.com/5792049/

git-svn-id: http://skia.googlecode.com/svn/trunk@3344 2bbb7eff-a529-9590-31e7-b0007b416f81

Use default lcd filter until we have the means to specify one.

git-svn-id: http://skia.googlecode.com/svn/trunk@3358 2bbb7eff-a529-9590-31e7-b0007b416f81

Use floats for mask table for accuracy.
http://codereview.appspot.com/5783099/

git-svn-id: http://skia.googlecode.com/svn/trunk@3374 2bbb7eff-a529-9590-31e7-b0007b416f81

Glyph advances from generateAdvance do not always match generateMetrics results.
http://codereview.appspot.com/5841071/

git-svn-id: http://skia.googlecode.com/svn/trunk@3480 2bbb7eff-a529-9590-31e7-b0007b416f81

Temp fix for very large text sizes.
http://codereview.appspot.com/5970065/

git-svn-id: http://skia.googlecode.com/svn/trunk@3569 2bbb7eff-a529-9590-31e7-b0007b416f81

Compare scalars to scalars (fixes fixed point).

git-svn-id: http://skia.googlecode.com/svn/trunk@3570 2bbb7eff-a529-9590-31e7-b0007b416f81

Need to apply matrix to advance in generateAdvance (as we already were in generateMetrics)
Fixes b/6833339
Expand existing unittest to detect this (we needed to set both scale and skew on the paint)

Change-Id: Icbb8cb70558635874626c78c2eae2eb73f224b58
git-svn-id: http://skia.googlecode.com/svn/trunk@4647 2bbb7eff-a529-9590-31e7-b0007b416f81
Update Skia's handling of vertical text when freetype metrics are available.

This is a cherry-pick of a larger change going into upstream Skia at...
https://codereview.appspot.com/6554064/

bug: 7124435
Change-Id: Id8b030afaf493741e133b592a4e08a3fd90ec2f3
Add Android specific API
Bug #7353771

This API is just a boolean property that tells the hardware renderer
whether it should use mipmap levels.

Change-Id: I123a334b89b0d64d711bdad43f5e2feb416de8b4
Support NEON anti-aliasing blit function in SKIA

original function has calculation are called repetitively, and
Processed individual pixels only. So Function call overhead was reduced.
And In contrast to the serial data processing in the existing code,
the Neon code processes 8 or 4 pixels in parallel. In contrast to the
serial data processing in the existing code, the Neon code processes
8 or 4 pixels in parallel

Change-Id: Ib54aeb6bacfd4ed6d257324e8146b211f90b68e9
Signed-off-by: Lee Hwangjae <hj-yo.lee@samsung.com>
Several skia tunings for JB_2.5

* Optiming constructor of Paint object
* Special copy path for small object
* Global Language list instead of constructing a new obj everytime.

Change-Id: I8d4687fffe055166a4758059872af09bfdc973d4
Merge tag 'android-4.2.2_r1' into HEAD

Android 4.2.2 release 1
FIX: memcpy_76(): add support for non-ARM architectures

Before, memcpy_76() assumed ARM instruction set.  Add preprocessor
guards to use generic memcpy() if not on ARM.

Original patch had args to memcpy_76 backwards.

Change-Id: Ib5375e9de28ab6c2b348731dcdf282d6f7a529c1
memcpy_76(): fix behavior on non-ARM architectures

The destination is passed as the first argument to memcpy_76() and the
source is passed as the second argument.  As originally written in
commit cb5701e, the first argument was called 'src' (despite being the
destination) and the second was called 'dst' (despite being the
source).  The behavior of the memcpy_76() function was correct despite
the backward variable naming.

Commit ad673c1 reversed the naming of the two arguments to clarify the
semantics of the function but failed to reverse the naming in the ARM
assembly code.  This broke the function's behavior on ARM devices.

Commits a8ce1a0 and f4be52e reversed the argument names again.  This
fixed ARM support, but broke non-ARM architectures (the arguments to
memcpy() in the body of the memcpy_76() function were not also
reversed).

This change swaps the argument names again and swaps the names in the
ARM assembly, restoring correct behavior on non-ARM architectures and
aligning the variable names with the function's semantics.

Change-Id: Iaeb2b84b6696e3eebf29617dfdc41c55e5226776
skia: SkPaint::SkPaint(): don't cast away const

This will help avoid bugs like the one fixed in change-id:
Iaeb2b84b6696e3eebf29617dfdc41c55e5226776.

Change-Id: I892423e18f9927f827393d0ff0c923259e07389c
Skia: Introduce caching of unscaled Bitmaps.

This allows skia to choose whether to use the prescaled bitmap or the
unscaled bitmap depending on which would be optimal in the current
situation. This commit also introduces two functions necessary for
properly resizing Rects when using the non-pre-scaled bitmaps.

CRs-fixed: 451681

Change-Id: I36779d8a680a3ced7c28da492e879de02c7e87a5
Skia: Fix path to OpenGL Headers

The path that Skia was pointing to for the OpenGL Headers
was moved to frameworks/native. This patch will also be
submitted to the mainline for Google.

Change-Id: I75d2ce267d5ec202bb2e5e995f25f9ddfba0dc57
Neon optimized implementation of S16_opaque_D32_nofilter_DX

This patch does the following:
* Neon ASM blitter from RGB565 to ABGR8888 without blend.
* Special case for no scaling but the scaling case is almost as fast.

 Copyright (C) ST-Ericsson SA 2010

Change-Id: I0fae80b14aa5a5c7f6ff4c251bc1419ffa0d4751
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
skia: compile SkTextBox for Samsung's libtvout

Change-Id: Ic1fdddbe8c5c41ff2bf7c1b723d054e509a64185
Assembly optimized 4 blittering related functions:

S32A_D565_Opaque
S32A_Opaque_BlitRow32
nofilter_gether
S32A_Blend_BlitRow32

* S32A_D565_Opaque:

Use neon instructions to optimize BLIT routine which operates on
32-bit source ARGB pixel and 16-bit destination RGB pixel. Here,
we process 16-pixels in an iteration. We use regular (32-bit)
arm instructions when number of pixels is less than 16 or the
architecture doesn't support SIMD/NEON instructions. When alpha
value is 255, this version of BLIT routine performs 35% better
in comparison to S32A_D565_Opaque_neon routine.

* S32A_Opaque_BlitRow32 and nofilter_gether:

Use neon instructions to optimize BlitRow32 and nofilter_gether
functions for 32-bit source and destination pixel arrays. An improvement
of 76% is observed with neon optimized BlitRow32 function and 6%
improvement is observed with nofilter_gether function.

* S32A_Blend_BlitRow32:

Optimize S32A_Blend_BlitRow32 using neon instructions for armv7
based targets and using regular arm instructions for armv6 based
targets.

This is the consolidated commit from several patches.

Change-Id: Id5aab49656247b9a69b43cfb22fe7a8608f847e5

Apply PLD to blittering functions

Extend software pipelining for S32A_Blending to process 16 points
perloop and per-read points of next loop

Change-Id: Ib7a6a6efb8249b96578e75613683099251dc2a82

Two skia optimizations:

1. Combine S16_opaque_D32_nofilter_DX and clampx_nofilter_trans
2. Change MAX_BUF between mproc and sproc to 1024 from 128

Opt 1 is giving about 8-10 FPS in gmail and facebook apk.
Opt 2 is helping all combinations for shaderspan.

Change-Id: I88dc097ffd52984a7b786e13c70384688f2e1b12

File changes for SKIA Neon optimziation for S32_Opaque_filter_DX

Change-Id: I0e8a0506aca2a8d4ee4f4b6b1aa4dcc9ce9c0329

Fix CTS failure.

Revert opt 2 in the following commit.

Author: Xin Qi <xqi@codeaurora.org>
Date:   Wed Nov 16 10:07:54 2011 -0800

    Two skia optimizations:

    1. Combine S16_opaque_D32_nofilter_DX and clampx_nofilter_trans
    2. Change MAX_BUF between mproc and sproc to 1024 from 128

    Opt 1 is giving about 8-10 FPS in gmail and facebook apk.
    Opt 2 is helping all combinations for shaderspan.

CRs-Fixed: 330807

Change-Id: Iece797781e97918f4c77fc767bf9e6772927d6f3

skia: Fix a bug in clampx_nofilter_trans_S16_D32_DX

When scaling a line, in the case of the last pixel needing to be
duplicated, the beginning of the line is getting clobbered with wrong
value.  This is because dest buffer pointer is not moved forward.  Fix
that by adding pointer update line.

CRs-Fixed: 349571

Change-Id: Id6dc41d7e6bd2b777097f62e788bd2476609a9ae
Revert "Neon optimized implementation of S16_opaque_D32_nofilter_DX"

This reverts commit 8166ef944d6beb075db45b2562e759ca72de401a.

Change-Id: I1ae763a1edfa868ba3d58965ad9115e56994137d
Add shader for Clamp_S32_Opaque_D32_filter_DX.

Adds a NEON optimized shader for S32_Opaque_D32_filter_DX when
running with clamped tile mode.
Improves performance of browser and many other applications.

Change-Id: Ic3d83bfd70c8b0c6c956482db5f3a08667655d6e
Signed-off-by: Henrik Smiding <henrik.smiding@stericsson.com>
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
Add shader for Clamp_SI8_opaque_D32_filter_DX.

Adds a NEON optimized shader for SI8_opaque_D32_filter_DX when
running with clamped tile mode.
Improves performance of browser.

Change-Id: I0e1fa03d4104210953b7ec81ce10eba5f77459cc
Signed-off-by: Henrik Smiding <henrik.smiding@stericsson.com>
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
Add shader for Repeat_SI8_opaque_D32_filter_DX.

Adds a NEON optimized shader for SI8_opaque_D32_filter_DX when
running with repeat tile mode.
Improves performance of browser.

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