Restore untrusted glStencilMask value on resume after functor

Fixes an issue where the stencil buffer is corrupted
(used in overdraw debugging, path clipping) when used in
conjunction with a HW accelerated WebView.

bug:15023700
bug:16465551

Change-Id: If201b503931380f7107a34e9a9a2f877a50f72b1
Use hidden API to validate APK chains

Bug: 13678484
Change-Id: I28dedab74b0e24d47ab9f2190298156c909e9d54
(cherry picked from commit 5a30e8a0ebb19852902361079b139ee160a53588)
inputdevices: update from aosp (master)

Change-Id: If5fb11c354ea0144cdae1434de4c536302dda5b3
[HWUI]: fix residual line on FrameBuffer

Symptom: If app applies animation to enlarge a bitmap, there will be an residual
         line on the screen

Root Cause: On platform which has Tile Rendering implementation (ex. Qualcomm
            CPU), startTiling() call will restrict the framebuffer region which
            GPU can affect. So the expansion of clear region by 1 will not take
            effect if startTiling region is not expanded.

Solution: Expand the startTiling region by 1, too.

Reproduce steps: Apply animation to enlarge (and then shrink) a bitmap icon.

Change-Id: I7b4a59e180daa29dbe909d9e11f4093ae1d7396f
[HWUI] Fix invisible views are still shown in popup window

Symptom: Invisible views are still shown in popup window

Root Cause: glClear isn't called if there is no draw command

Solution: Even if there is no draw command, it still calls glClear
          by startFrame().

Reproduce steps: App set one view in a popup window to invisible,
                 it will be still visible.

Change-Id: I36bc7b752434ad388fbb80ea63341ac778f48d35
Revert Update the layer's alpha value upon composition of the layer

...
watermark: Place watermark in the bottom-right when both deltax and deltaty are 0

The default behavior is to replicate the watermark all over the screen but this can
be too intrusive. The repetition is controlled by deltax and deltay and if they are
both 0 the watermark will actually be drawn off-screen and thus not shown.

We take advantage of this to add a special behavior when they are both 0 that simply
places them in the bottom right. This patch doesn't take UI elements into account and
may actually overlay soft-buttons and other chrome.

Change-Id: I4cff1326b8aaecdbc471eaf48e95bc2865181366
Remove opaque check in preparing dirty region

Since preserve swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage being present from the previous process in the color buffer.

CRs-Fixed: 549755

Change-Id: Icd12ae388077b8c9ed329c37314e896500078543
(cherry picked from commit 48b6a9767317e08a24e189c9cbee21043543682a)
(cherry picked from commit 777610a5ddf19cebcad30b7e9a481e9dfe38b74c)
Update the layer's alpha value upon composition of the layer

Fixes: This patch makes sure that the layer's alpha value is
up-to-date and does not reflect the previous view's alpha value.
It fixes the square block on marquee fading edge when text view
is applied transparency.

CRs-Fixed: 562000

Change-Id: I397308b739f5f4fe4b630cf594825f401c97e0e3
hwui: Always enable the scissor while composing layer

Due to scissor optimization feature added in KK, scissor was disabled
all the time. Hence the undefined areas/region of textures are not
masking properly with GL_LINEAR filter mode.

Change-Id: Ifbbde2c67a4c01e45eda07ada709e066255fffcb
CRs-fixed: 645077
Optimize drawBitmapMesh using TRIANGLE_STRIP

Draw BitmapMesh using STRIP instead of TRIANGLES.
Depending on where the bottleneck is located in the pipeline,
there is a potential for saving two-thirds of the time spent rendering.
The speedup is due to avoiding redundant operations,
i.e., mapping each vertex four times to texture and color attribute,
sending each vertex twice to the GPU, vertex processing of GPU ...

In this patch:
1. Refactoring mesh using Strip.
2. Batch triangles by adding degenerate triangles.
3. Optimize computing positions of texture and color attribute.

Benchmark: Drawing Bitmap(1152x768 px) with 200x200 meshes
Performance is doubled (from 26.4 fps to 53 fps, Nexus10).
Memory footprint: only 17% of original method.
(from 240000 to 40401 vertices with xy, uv, rgba data.)

Change-Id: I08c5c20d981d88528ce7b02012feefae468d6ec4
Signed-off-by: kui.zheng <kui.zheng@arm.com>
core: use 'normal' value for notification led off

Users can set this value to 250, 500, 1000, 2500 or 5000ms only,
but it's 2000ms by default.

With this patch, 'Normal' string is shown instead of 'By default'
and pulse speed goes to 1 sec.

Change-Id: Idb18ac345bd9eb1a5b795776faa60e2fb5bc258b