Method: applyBackBuffer
Create, insert, scale and position a back buffer for the layer.

Parameters:
resolution - {Number} The resolution to transition to.
199720
function(resolution) {
        if(this.backBufferTimerId !== null) {
            this.removeBackBuffer();
        }
        var backBuffer = this.backBuffer;
        if(!backBuffer) {
            backBuffer = this.createBackBuffer();
            if(!backBuffer) {
                return;
            }
            if (resolution === this.gridResolution) {
                this.div.insertBefore(backBuffer, this.div.firstChild);
            } else {
                this.map.baseLayer.div.parentNode.insertBefore(backBuffer, this.map.baseLayer.div);
            }
            this.backBuffer = backBuffer;

            // set some information in the instance for subsequent
            // calls to applyBackBuffer where the same back buffer
            // is reused
            var topLeftTileBounds = this.grid[0][0].bounds;
            this.backBufferLonLat = {
                lon: topLeftTileBounds.left,
                lat: topLeftTileBounds.top
            };
            this.backBufferResolution = this.gridResolution;
        }
        
        var ratio = this.backBufferResolution / resolution;

        // scale the tiles inside the back buffer
        var tiles = backBuffer.childNodes, tile;
        for (var i=tiles.length-1; i>=0; --i) {
            tile = tiles[i];
            tile.style.top = ((ratio * tile._i * tile._h) | 0) + 'px';
            tile.style.left = ((ratio * tile._j * tile._w) | 0) + 'px';
            tile.style.width = Math.round(ratio * tile._w) + 'px';
            tile.style.height = Math.round(ratio * tile._h) + 'px';
        }

        // and position it (based on the grid's top-left corner)
        var position = this.getViewPortPxFromLonLat(
                this.backBufferLonLat, resolution);
        var leftOffset = this.map.layerContainerOriginPx.x;
        var topOffset = this.map.layerContainerOriginPx.y;
        backBuffer.style.left = Math.round(position.x - leftOffset) + 'px';
        backBuffer.style.top = Math.round(position.y - topOffset) + 'px';
    }
1105457
public static ResourceResolutionComponent[] resolve(Object... resolutionParams) {
        ResourceResolutionComponent[] components = new ResourceResolutionComponent[resolutionParams.length];
        for (int i = 0; i < resolutionParams.length; i++) {
            if (resolutionParams[i] == null) {
                components[i] = new StringResolutionComponent("");
            } else if (resolutionParams[i] instanceof ResourceResolutionComponent) {
                components[i] = (ResourceResolutionComponent) resolutionParams[i];
            } else if (resolutionParams[i] instanceof Locale) {
                components[i] = new LocaleResolutionComponent((Locale) resolutionParams[i]);
            } else if (resolutionParams[i] instanceof String) {
                components[i] = new StringResolutionComponent((String) resolutionParams[i]);
            } else if (resolutionParams[i] instanceof String[]) {
                components[i] = new StringResolutionComponent((String[]) resolutionParams[i]);
            } else {
                components[i] = new StringResolutionComponent(String.valueOf(resolutionParams[i]));
            }
        }
	    return components;
    }
590986
def add_and_display_buffer(self, buffer, redraw=True):
        
        # FIXME: some buffers have arguments, do a proper comparison -- override __eq__
        if buffer not in self.buffers:
            logger.debug("adding new buffer {!r}".format(buffer))
            self.buffers.append(buffer)
        self.display_buffer(buffer, redraw=redraw)
1117669
protected void createBackBuffer (GraphicsConfiguration gc)
    {
        // if we have an old image, clear it out
        if (_backimg != null) {
            _backimg.flush();
            _bgfx.dispose();
        }

        // create the offscreen buffer
        int width = _window.getWidth(), height = _window.getHeight();
        _backimg = gc.createCompatibleVolatileImage(width, height);

        // fill the back buffer with white
        _bgfx = (Graphics2D)_backimg.getGraphics();
        _bgfx.fillRect(0, 0, width, height);

        // clear out our frame graphics in case that became invalid for
        // the same reasons our back buffer became invalid
        if (_fgfx != null) {
            _fgfx.dispose();
            _fgfx = null;
        }

//         Log.info("Created back buffer [" + width + "x" + height + "].");
    }
501599
function (poly, fill) {
            var context = this.backBufferContext2D;

            if (context.globalAlpha < 1 / 255) {
                // Fast path: don't draw fully transparent
                return;
            }

            this.translate(poly.pos.x, poly.pos.y);
            context.beginPath();
            context.moveTo(poly.points[0].x, poly.points[0].y);
            var point;
            for (var i = 1; i < poly.points.length; i++) {
                point = poly.points[i];
                context.lineTo(point.x, point.y);
            }
            context.lineTo(poly.points[0].x, poly.points[0].y);
            context[fill === true ? "fill" : "stroke"]();
            context.closePath();
            this.translate(-poly.pos.x, -poly.pos.y);
        }
221808
function(radius, resolution) {
            var expandedshell = this.expandedShell(radius, resolution, false);
            var result = this.subtract(expandedshell);
            result = result.reTesselated();
            result.properties = this.properties; // keep original properties
            return result;
        }
1244476
def make_surface(svgfile, backend)
      case backend.downcase.to_sym
      when :memory
        Cairo::ImageSurface.new(@width, @height)
      when :svg
        FileUtils.mkdir_p @deck.dir unless Dir.exists?(@deck.dir)
        Cairo::SVGSurface.new(svgfile, @width, @height)
      else
        Squib.logger.fatal "Back end not recognized: '#{backend}'"
        abort
      end
    end
