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

Commit 373329d4 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I736c525a into eclair-mr2

* changes:
  update dox to account for different behavior between AVOID and TARGET modes
parents 235657db 736c525a
Loading
Loading
Loading
Loading
+13 −10
Original line number Original line Diff line number Diff line
@@ -33,17 +33,20 @@ public class AvoidXfermode extends Xfermode {
        final int nativeInt;
        final int nativeInt;
    }
    }
    
    
    /**
    /** This xfermode draws, or doesn't draw, based on the destination's
     * This xfermode will draw the src everywhere except on top of the opColor
     * distance from an op-color.
     * or, depending on the Mode, draw only on top of the opColor.
     *
     * There are two modes, and each mode interprets a tolerance value.
     *
     * AVOID: In this mode, drawing is allowed only on destination pixels that
     * are different from the op-color.
     *   Tolerance near 0: avoid anything close to the op-color
     *   Tolerance near 255: avoid only colors very close to the op-color
     *
     *
     * @param opColor The color to avoid (or to target depending on Mode). Note
     * TARGET: In this mode, drawing only occurs on destination pixels that
     *                that the alpha in opColor is ignored.
     * are similar to the op-color
     * @param tolerance How closely we compare a pixel to the opColor.
     *   Tolerance near 0: draw on colors that are very close to op-color
     *                  0 - only operate if exact match
     *   Tolerance near 255: draw on colors that  to the op-color
     *                  255 - maximum gradation (blending) based on how
     *                  similar the pixel is to our opColor (max tolerance)
     * @param mode If we should avoid or target the opColor
     */
     */
    public AvoidXfermode(int opColor, int tolerance, Mode mode) {
    public AvoidXfermode(int opColor, int tolerance, Mode mode) {
        if (tolerance < 0 || tolerance > 255) {
        if (tolerance < 0 || tolerance > 255) {