Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b0aecc22 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Use ColorLongs in Linear-, Radial-, and Sweep-Gradient

Bug: 122844033
Test: Id1809aef84eca0ccc61bafc2476ad52ed78d5f22

Add APIs that mirror the existing creation APIs, but use @ColorLongs
instead of @ColorInts. Note that call-sites that used a null array (but
not a variable "int[]" pointing to a null array) are now ambiguous. It
is unlikely that there are any such call-sites, though, since they would
throw NullPointerException.

Consolidate constructors. Those that take two color endpoints now create
two-member long-arrays and call the more general constructor, saving
lots of code. The additional cost of small arrays is not as much as it
used to be, in the early days of Android, when this class was written.

In *Gradient#copy, there is no longer any need to clone the colors
array, since the mColorLongs was created by the Gradient. Similarly,
there never was any need to clone mPositions, which was always a clone
of the user-supplied array anyway.

Clean up Shader.cpp:
 - Throw and return if the pointer is null before dereferencing it.
 - Simplify and put together matrix-related code.

Change-Id: Ib71c5e85b2a398959bf687bce33980d3429bcbc3
parent bee5e204
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment