Delete SpotShadow::makeClockwise, which is unused and does
not link when compiler optimizations are disabled (for debugging).
SpotShadow::makeClockwise calls non-existent function
ShadowTessellator::isClockwise, which only works because the
optimizer deletes the function.
Change-Id: Ib8a014bf168782772faa1da7d75a079c1fd28ed9
bug:14297149
SaveLayer's performance cost is high, and proportional to the surface
being projected onto. Since ripples (even unbounded ones) are now
always projected to the arbitrary background content behind them, this
cost is especially important to avoid.
This removes the last semi-secret, saveLayer from the projected
ripple implementation.
Also fixes the HW test app to correctly demonstrate this projection
masking behavior.
Additionaly, alters PathTessellator to gracefully handle
counter-clockwise paths, and simplifies the work done by
ShadowTessellator to ensure all of its paths are counterclockwise.
Change-Id: Ibe9e12812bd10a774e20b1d444a140c368cbba8c
Narrow the use of #include directives in hwui, replacing with forward
declarations where straightforward. Speeds compiles; doesn't do any
restructuring of code.
Change-Id: Icac2baffb5896f55d8c6718e9bd9d4bfa02d3ca0
Fix the valid umbra detection.
This looks better b/c every vertex will have one ray shooting at it, such that
we don't miss the corner.
This performs better too, due to the polygon intersection is removed and less ray
intersection. 2x performance for rect and circle for spot shadow in test app.
b/17288227
b/15598793
b/16712006
Change-Id: I4a5ee397b9e192e93c8e35e6260b499e3e38a6f4
Get rid of compuation of the intersection for penumbra and convex hull for umbra.
Use simple circle / normal to compute the penumbra and simple intersection for umbra.
The new way could be 2x to 4x faster from rectangle to round shape.
And this part is roughly half of the shadow computation, or 2/3 of spot shadow
computation.
This improve the spot shadow spikeness too.
b/16712006
b/14976551
Change-Id: I02911784868731369efa73f76fc915bc08248600
Now the theta = 0 should be on +x axis.
And cos(theta) should correctly represent x value.
Without this fix, the poly theta (from atan2) can be wrongly rotated 90 degrees.
Also, make sure the incoming polygon is CW for the shadow system.
This fix visual artifacts in recent regression for spot shadows.
bug:13553955
Change-Id: I9bbf54db094e7f133326da4dae4610962da849c1
All the computations are estimated using bounding box.
TODO: Spot shadow could have more accurate but also more expensive methods, we need
more experiments to decide.
Change-Id: I9c10c419576cee55daf0f9f278b0db78cb847447
Fixes the simplifying assumption that shadow casters were always
rectangular.
Java side APIs + plumbing to pass down correct shapes still need to be added.
Change-Id: Ic4fee90af15679951a44bb5cc6ae454b98c4c194
Basically we compute the shadow as a strip of triangles, whose alpha value
is the strength of the shadow.
We use the normal to extend the geometry.
And we use static function and try to avoid new/malloc in the computation.
Change-Id: I382286f1cad351bd5ff983f76f446c075819dcaf