bug:17463894
Fixes the setViewport method to immediately affect the return values
of getViewportWidth/Height methods.
Also works around tiling extension issues observed on first frame
after window resize by disabling tiling for that frame.
Change-Id: Ie172d572d20d74a1be9cc58ad389af2cffa0e4b6
bug:17379260
Unclipped save layers need to isolate their clips and matrices
so that the save time readout of background content matches clip and
position with the restore/compose step.
Change-Id: I2de474cda76e960d080852f1716d6ddfa8a512d4
Using the vertices, instead of ray casting for the triangulation.
This request a dynamic index buffer associated with vertex buffer,
so we update the VertexBuffer to support it.
The ambient shadow could be 3x-6x times faster for circle and rect now.
b/16712006
b/14257173
Change-Id: I2f22a8fe19bc59acee5c18e4a3a395acd5042a66
bug:17114102
Prevents high contrast text from drawing invisible text.
Also fixes stroked text bounds calculation.
Change-Id: Iaeff51ead8b7b8ef2a1a0ca8b89598564e0d443f
bug:15860114
Savelayers and HW layers both now support shadow casting.
For save layers, the light source should always be correct, for HW
layers, the light source position is set when the layer is created,
and updated when it is resized.
Change-Id: Ie85567dd43c2bb0a0b08fd0bd4db41efa793ac2b
bug:16852257
Use pow(alpha, 1.5) to avoid harsh edges on shadow alpha ramps.
Also adjusts shadow constants to compensate.
Change-Id: I5869956d7d292db2a8e496bc320084b6d64c3fb7
bug:11359533
This allows us to deduplicate a lot between the two ops, and fixes the
shader coordinate space for the left,top argument drawBitmap to match
software.
Change-Id: I53da05af9ee74c74e9e70b4ab8053190ca220b16
bug:16376960
The draw within clearLayerRegions should never be affected by the
current stencil clip, since it's just ensuring that the content of the
layer is cleared, and not doing real content drawing.
Also, add optional verbose GL event logging
Change-Id: I538b1bc631fc091340b76e12db6af0c219851b57
bug:15859361
Moves lighting info out of StatefulBaseRenderer, since it's not useful
at record time, and only used by OGLR.
Change-Id: I7ab065d02d9304afad1dc4c48597a7a621366f8e
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.
Cherry-pick of 20adb6ce4d52b15472e7e5ee953e06cc349a827c from AOSP
Change-Id: I163b898b87b74d221dc4210b7fa657aa93c82c19
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
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
bug:14083128
Moves all of the font transform management into
OpenGLRenderer::findBestFontTransform(), and now simply passes down
final rasterization transforms into the FontRenderer.
Change-Id: Ie02752e6af863347b142367c7d628db5f9fc2998
DisplayListRenderer is all that's accessed from java, and is entirely
separate from OpenGLRenderer now.
Change-Id: Ie733be71520c13fdb55dfe3522bb445ae2b50ac1
bug:15570351
Pos Z composited children are drawn before the primary restore for a
RenderNode. This means that without an additional save/restore (which
wraps the content) they aren't protected from transformations/clips
that happen within the ViewGroup's DisplayList.
Also changes RenderNode to use OpenGLRenderer tag for displaylist
dumping consistency, and simplifies the entry points into RenderNode
drawing, since the distinction between tree root vs tree internal is
no longer important.
Change-Id: I2621eba0592c74d71f85a91a4ab3d0da2d7468d3
1. more closely mirror Skia API by using const ref instead of ptrs
2. store SkMatrix in the drawOp instead of the linear allocation heap
Change-Id: I4b9f6f76b9f7d19325e29303d27b793679fd4823
cherry-pick of Iaa7189178bda1c55f96da044d2a9fa602ba36034
Instead of duplicating internal info about SkShader, inspect the
SkShader installed on the SkPaint.
core/java/android/view/GLES20Canvas.java:
Remove setupModifiers, nResetModifiers, and nSetupShader.
core/jni/android/graphics/Shader.cpp:
Remove calls to create/destroy the (previously) attached SkiaShader.
core/jni/android_view_GLES20Canvas.cpp:
Remove native code for setupShader and resetModifiers.
graphics/java/android/graphics/BitmapShader.java:
graphics/java/android/graphics/ComposeShader.java:
graphics/java/android/graphics/LinearGradient.java:
graphics/java/android/graphics/RadialGradient.java:
graphics/java/android/graphics/Shader.java:
graphics/java/android/graphics/SweepGradient.java:
Remove code keeping track of native SkiaShader.
libs/hwui/Caches.h:
Include Extensions.h.
libs/hwui/DeferredDisplayList.cpp:
Compare shaders on the paint, instead of on DrawModifiers.
libs/hwui/DisplayList.cpp:
libs/hwui/DisplayList.h:
Remove vector of SkiaShaders.
libs/hwui/DisplayListOp.h:
Access the SkShader on mPaint.
Remove SetupShaderOp and ResetShaderOp.
libs/hwui/DisplayListRenderer.cpp:
libs/hwui/DisplayListRenderer.h:
Remove resetShader, setupShader, refShader, and mShaderMap.
libs/hwui/FontRenderer.cpp:
Pass SkShader to setupDrawShader and setupDrawShaderUniforms.
libs/hwui/OpenGLRenderer.cpp:
libs/hwui/OpenGLRenderer.h:
Add LayerShader, a class inheriting from SkShader, to mimic the
behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on
the SkPaint so it can be inspected later.
Set a LayerShader instead of a SkiaLayerShader.
setupDrawShader and setupDrawShaderUniforms now inspect an SkShader
passed in.
Inspect SkShader instead of mDrawModifiers.mShader.
Remove resetShader and setupShader.
setupDrawColorUniforms now takes a boolean indicating whether there is
a shader.
Add an inline function for accessing the SkShader on an SkPaint.
In setupDrawBlending(Layer*, bool), do not check the shader (which will
never be set), but do check whether the color filter may change the
alpha (newly fixed behavior).
In setupDrawBlending(SkPaint, ...), check the SkShader and whether the
color filter affects alpha (the latter is new behavior).
libs/hwui/Renderer.h:
Remove pure virtual functions setupShader and resetShader.
libs/hwui/ResourceCache.cpp:
libs/hwui/ResourceCache.h:
Remove functions for refing/unrefing shaders.
libs/hwui/SkiaShader.cpp:
libs/hwui/SkiaShader.h:
Much of this code was redundant and has been removed.
Convert structs into class with nothing but static functions for
calling describe/setupProgram.
libs/hwui/TextureCache.cpp:
libs/hwui/TextureCache.h:
Use the SkPixelRef as the key to the bitmap Lru cache, since shader
inspection will provide a different SkBitmap pointer (though it will
hold the correct SkPixelRef with the correct generation ID).
tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java:
tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java:
Update manual test to have more shaders: radial, sweep, compose,
invalid compose.
BUG:10650594
Change-Id: I2e7182b3fc28268e7ca82fac6780540b6b45365c
Instead of duplicating internal info about SkShader, inspect the
SkShader installed on the SkPaint.
core/java/android/view/GLES20Canvas.java:
Remove setupModifiers, nResetModifiers, and nSetupShader.
core/jni/android/graphics/Shader.cpp:
Remove calls to create/destroy the (previously) attached SkiaShader.
core/jni/android_view_GLES20Canvas.cpp:
Remove native code for setupShader and resetModifiers.
graphics/java/android/graphics/BitmapShader.java:
graphics/java/android/graphics/ComposeShader.java:
graphics/java/android/graphics/LinearGradient.java:
graphics/java/android/graphics/RadialGradient.java:
graphics/java/android/graphics/Shader.java:
graphics/java/android/graphics/SweepGradient.java:
Remove code keeping track of native SkiaShader.
libs/hwui/Caches.h:
Include Extensions.h.
libs/hwui/DeferredDisplayList.cpp:
Compare shaders on the paint, instead of on DrawModifiers.
libs/hwui/DisplayList.cpp:
libs/hwui/DisplayList.h:
Remove vector of SkiaShaders.
libs/hwui/DisplayListOp.h:
Access the SkShader on mPaint.
Remove SetupShaderOp and ResetShaderOp.
libs/hwui/DisplayListRenderer.cpp:
libs/hwui/DisplayListRenderer.h:
Remove resetShader, setupShader, refShader, and mShaderMap.
libs/hwui/FontRenderer.cpp:
Pass SkShader to setupDrawShader and setupDrawShaderUniforms.
libs/hwui/OpenGLRenderer.cpp:
libs/hwui/OpenGLRenderer.h:
Add LayerShader, a class inheriting from SkShader, to mimic the
behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on
the SkPaint so it can be inspected later.
Set a LayerShader instead of a SkiaLayerShader.
setupDrawShader and setupDrawShaderUniforms now inspect an SkShader
passed in.
Inspect SkShader instead of mDrawModifiers.mShader.
Remove resetShader and setupShader.
setupDrawColorUniforms now takes a boolean indicating whether there is
a shader.
Add an inline function for accessing the SkShader on an SkPaint.
In setupDrawBlending(Layer*, bool), do not check the shader (which will
never be set), but do check whether the color filter may change the
alpha (newly fixed behavior).
In setupDrawBlending(SkPaint, ...), check the SkShader and whether the
color filter affects alpha (the latter is new behavior).
libs/hwui/Renderer.h:
Remove pure virtual functions setupShader and resetShader.
libs/hwui/ResourceCache.cpp:
libs/hwui/ResourceCache.h:
Remove functions for refing/unrefing shaders.
libs/hwui/SkiaShader.cpp:
libs/hwui/SkiaShader.h:
Much of this code was redundant and has been removed.
Convert structs into class with nothing but static functions for
calling describe/setupProgram.
libs/hwui/TextureCache.cpp:
libs/hwui/TextureCache.h:
Use the SkPixelRef as the key to the bitmap Lru cache, since shader
inspection will provide a different SkBitmap pointer (though it will
hold the correct SkPixelRef with the correct generation ID).
tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java:
tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java:
Update manual test to have more shaders: radial, sweep, compose,
invalid compose.
BUG:10650594
Change-Id: Iaa7189178bda1c55f96da044d2a9fa602ba36034
Merge management of ortho projection matrix with the viewport size,
since they should always be changed together.
Change-Id: Iccb8f30828f4fb7848999ac54852e7ed2d6f2eb1