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

        final float initConst = (dgdX * x) + gc;

        // Limit step to fractional part of
        // fastGradientArraySize (the non fractional part has
        // no affect anyways, and would mess up lots of stuff
        // below).
        float step = (dgdX - (int) dgdX) * fastGradientArraySize;

        // Make it a Positive step (a small negative step is
        // the same as a positive step slightly less than
        // fastGradientArraySize.
        if (step < 0)
            step += fastGradientArraySize;

        final int[] grad = gradient;

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

            // now Limited between -1 and 1.
            g = g - (int) g;
            // put in the positive side.
            if (g < 0)
                g += 1;

            // scale for gradient array...
            g *= fastGradientArraySize;
            g += 0.5; // rounding factor
            final int rowLimit = off + w;  // end of row iteration
            while (off < rowLimit) {
                int idx = (int) g;
                if (idx >= fastGradientArraySize) {
                    g -= fastGradientArraySize;
                    idx -= fastGradientArraySize;
                }
                pixels[off++] = grad[idx];
                g += step;
            }

            off += adjust; //change in off from row to row
        }
    }