当前位置: 首页>>代码示例>>C++>>正文


C++ GraphicsLayer::syncCompositingStateForThisLayerOnly方法代码示例

本文整理汇总了C++中GraphicsLayer::syncCompositingStateForThisLayerOnly方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsLayer::syncCompositingStateForThisLayerOnly方法的具体用法?C++ GraphicsLayer::syncCompositingStateForThisLayerOnly怎么用?C++ GraphicsLayer::syncCompositingStateForThisLayerOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsLayer的用法示例。


在下文中一共展示了GraphicsLayer::syncCompositingStateForThisLayerOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: paintToCurrentGLContext

void LayerTreeRenderer::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect, TextureMapper::PaintFlags PaintFlags)
{
    if (!m_textureMapper)
        m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
    ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);

    adjustPositionForFixedLayers();
    GraphicsLayer* currentRootLayer = rootLayer();
    if (!currentRootLayer)
        return;

    TextureMapperLayer* layer = toTextureMapperLayer(currentRootLayer);

    if (!layer)
        return;

    layer->setTextureMapper(m_textureMapper.get());
    m_textureMapper->beginPainting(PaintFlags);
    m_textureMapper->beginClip(TransformationMatrix(), clipRect);

    if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
        currentRootLayer->setOpacity(opacity);
        currentRootLayer->setTransform(matrix);
        currentRootLayer->syncCompositingStateForThisLayerOnly();
    }

    layer->paint();
    m_textureMapper->endClip();
    m_textureMapper->endPainting();
}
开发者ID:kseo,项目名称:webkit,代码行数:30,代码来源:LayerTreeRenderer.cpp

示例2: paintToCurrentGLContext

// This function needs to be reentrant.
void LayerTreeHostProxy::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity)
{
    if (!m_textureMapper)
        m_textureMapper = TextureMapperGL::create();

    syncRemoteContent();
    GraphicsLayer* currentRootLayer = rootLayer();
    if (!currentRootLayer)
        return;

    TextureMapperNode* node = toTextureMapperNode(currentRootLayer);

    if (!node)
        return;

    GLint viewport[4];
    glGetIntegerv(GL_VIEWPORT, viewport);
    IntRect viewportRect(viewport[0], viewport[1], viewport[2], viewport[3]);
    m_textureMapper->setViewportSize(IntSize(viewport[2], viewport[3]));
    node->setTextureMapper(m_textureMapper.get());
    m_textureMapper->beginPainting();
    m_textureMapper->bindSurface(0);

    if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
        currentRootLayer->setOpacity(opacity);
        currentRootLayer->setTransform(matrix);
        currentRootLayer->syncCompositingStateForThisLayerOnly();
    }

    TextureMapperNode::NodeRectMap nodeVisualContentsRectMap;
    if (node->collectVisibleContentsRects(nodeVisualContentsRectMap, viewportRect)) {
        TextureMapperNode::NodeRectMap::iterator endIterator = nodeVisualContentsRectMap.end();
        for (TextureMapperNode::NodeRectMap::iterator it = nodeVisualContentsRectMap.begin(); it != endIterator; ++it) {
            WebLayerID layerID = it->first->id();
            // avoid updating non-synced root layer
            if (!layerID)
                continue;
            IntRect visibleRect = IntRect(it->second);
            setVisibleContentsRectForLayer(layerID, visibleRect);
        }
    }
    node->paint();

    m_textureMapper->endPainting();

    if (node->descendantsOrSelfHaveRunningAnimations()) {
        node->syncAnimationsRecursively();
        m_viewportUpdateTimer.startOneShot(0);
    }
}
开发者ID:,项目名称:,代码行数:51,代码来源:


注:本文中的GraphicsLayer::syncCompositingStateForThisLayerOnly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。