本文整理汇总了C++中scheduleLayerFlush函数的典型用法代码示例。如果您正苦于以下问题:C++ scheduleLayerFlush函数的具体用法?C++ scheduleLayerFlush怎么用?C++ scheduleLayerFlush使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scheduleLayerFlush函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createPageOverlayLayer
void LayerTreeHostCA::initialize()
{
// Create a root layer.
m_rootLayer = GraphicsLayer::create(graphicsLayerFactory(), this);
#ifndef NDEBUG
m_rootLayer->setName("LayerTreeHost root layer");
#endif
m_rootLayer->setDrawsContent(false);
m_rootLayer->setSize(m_webPage->size());
static_cast<GraphicsLayerCA*>(m_rootLayer.get())->platformCALayer()->setGeometryFlipped(true);
m_nonCompositedContentLayer = GraphicsLayer::create(graphicsLayerFactory(), this);
static_cast<GraphicsLayerCA*>(m_nonCompositedContentLayer.get())->setAllowTiledLayer(false);
#ifndef NDEBUG
m_nonCompositedContentLayer->setName("LayerTreeHost non-composited content");
#endif
m_nonCompositedContentLayer->setDrawsContent(true);
m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground());
m_nonCompositedContentLayer->setSize(m_webPage->size());
if (m_webPage->corePage()->settings()->acceleratedDrawingEnabled())
m_nonCompositedContentLayer->setAcceleratesDrawing(true);
m_rootLayer->addChild(m_nonCompositedContentLayer.get());
if (m_webPage->hasPageOverlay())
createPageOverlayLayer();
platformInitialize();
setLayerFlushSchedulingEnabled(!m_webPage->drawingArea() || !m_webPage->drawingArea()->layerTreeStateIsFrozen());
scheduleLayerFlush();
}
示例2: destroyPageOverlayLayer
void CoordinatedLayerTreeHost::didUninstallPageOverlay(PageOverlay*)
{
m_pageOverlay = 0;
destroyPageOverlayLayer();
scheduleLayerFlush();
}
示例3: toCoordinatedGraphicsLayer
void CoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, float scale, const FloatPoint& trajectoryVector)
{
bool contentsRectDidChange = rect != m_visibleContentsRect;
bool contentsScaleDidChange = scale != m_contentsScale;
// A zero trajectoryVector indicates that tiles all around the viewport are requested.
toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);
if (contentsRectDidChange || contentsScaleDidChange) {
m_visibleContentsRect = rect;
m_contentsScale = scale;
HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator end = m_registeredLayers.end();
for (HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it) {
if (contentsScaleDidChange)
(*it)->setContentsScale(scale);
if (contentsRectDidChange)
(*it)->setNeedsVisibleRectAdjustment();
}
}
scheduleLayerFlush();
if (m_webPage->useFixedLayout()) {
// Round the rect instead of enclosing it to make sure that its size stays
// the same while panning. This can have nasty effects on layout.
m_webPage->setFixedVisibleContentRect(roundedIntRect(rect));
}
if (contentsRectDidChange)
m_shouldSendScrollPositionUpdate = true;
}
示例4: gtk_widget_get_allocation
void AcceleratedCompositingContext::initialize()
{
if (m_rootLayer)
return;
GtkAllocation allocation;
gtk_widget_get_allocation(GTK_WIDGET(m_webView), &allocation);
IntSize pageSize(allocation.width, allocation.height);
m_rootLayer = GraphicsLayer::create(0, this);
m_rootLayer->setDrawsContent(false);
m_rootLayer->setSize(pageSize);
// The non-composited contents are a child of the root layer.
m_nonCompositedContentLayer = GraphicsLayer::create(0, this);
m_nonCompositedContentLayer->setDrawsContent(true);
m_nonCompositedContentLayer->setContentsOpaque(!m_webView->priv->transparent);
m_nonCompositedContentLayer->setSize(pageSize);
if (core(m_webView)->settings()->acceleratedDrawingEnabled())
m_nonCompositedContentLayer->setAcceleratesDrawing(true);
#ifndef NDEBUG
m_rootLayer->setName("Root layer");
m_nonCompositedContentLayer->setName("Non-composited content");
#endif
m_rootLayer->addChild(m_nonCompositedContentLayer.get());
m_nonCompositedContentLayer->setNeedsDisplay();
scheduleLayerFlush();
}
示例5: gtk_widget_size_allocate
void AcceleratedCompositingContext::resizeRootLayer(const IntSize& newSize)
{
if (!m_rootLayerEmbedder)
return;
if (m_rootLayer->size() == newSize)
return;
GtkAllocation allocation;
allocation.x = 0;
allocation.y = 0;
allocation.width = newSize.width();
allocation.height = newSize.height();
gtk_widget_size_allocate(GTK_WIDGET(m_rootLayerEmbedder), &allocation);
m_rootLayer->setSize(newSize);
// If the newSize exposes new areas of the non-composited content a setNeedsDisplay is needed
// for those newly exposed areas.
FloatSize oldSize = m_nonCompositedContentLayer->size();
m_nonCompositedContentLayer->setSize(newSize);
if (newSize.width() > oldSize.width()) {
float height = std::min(static_cast<float>(newSize.height()), oldSize.height());
m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(oldSize.width(), 0, newSize.width() - oldSize.width(), height));
}
if (newSize.height() > oldSize.height())
m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(0, oldSize.height(), newSize.width(), newSize.height() - oldSize.height()));
m_nonCompositedContentLayer->setNeedsDisplayInRect(IntRect(IntPoint(), newSize));
scheduleLayerFlush();
}
示例6: ASSERT
void CoordinatedLayerTreeHost::didInstallPageOverlay(PageOverlay* pageOverlay)
{
ASSERT(!m_pageOverlay);
m_pageOverlay = pageOverlay;
createPageOverlayLayer();
scheduleLayerFlush();
}
示例7: scheduleLayerFlush
void LayerTreeHostCA::setNonCompositedContentsNeedDisplay(const IntRect& rect)
{
m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
if (m_pageOverlayLayer)
m_pageOverlayLayer->setNeedsDisplayInRect(rect);
scheduleLayerFlush();
}
示例8: scheduleLayerFlush
void LayerTreeHostGtk::setPageOverlayNeedsDisplay(PageOverlay* pageOverlay, const IntRect& rect)
{
GraphicsLayer* layer = m_pageOverlayLayers.get(pageOverlay);
if (!layer)
return;
layer->setNeedsDisplayInRect(rect);
scheduleLayerFlush();
}
示例9: scheduleLayerFlush
void CoordinatedLayerTreeHost::scheduleAnimation()
{
if (m_isWaitingForRenderer)
return;
if (m_layerFlushTimer.isActive())
return;
m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime());
scheduleLayerFlush();
}
示例10: scheduleLayerFlush
void LayerTreeHostCA::sizeDidChange(const IntSize& newSize)
{
m_rootLayer->setSize(newSize);
m_nonCompositedContentLayer->setSize(newSize);
if (m_pageOverlayLayer)
m_pageOverlayLayer->setSize(newSize);
scheduleLayerFlush();
flushPendingLayerChanges();
}
示例11: scheduleLayerFlush
void AcceleratedCompositingContext::setNonCompositedContentsNeedDisplay(const IntRect& rect)
{
if (!m_rootLayer)
return;
if (rect.isEmpty()) {
m_rootLayer->setNeedsDisplay();
return;
}
m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
scheduleLayerFlush();
}
示例12: scheduleLayerFlush
void LayerTreeHostCAWin::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
{
if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
return;
m_layerFlushSchedulingEnabled = layerFlushingEnabled;
if (m_layerFlushSchedulingEnabled) {
scheduleLayerFlush();
return;
}
LayerChangesFlusher::shared().cancelPendingFlush(this);
}
示例13: ASSERT
void LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(uint64_t handle)
{
m_layerTreeContext.contextID = handle;
// The creation of the TextureMapper needs an active OpenGL context.
if (!makeContextCurrent())
return;
ASSERT(m_isValid);
ASSERT(!m_textureMapper);
m_textureMapper = TextureMapper::create();
static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get());
scheduleLayerFlush();
}
示例14: roundedIntPoint
void ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector, float scale)
{
m_coordinator->setVisibleContentsRect(rect, trajectoryVector);
if (m_lastScrollPosition != roundedIntPoint(rect.location())) {
m_lastScrollPosition = roundedIntPoint(rect.location());
if (!m_webPage->corePage()->mainFrame().view()->useFixedLayout())
m_webPage->corePage()->mainFrame().view()->notifyScrollPositionChanged(m_lastScrollPosition);
}
if (m_lastScaleFactor != scale) {
m_lastScaleFactor = scale;
didScaleFactorChanged(m_lastScaleFactor, m_lastScrollPosition);
}
scheduleLayerFlush();
}