533 lines · 22.1 KB · Java
RawDownload
        at.scale(radius, radius);         // invert to get mapping from device coords to unit circle        try {            at.invert();        } catch (Exception e) {            at.setToScale(0.0, 0.0);        }        focus = at.transform(focus, focus);         // clamp the focus point so that it does not rest on, or outside        // of, the circumference of the gradient circle        fx = Math.min(focus.getX(), 0.99);         // assert rq.lock.isHeldByCurrentThread();        rq.ensureCapacity(20 + 28 + (numStops*4*2));        RenderBuffer buf = rq.getBuffer();        buf.putInt(SET_RADIAL_GRADIENT_PAINT);        buf.putInt(useMask ? 1 : 0);        buf.putInt(linear  ? 1 : 0);        buf.putInt(numStops);        buf.putInt(cycleMethod);        buf.putFloat((float)at.getScaleX());        buf.putFloat((float)at.getShearX());        buf.putFloat((float)at.getTranslateX());        buf.putFloat((float)at.getShearY());        buf.putFloat((float)at.getScaleY());        buf.putFloat((float)at.getTranslateY());        buf.putFloat((float)fx);        buf.put(fractions);        buf.put(pixels);    }}

Lines 501–533 of 533. Previous lines