本文整理汇总了C++中WebCompositorSupport类的典型用法代码示例。如果您正苦于以下问题:C++ WebCompositorSupport类的具体用法?C++ WebCompositorSupport怎么用?C++ WebCompositorSupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebCompositorSupport类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: startHighlightAnimationIfNeeded
void LinkHighlight::startHighlightAnimationIfNeeded()
{
if (m_isAnimating)
return;
m_isAnimating = true;
const float startOpacity = 1;
// FIXME: Should duration be configurable?
const float fadeDuration = 0.1f;
const float minPreFadeDuration = 0.1f;
m_contentLayer->layer()->setOpacity(startOpacity);
WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport();
OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(compositorSupport->createFloatAnimationCurve());
curve->add(WebFloatKeyframe(0, startOpacity));
// Make sure we have displayed for at least minPreFadeDuration before starting to fade out.
float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast<float>(monotonicallyIncreasingTime() - m_startTime));
if (extraDurationRequired)
curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity));
// For layout tests we don't fade out.
curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, blink::layoutTestMode() ? startOpacity : 0));
OwnPtr<WebAnimation> animation = adoptPtr(compositorSupport->createAnimation(*curve, WebAnimation::TargetPropertyOpacity));
m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->addAnimation(animation.leakPtr());
invalidate();
m_owningWebViewImpl->scheduleAnimation();
}
开发者ID:junmin-zhu,项目名称:blink,代码行数:33,代码来源:LinkHighlight.cpp
示例2: m_node
LinkHighlightImpl::LinkHighlightImpl(Node* node, WebViewImpl* owningWebViewImpl)
: m_node(node)
, m_owningWebViewImpl(owningWebViewImpl)
, m_currentGraphicsLayer(0)
, m_geometryNeedsUpdate(false)
, m_isAnimating(false)
, m_startTime(monotonicallyIncreasingTime())
{
ASSERT(m_node);
ASSERT(owningWebViewImpl);
WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport();
ASSERT(compositorSupport);
m_contentLayer = adoptPtr(compositorSupport->createContentLayer(this));
m_clipLayer = adoptPtr(compositorSupport->createLayer());
m_clipLayer->setTransformOrigin(WebFloatPoint3D());
m_clipLayer->addChild(m_contentLayer->layer());
if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
m_compositorPlayer = adoptPtr(compositorSupport->createAnimationPlayer());
ASSERT(m_compositorPlayer);
m_compositorPlayer->setAnimationDelegate(this);
if (m_owningWebViewImpl->linkHighlightsTimeline())
m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this);
m_compositorPlayer->attachLayer(m_contentLayer->layer());
} else {
owningWebViewImpl->registerForAnimations(m_contentLayer->layer());
m_contentLayer->layer()->setAnimationDelegate(this);
}
m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->setOpacity(1);
m_geometryNeedsUpdate = true;
updateGeometry();
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:32,代码来源:LinkHighlightImpl.cpp
示例3: m_node
LinkHighlightImpl::LinkHighlightImpl(Node* node, WebViewImpl* owningWebViewImpl)
: m_node(node)
, m_owningWebViewImpl(owningWebViewImpl)
, m_currentGraphicsLayer(0)
, m_isScrollingGraphicsLayer(false)
, m_geometryNeedsUpdate(false)
, m_isAnimating(false)
, m_startTime(monotonicallyIncreasingTime())
{
DCHECK(m_node);
DCHECK(owningWebViewImpl);
WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport();
DCHECK(compositorSupport);
m_contentLayer = wrapUnique(compositorSupport->createContentLayer(this));
m_clipLayer = wrapUnique(compositorSupport->createLayer());
m_clipLayer->setTransformOrigin(WebFloatPoint3D());
m_clipLayer->addChild(m_contentLayer->layer());
m_compositorPlayer = CompositorAnimationPlayer::create();
DCHECK(m_compositorPlayer);
m_compositorPlayer->setAnimationDelegate(this);
if (m_owningWebViewImpl->linkHighlightsTimeline())
m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this);
CompositorElementId elementId = createCompositorElementId(DOMNodeIds::idForNode(node), CompositorSubElementId::LinkHighlight);
m_compositorPlayer->attachElement(elementId);
m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->setOpacity(1);
m_contentLayer->layer()->setElementId(elementId);
m_geometryNeedsUpdate = true;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:31,代码来源:LinkHighlightImpl.cpp
示例4: m_node
LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl)
: m_node(node)
, m_owningWebViewImpl(owningWebViewImpl)
, m_currentGraphicsLayer(0)
, m_geometryNeedsUpdate(false)
, m_isAnimating(false)
, m_startTime(monotonicallyIncreasingTime())
{
ASSERT(m_node);
ASSERT(owningWebViewImpl);
WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport();
m_contentLayer = adoptPtr(compositorSupport->createContentLayer(this));
m_clipLayer = adoptPtr(compositorSupport->createLayer());
m_clipLayer->setAnchorPoint(WebFloatPoint());
m_clipLayer->addChild(m_contentLayer->layer());
m_contentLayer->layer()->setAnimationDelegate(this);
m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->setOpacity(1);
m_geometryNeedsUpdate = true;
updateGeometry();
}
开发者ID:junmin-zhu,项目名称:blink,代码行数:21,代码来源:LinkHighlight.cpp
注:本文中的WebCompositorSupport类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论