本文整理汇总了C++中TextureMapperLayer类的典型用法代码示例。如果您正苦于以下问题:C++ TextureMapperLayer类的具体用法?C++ TextureMapperLayer怎么用?C++ TextureMapperLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextureMapperLayer类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ASSERT
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: ASSERT
void CoordinatedGraphicsScene::paintToGraphicsContext(PlatformGraphicsContext* platformContext, const Color& backgroundColor, bool drawsBackground)
{
if (!m_textureMapper)
m_textureMapper = TextureMapper::create();
ASSERT(m_textureMapper->accelerationMode() == TextureMapper::SoftwareMode);
syncRemoteContent();
TextureMapperLayer* layer = rootLayer();
if (!layer)
return;
GraphicsContext graphicsContext(platformContext);
m_textureMapper->setGraphicsContext(&graphicsContext);
m_textureMapper->beginPainting();
IntRect clipRect = graphicsContext.clipBounds();
if (drawsBackground)
m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), backgroundColor);
else
m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), m_viewBackgroundColor);
layer->paint();
m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location());
m_textureMapper->endPainting();
m_textureMapper->setGraphicsContext(0);
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:26,代码来源:CoordinatedGraphicsScene.cpp
示例3: GraphicsLayerTextureMapper
PassOwnPtr<GraphicsLayer> LayerTreeRenderer::createLayer(WebLayerID layerID)
{
GraphicsLayer* newLayer = new GraphicsLayerTextureMapper(this);
TextureMapperLayer* layer = toTextureMapperLayer(newLayer);
layer->setShouldUpdateBackingStoreFromLayer(false);
return adoptPtr(newLayer);
}
开发者ID:kseo,项目名称:webkit,代码行数:7,代码来源:LayerTreeRenderer.cpp
示例4: while
void TextureMapperLayer::removeAllChildren()
{
while (m_children.size()) {
TextureMapperLayer* curLayer = m_children[0];
ASSERT(curLayer->m_parent);
curLayer->removeFromParent();
}
}
开发者ID:boska,项目名称:webkit,代码行数:8,代码来源:TextureMapperLayer.cpp
示例5: toTextureMapperLayer
void LayerTreeHostProxy::syncAnimations()
{
TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
ASSERT(layer);
layer->syncAnimationsRecursively();
if (layer->descendantsOrSelfHaveRunningAnimations())
updateViewport();
}
开发者ID:,项目名称:,代码行数:9,代码来源:
示例6: ASSERT
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();
GraphicsLayer* currentRootLayer = rootLayer();
if (!currentRootLayer)
return;
TextureMapperLayer* layer = toTextureMapperLayer(currentRootLayer);
if (!layer)
return;
layer->setTextureMapper(m_textureMapper.get());
if (!m_animationsLocked)
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);
currentRootLayer->flushCompositingStateForThisLayerOnly();
}
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));
#if ENABLE(REQUEST_ANIMATION_FRAME)
if (m_animationFrameRequested) {
m_animationFrameRequested = false;
dispatchOnMainThread(bind(&CoordinatedGraphicsScene::animationFrameReady, this));
}
#endif
}
开发者ID:fmalita,项目名称:webkit,代码行数:54,代码来源:CoordinatedGraphicsScene.cpp
示例7: scrollableLayerHitTestCondition
bool TextureMapperLayer::scrollableLayerHitTestCondition(TextureMapperLayer* layer, const FloatPoint& point)
{
// scrolling layer's m_parent->m_parent, the parent of the scrolling layes, is the one that defines the
// rectangle to be used for hit testing.
if (!layer->isScrollable() || !layer->m_parent || !layer->m_parent->m_parent)
return false;
TextureMapperLayer* parentLayer = layer->m_parent->m_parent;
FloatRect rect = parentLayer->layerRect();
return parentLayer->m_currentTransform.combined().mapQuad(rect).containsPoint(point);
}
开发者ID:reaven15,项目名称:webkit,代码行数:11,代码来源:TextureMapperLayer.cpp
示例8: ensureLayer
PassRefPtr<LayerBackingStore> LayerTreeHostProxy::getBackingStore(WebLayerID id)
{
ensureLayer(id);
TextureMapperLayer* layer = toTextureMapperLayer(layerByID(id));
RefPtr<LayerBackingStore> backingStore = static_cast<LayerBackingStore*>(layer->backingStore().get());
if (!backingStore) {
backingStore = LayerBackingStore::create();
layer->setBackingStore(backingStore.get());
}
ASSERT(backingStore);
return backingStore;
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例9: toTextureMapperLayer
PassRefPtr<CoordinatedBackingStore> LayerTreeRenderer::getBackingStore(WebLayerID id)
{
TextureMapperLayer* layer = toTextureMapperLayer(layerByID(id));
ASSERT(layer);
RefPtr<CoordinatedBackingStore> backingStore = static_cast<CoordinatedBackingStore*>(layer->backingStore().get());
if (!backingStore) {
backingStore = CoordinatedBackingStore::create();
layer->setBackingStore(backingStore.get());
}
ASSERT(backingStore);
return backingStore;
}
开发者ID:kseo,项目名称:webkit,代码行数:12,代码来源:LayerTreeRenderer.cpp
示例10: syncRemoteContent
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();
});
}
}
开发者ID:runt18,项目名称:webkit,代码行数:52,代码来源:CoordinatedGraphicsScene.cpp
示例11: ASSERT
void LayerTreeHostProxy::paintToGraphicsContext(QPainter* painter)
{
if (!m_textureMapper)
m_textureMapper = TextureMapper::create();
ASSERT(m_textureMapper->accelerationMode() == TextureMapper::SoftwareMode);
syncRemoteContent();
TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
if (!layer)
return;
GraphicsContext graphicsContext(painter);
m_textureMapper->setGraphicsContext(&graphicsContext);
m_textureMapper->beginPainting();
m_textureMapper->bindSurface(0);
layer->paint();
m_textureMapper->endPainting();
m_textureMapper->setGraphicsContext(0);
}
开发者ID:,项目名称:,代码行数:19,代码来源:
示例12: syncCompositingStateSelf
void TextureMapperLayer::syncCompositingState(GraphicsLayerTextureMapper* graphicsLayer, TextureMapper* textureMapper, int options)
{
if (!textureMapper)
return;
if (graphicsLayer && !(options & ComputationsOnly)) {
syncCompositingStateSelf(graphicsLayer, textureMapper);
graphicsLayer->didSynchronize();
}
if (graphicsLayer && m_state.maskLayer) {
m_state.maskLayer->syncCompositingState(toGraphicsLayerTextureMapper(graphicsLayer->maskLayer()), textureMapper);
// A mask layer has its parent's size by default, in case it's not set specifically.
if (m_state.maskLayer->m_size.isEmpty())
m_state.maskLayer->m_size = m_size;
}
if (m_state.replicaLayer)
m_state.replicaLayer->syncCompositingState(toGraphicsLayerTextureMapper(graphicsLayer->replicaLayer()), textureMapper);
syncAnimations();
updateBackingStore(textureMapper, graphicsLayer);
if (!(options & TraverseDescendants))
options = ComputationsOnly;
if (graphicsLayer) {
Vector<GraphicsLayer*> children = graphicsLayer->children();
for (int i = children.size() - 1; i >= 0; --i) {
TextureMapperLayer* layer = toTextureMapperLayer(children[i]);
if (!layer)
continue;
layer->syncCompositingState(toGraphicsLayerTextureMapper(children[i]), textureMapper, options);
}
} else {
for (int i = m_children.size() - 1; i >= 0; --i)
m_children[i]->syncCompositingState(0, textureMapper, options);
}
}
开发者ID:,项目名称:,代码行数:40,代码来源:
示例13: toTextureMapperLayer
void LayerTreeRenderer::createBackingStoreIfNeeded(GraphicsLayer* graphicsLayer)
{
TextureMapperLayer* layer = toTextureMapperLayer(graphicsLayer);
ASSERT(layer);
// Make sure the layer does not already have a backing store (committed or pending).
BackingStoreMap::iterator it = m_pendingSyncBackingStores.find(layer);
if (it != m_pendingSyncBackingStores.end()) {
if (!it->value) {
// There is a pending removal, cancel it.
m_pendingSyncBackingStores.remove(it);
}
// There is already a pending addition.
return;
}
if (layer->backingStore())
return; // The layer already has a backing store (and no pending removal).
RefPtr<CoordinatedBackingStore> backingStore(CoordinatedBackingStore::create());
backingStore->setSize(graphicsLayer->size());
ASSERT(!m_pendingSyncBackingStores.contains(layer));
m_pendingSyncBackingStores.add(layer, backingStore);
}
开发者ID:anger123520,项目名称:qtwebkit-23_from_gitorious,代码行数:23,代码来源:LayerTreeRenderer.cpp
示例14: layerRect
void TextureMapperLayer::computeOverlapRegions(Region& overlapRegion, Region& nonOverlapRegion, ResolveSelfOverlapMode mode)
{
if (!m_state.visible || !m_state.contentsVisible)
return;
FloatRect boundingRect;
if (m_backingStore || m_state.masksToBounds || m_state.maskLayer || hasFilters())
boundingRect = layerRect();
else if (m_contentsLayer || m_state.solidColor.alpha())
boundingRect = m_state.contentsRect;
#if ENABLE(CSS_FILTERS)
if (m_currentFilters.hasOutsets()) {
FilterOutsets outsets = m_currentFilters.outsets();
IntRect unfilteredTargetRect(boundingRect);
boundingRect.move(std::max(0, -outsets.left()), std::max(0, -outsets.top()));
boundingRect.expand(outsets.left() + outsets.right(), outsets.top() + outsets.bottom());
boundingRect.unite(unfilteredTargetRect);
}
#endif
TransformationMatrix replicaMatrix;
if (m_state.replicaLayer) {
replicaMatrix = replicaTransform();
boundingRect.unite(replicaMatrix.mapRect(boundingRect));
}
boundingRect = m_currentTransform.combined().mapRect(boundingRect);
// Count all masks and filters as overlap layers.
if (hasFilters() || m_state.maskLayer || (m_state.replicaLayer && m_state.replicaLayer->m_state.maskLayer)) {
Region newOverlapRegion(enclosingIntRect(boundingRect));
nonOverlapRegion.subtract(newOverlapRegion);
overlapRegion.unite(newOverlapRegion);
return;
}
Region newOverlapRegion;
Region newNonOverlapRegion(enclosingIntRect(boundingRect));
if (!m_state.masksToBounds) {
for (size_t i = 0; i < m_children.size(); ++i) {
TextureMapperLayer* child = m_children[i];
child->computeOverlapRegions(newOverlapRegion, newNonOverlapRegion, ResolveSelfOverlapIfNeeded);
}
}
if (m_state.replicaLayer) {
newOverlapRegion.unite(replicaMatrix.mapRect(newOverlapRegion.bounds()));
Region replicaRegion(replicaMatrix.mapRect(newNonOverlapRegion.bounds()));
resolveOverlaps(replicaRegion, newOverlapRegion, newNonOverlapRegion);
}
if ((mode != ResolveSelfOverlapAlways) && shouldBlend()) {
newNonOverlapRegion.unite(newOverlapRegion);
newOverlapRegion = Region();
}
overlapRegion.unite(newOverlapRegion);
resolveOverlaps(newNonOverlapRegion, overlapRegion, nonOverlapRegion);
}
开发者ID:boska,项目名称:webkit,代码行数:61,代码来源:TextureMapperLayer.cpp
注:本文中的TextureMapperLayer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论