Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
void LayerRendererChromium::setScissorToRect(const IntRect& scissorRect)
{
    IntRect contentRect = (m_currentRenderSurface ? m_currentRenderSurface->m_contentRect : m_defaultRenderSurface->m_contentRect);

    // The scissor coordinates must be supplied in viewport space so we need to offset
    // by the relative position of the top left corner of the current render surface.
    int scissorX = scissorRect.x() - contentRect.x();
    // When rendering to the default render surface we're rendering upside down so the top
    // of the GL scissor is the bottom of our layer.
    // But, if rendering to offscreen texture, we reverse our sense of 'upside down'.
    int scissorY;
    if (m_currentRenderSurface == m_defaultRenderSurface && !m_compositeOffscreen)
        scissorY = m_currentRenderSurface->m_contentRect.height() - (scissorRect.maxY() - m_currentRenderSurface->m_contentRect.y());
    else
        scissorY = scissorRect.y() - contentRect.y();
    GLC(m_context.get(), m_context->scissor(scissorX, scissorY, scissorRect.width(), scissorRect.height()));
}
// Sets the scissor region to the given rectangle. The coordinate system for the
// scissorRect has its origin at the top left corner of the current visible rect.
Sets the scissor region to the given rectangle. The coordinate system for the
scissorRect has its origin at the top left corner of the current visible rect.
Sets the scissor region to the given rectangle . The coordinate system for the scissorRect has its origin at the top left corner of the current visible rect .
void LayerRendererChromium::setScissorToRect(const IntRect& scissorRect)
{
    IntRect contentRect = (m_currentRenderSurface ? m_currentRenderSurface->m_contentRect : m_defaultRenderSurface->m_contentRect);
    int scissorX = scissorRect.x() - contentRect.x();
    int scissorY;
    if (m_currentRenderSurface == m_defaultRenderSurface && !m_compositeOffscreen)
        scissorY = m_currentRenderSurface->m_contentRect.height() - (scissorRect.maxY() - m_currentRenderSurface->m_contentRect.y());
    else
        scissorY = scissorRect.y() - contentRect.y();
    GLC(m_context.get(), m_context->scissor(scissorX, scissorY, scissorRect.width(), scissorRect.height()));
}
void LayerRendererChromium :: setScissorToRect ( const IntRect & scissorRect ) { IntRect contentRect = ( m_currentRenderSurface ? m_currentRenderSurface -> m_contentRect : m_defaultRenderSurface -> m_contentRect ) ; int scissorX = scissorRect . x ( ) - contentRect . x ( ) ; int scissorY ; if ( m_currentRenderSurface == m_defaultRenderSurface && ! m_compositeOffscreen ) scissorY = m_currentRenderSurface -> m_contentRect . height ( ) - ( scissorRect . maxY ( ) - m_currentRenderSurface -> m_contentRect . y ( ) ) ; else scissorY = scissorRect . y ( ) - contentRect . y ( ) ; GLC ( m_context . get ( ) , m_context -> scissor ( scissorX , scissorY , scissorRect . width ( ) , scissorRect . height ( ) ) ) ; }
Sets the scissor region to the given rectangle.
Sets the scissor region to the given rectangle .
// The scissor coordinates must be supplied in viewport space so we need to offset // by the relative position of the top left corner of the current render surface. // When rendering to the default render surface we're rendering upside down so the top // of the GL scissor is the bottom of our layer. // But, if rendering to offscreen texture, we reverse our sense of 'upside down'.