本文整理汇总了C++中TextureMapperLayer::opacity方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureMapperLayer::opacity方法的具体用法?C++ TextureMapperLayer::opacity怎么用?C++ TextureMapperLayer::opacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureMapperLayer
的用法示例。
在下文中一共展示了TextureMapperLayer::opacity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintToCurrentGLContext
void CoordinatedGraphicsScene::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect, const Color& backgroundColor, bool drawsBackground, const FloatPoint& contentPosition, TextureMapper::PaintFlags PaintFlags)
{
if (!m_textureMapper) {
m_textureMapper = TextureMapper::create();
static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
}
syncRemoteContent();
adjustPositionForFixedLayers(contentPosition);
TextureMapperLayer* currentRootLayer = rootLayer();
if (!currentRootLayer)
return;
#if USE(COORDINATED_GRAPHICS_THREADED)
for (auto& proxy : m_platformLayerProxies.values())
proxy->swapBuffer();
#endif
currentRootLayer->setTextureMapper(m_textureMapper.get());
currentRootLayer->applyAnimationsRecursively();
m_textureMapper->beginPainting(PaintFlags);
m_textureMapper->beginClip(TransformationMatrix(), clipRect);
if (drawsBackground) {
RGBA32 rgba = makeRGBA32FromFloats(backgroundColor.red(),
backgroundColor.green(), backgroundColor.blue(),
backgroundColor.alpha() * opacity);
m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), Color(rgba));
} else {
GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D();
context->clearColor(m_viewBackgroundColor.red() / 255.0f, m_viewBackgroundColor.green() / 255.0f, m_viewBackgroundColor.blue() / 255.0f, m_viewBackgroundColor.alpha() / 255.0f);
context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
}
if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
currentRootLayer->setOpacity(opacity);
currentRootLayer->setTransform(matrix);
}
currentRootLayer->paint();
m_fpsCounter.updateFPSAndDisplay(*m_textureMapper, clipRect.location(), matrix);
m_textureMapper->endClip();
m_textureMapper->endPainting();
if (currentRootLayer->descendantsOrSelfHaveRunningAnimations()) {
RefPtr<CoordinatedGraphicsScene> protector(this);
dispatchOnClientRunLoop([=] {
protector->updateViewport();
});
}
}
示例2: paintToCurrentGLContext
void CoordinatedGraphicsScene::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect, TextureMapper::PaintFlags PaintFlags)
{
if (!m_textureMapper) {
m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
}
ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
syncRemoteContent();
adjustPositionForFixedLayers();
TextureMapperLayer* currentRootLayer = rootLayer();
if (!currentRootLayer)
return;
TextureMapperLayer* layer = currentRootLayer;
if (!layer)
return;
layer->setTextureMapper(m_textureMapper.get());
layer->applyAnimationsRecursively();
m_textureMapper->beginPainting(PaintFlags);
m_textureMapper->beginClip(TransformationMatrix(), clipRect);
if (m_setDrawsBackground) {
RGBA32 rgba = makeRGBA32FromFloats(m_backgroundColor.red(),
m_backgroundColor.green(), m_backgroundColor.blue(),
m_backgroundColor.alpha() * opacity);
m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), Color(rgba));
}
if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
currentRootLayer->setOpacity(opacity);
currentRootLayer->setTransform(matrix);
}
layer->paint();
m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location(), matrix);
m_textureMapper->endClip();
m_textureMapper->endPainting();
if (layer->descendantsOrSelfHaveRunningAnimations())
dispatchOnMainThread(bind(&CoordinatedGraphicsScene::updateViewport, this));
}