Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
bool LayerRendererChromium::isLayerVisible(LayerChromium* layer, const TransformationMatrix& matrix, const IntRect& visibleRect)
{
    // Form the matrix used by the shader to map the corners of the layer's
    // bounds into clip space.
    TransformationMatrix renderMatrix = matrix;
    renderMatrix.scale3d(layer->bounds().width(), layer->bounds().height(), 1);
    renderMatrix = m_projectionMatrix * renderMatrix;

    FloatRect layerRect(-0.5, -0.5, 1, 1);
    FloatRect mappedRect = renderMatrix.mapRect(layerRect);

    // The layer is visible if it intersects any part of a rectangle whose origin
    // is at (-1, -1) and size is 2x2.
    return mappedRect.intersects(FloatRect(-1, -1, 2, 2));
}
// Returns true if any part of the layer falls within the visibleRect
Returns true if any part of the layer falls within the visibleRect
Returns true if any part of the layer falls within the visibleRect
bool LayerRendererChromium::isLayerVisible(LayerChromium* layer, const TransformationMatrix& matrix, const IntRect& visibleRect)
{
    TransformationMatrix renderMatrix = matrix;
    renderMatrix.scale3d(layer->bounds().width(), layer->bounds().height(), 1);
    renderMatrix = m_projectionMatrix * renderMatrix;
    FloatRect layerRect(-0.5, -0.5, 1, 1);
    FloatRect mappedRect = renderMatrix.mapRect(layerRect);
    return mappedRect.intersects(FloatRect(-1, -1, 2, 2));
}
bool LayerRendererChromium :: isLayerVisible ( LayerChromium * layer , const TransformationMatrix & matrix , const IntRect & visibleRect ) { TransformationMatrix renderMatrix = matrix ; renderMatrix . scale3d ( layer -> bounds ( ) . width ( ) , layer -> bounds ( ) . height ( ) , 1 ) ; renderMatrix = m_projectionMatrix * renderMatrix ; FloatRect layerRect ( -0.5 , -0.5 , 1 , 1 ) ; FloatRect mappedRect = renderMatrix . mapRect ( layerRect ) ; return mappedRect . intersects ( FloatRect ( -1 , -1 , 2 , 2 ) ) ; }
Returns true if any part of the layer falls within the visibleRect
Returns true if any part of the layer falls within the visibleRect
// Form the matrix used by the shader to map the corners of the layer's // bounds into clip space. // The layer is visible if it intersects any part of a rectangle whose origin // is at (-1, -1) and size is 2x2.