1137647
protected void resizeForLayer( int width , int height ) {
		deriv1X.reshape(width,height);
		deriv1Y.reshape(width,height);
		deriv2X.reshape(width,height);
		deriv2Y.reshape(width,height);
		deriv2XX.reshape(width,height);
		deriv2YY.reshape(width,height);
		deriv2XY.reshape(width,height);

		warpImage2.reshape(width,height);
		warpDeriv2X.reshape(width,height);
		warpDeriv2Y.reshape(width,height);
		warpDeriv2XX.reshape(width,height);
		warpDeriv2YY.reshape(width,height);
		warpDeriv2XY.reshape(width,height);

		derivFlowUX.reshape(width,height);
		derivFlowUY.reshape(width,height);
		derivFlowVX.reshape(width,height);
		derivFlowVY.reshape(width,height);

		psiData.reshape(width,height);
		psiGradient.reshape(width,height);
		psiSmooth.reshape(width,height);

		divU.reshape(width,height);
		divV.reshape(width,height);
		divD.reshape(width,height);

		du.reshape(width,height);
		dv.reshape(width,height);
	}
51165
public int getResolutionIndex(double resolution) {
		double maximumResolution = getMaximumResolution();
		if (resolution >= maximumResolution) {
			return 0;
		}
		double minimumResolution = getMinimumResolution();
		if (resolution <= minimumResolution) {
			return resolutions.size() - 1;
		}

		for (int i = 0; i < resolutions.size(); i++) {
			double upper = resolutions.get(i);
			double lower = resolutions.get(i + 1);
			if (resolution < upper && resolution >= lower) {
				if (Math.abs(upper - resolution) >= Math.abs(lower - resolution)) {
					return i + 1;
				} else {
					return i;
				}
			}
		}
		return 0;
	}
1209723
def get_fallback_resolution(self):
        
        ppi = ffi.new('double[2]')
        cairo.cairo_surface_get_fallback_resolution(
            self._pointer, ppi + 0, ppi + 1)
        return tuple(ppi)
1287845
function(scales) {
        if(scales == null) {
            return;
        }
        var resolutions, i, len;
        len = scales.length;
        resolutions = new Array(len);
        for(i=0; i<len; i++) {
            resolutions[i] = OpenLayers.Util.getResolutionFromScale(
                scales[i], this.units);
        }
        return resolutions;
    }
397272
function (translationId, interpolateParams, Interpolator, sanitizeStrategy) {
      // Start with the fallbackLanguage with index 0
      return resolveForFallbackLanguageInstant((startFallbackIteration > 0 ? startFallbackIteration : fallbackIndex), translationId, interpolateParams, Interpolator, sanitizeStrategy);
    }
204578
def set_display_at_native_res(self, should_be_fullscreen=True):
        """"""
        # Loop through all our display modes until we find one that works well.
        for mode in self.display_modes:
            color_depth = pygame.display.mode_ok(mode)
            if color_depth is not 0:
                if should_be_fullscreen:
                    should_fill = pygame.FULLSCREEN
                else:
                    should_fill = 0

                self.backbuffer = pygame.display.set_mode(mode, should_fill, color_depth)
                break
630199
function startResolving(dir, importsToResolve) {
    return importsToResolve.length === 0
      ? Promise.reject()
      : resolve(dir, importsToResolve[0]).then(
          (resolvedFile) => {
            // Add the resolvedFilename as dependency. Although we're also using stats.includedFiles, this might come
            // in handy when an error occurs. In this case, we don't get stats.includedFiles from node-sass.
            addNormalizedDependency(resolvedFile);
            return {
              // By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it.
              file: resolvedFile.replace(matchCss, ''),
            };
          },
          () => startResolving(dir, tail(importsToResolve))
        );
  }
501854
void insertBackwardEdge(final ManagementEdge managementEdge, final int index) {

		while (index >= this.backwardEdges.size()) {
			this.backwardEdges.add(null);
		}

		this.backwardEdges.set(index, managementEdge);
	}
1353758
function(map) {
        /**
         * If nothing to do with resolutions has been set, assume a single
         * resolution determined by ratio*extent/size - if an image has a
         * pixel aspect ratio different than one (as calculated above), the
         * image will be stretched in one dimension only.
         */
        if( this.options.maxResolution == null ) {
            this.options.maxResolution = this.aspectRatio *
                                         this.extent.getWidth() /
                                         this.size.w;
        }
        OpenLayers.Layer.prototype.setMap.apply(this, arguments);
    }
348611
function (renderer, size) {
        renderer.saveClear();
        var viewport = renderer.viewport;
        var x = 0, y = 0;
        var width = size || viewport.width / 4;
        var height = width;
        if (this.softShadow === ShadowMapPass.VSM) {
            this._outputDepthPass.material.define('fragment', 'USE_VSM');
        }
        else {
            this._outputDepthPass.material.undefine('fragment', 'USE_VSM');
        }
        for (var name in this._textures) {
            var texture = this._textures[name];
            renderer.setViewport(x, y, width * texture.width / texture.height, height);
            this._outputDepthPass.setUniform('depthMap', texture);
            this._outputDepthPass.render(renderer);
            x += width * texture.width / texture.height;
        }
        renderer.setViewport(viewport);
        renderer.restoreClear();
    }