gnome/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js
/**
     * Downsample large icons before scanning for the backlight color to
     * improve performance.
     *
     * @param pixBuf
     * @param pixels
     * @param resampleX
     * @param resampleY
     *
     * @return [];
     */
Downsample large icons before scanning for the backlight color to
improve performance.




Downsample large icons before scanning for the backlight color to improve performance .
_resamplePixels (pixels, resampleX, resampleY) {
        let resampledPixels = [];
        let limit = pixels.length / (resampleX * resampleY) / 4;
        for (let i = 0; i < limit; i++) {
            let pixel = i * resampleX * resampleY;
            resampledPixels.push(pixels[pixel * 4]);
            resampledPixels.push(pixels[pixel * 4 + 1]);
            resampledPixels.push(pixels[pixel * 4 + 2]);
            resampledPixels.push(pixels[pixel * 4 + 3]);
        }
        return resampledPixels;
    }
_resamplePixels ( pixels , resampleX , resampleY ) { let resampledPixels = [ ] ; let limit = pixels . length / ( resampleX * resampleY ) / 4 ; for ( let i = 0 ; i < limit ; i ++ ) { let pixel = i * resampleX * resampleY ; resampledPixels . push ( pixels [ pixel * 4 ] ) ; resampledPixels . push ( pixels [ pixel * 4 + 1 ] ) ; resampledPixels . push ( pixels [ pixel * 4 + 2 ] ) ; resampledPixels . push ( pixels [ pixel * 4 + 3 ] ) ; } return resampledPixels ; }
Downsample large icons before scanning for the backlight color to
 improve performance.
Downsample large icons before scanning for the backlight color to improve performance .
// computing the limit outside the for (where it would be repeated at each iteration) // for performance reasons