protected void fillRaster(int[] pixels, int off, int adjust,
                              int x, int y, int w, int h) {

        //constant which can be pulled out of the inner loop
        final float initConst = (dgdX * x) + gc;

        if (fillMethod == ANTI_ALIAS_IMPL) {
            //initialize current value to be start.
            for (int i = 0; i < h; i++) { //for every row
                float g = initConst + dgdY * (y + i);

                final int rowLimit = off + w;  // end of row iteration
                while (off < rowLimit) { //for every pixel in this row.
                    //get the color
                    pixels[off++] = indexGradientAntiAlias(g, pixSz);
                    g += dgdX; //incremental change in g
                }
                off += adjust; //change in off from row to row
            }
        } else if (!isSimpleLookup) {
            if (cycleMethod == MultipleGradientPaint.NO_CYCLE) {
                fillHardNoCycle(pixels, off, adjust, x, y, w, h);
            } else {
                //initialize current value to be start.
                for (int i = 0; i < h; i++) { //for every row
                    float g = initConst + dgdY * (y + i);

                    final int rowLimit = off + w;  // end of row iteration
                    while (off < rowLimit) { //for every pixel in this row.
                        //get the color
                        pixels[off++] = indexIntoGradientsArrays(g);
                        g += dgdX; //incremental change in g
                    }
                    off += adjust; //change in off from row to row
                }
            }
        } else {
            // Simple implementations: just scale index by array size

            if (cycleMethod == MultipleGradientPaint.NO_CYCLE)
                fillSimpleNoCycle(pixels, off, adjust, x, y, w, h);
            else if (cycleMethod == MultipleGradientPaint.REPEAT)
                fillSimpleRepeat(pixels, off, adjust, x, y, w, h);
            else //cycleMethod == MultipleGradientPaint.REFLECT
                fillSimpleReflect(pixels, off, adjust, x, y, w, h);
        }
    }