Exemplo n.º 1
0
void CCRenderPass::appendQuadsForRenderSurfaceLayer(CCLayerImpl* layer)
{
    // FIXME: render surface layers should be a CCLayerImpl-derived class and
    // not be handled specially here.
    CCRenderSurface* surface = layer->renderSurface();
    OwnPtr<CCSharedQuadState> sharedQuadState = surface->createSharedQuadState();
    if (layer->hasDebugBorders()) {
        Color color(debugSurfaceBorderColorRed, debugSurfaceBorderColorGreen, debugSurfaceBorderColorBlue, debugSurfaceBorderAlpha);
        m_quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState.get(), surface->contentRect(), color, debugSurfaceBorderWidth));
    }
    bool isReplica = false;
    m_quadList.append(CCRenderSurfaceDrawQuad::create(sharedQuadState.get(), surface->contentRect(), layer, surfaceDamageRect(), isReplica));
    m_sharedQuadStateList.append(sharedQuadState.release());

    // Add replica after the surface so that it appears below the surface.
    if (surface->hasReplica()) {
        OwnPtr<CCSharedQuadState> sharedQuadState = surface->createReplicaSharedQuadState();
        if (layer->hasDebugBorders()) {
            Color color(debugReplicaBorderColorRed, debugReplicaBorderColorGreen, debugReplicaBorderColorBlue, debugSurfaceBorderAlpha);
            m_quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState.get(), surface->contentRect(), color, debugSurfaceBorderWidth));
        }
        bool isReplica = true;
        m_quadList.append(CCRenderSurfaceDrawQuad::create(sharedQuadState.get(), surface->contentRect(), layer, surfaceDamageRect(), isReplica));
        m_sharedQuadStateList.append(sharedQuadState.release());
    }
}
Exemplo n.º 2
0
void CCRenderPass::appendQuadsForRenderSurfaceLayer(CCLayerImpl* layer)
{
    // FIXME: render surface layers should be a CCLayerImpl-derived class and
    // not be handled specially here.
    CCRenderSurface* surface = layer->renderSurface();
    OwnPtr<CCSharedQuadState> sharedQuadState = surface->createSharedQuadState();
    m_quadList.append(CCRenderSurfaceDrawQuad::create(sharedQuadState.get(), surface->contentRect(), layer, surfaceDamageRect()));
    m_sharedQuadStateList.append(sharedQuadState.release());
}