本文整理汇总了C++中UpdateAtlas::supportsAlpha方法的典型用法代码示例。如果您正苦于以下问题:C++ UpdateAtlas::supportsAlpha方法的具体用法?C++ UpdateAtlas::supportsAlpha怎么用?C++ UpdateAtlas::supportsAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UpdateAtlas
的用法示例。
在下文中一共展示了UpdateAtlas::supportsAlpha方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintToSurface
bool CompositingCoordinator::paintToSurface(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset, CoordinatedSurface::Client* client)
{
for (unsigned i = 0; i < m_updateAtlases.size(); ++i) {
UpdateAtlas* atlas = m_updateAtlases[i].get();
if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) {
// This will be false if there is no available buffer space.
if (atlas->paintOnAvailableBuffer(size, atlasID, offset, client))
return true;
}
}
static const int ScratchBufferDimension = 1024; // Should be a power of two.
m_updateAtlases.append(std::make_unique<UpdateAtlas>(this, ScratchBufferDimension, flags));
scheduleReleaseInactiveAtlases();
return m_updateAtlases.last()->paintOnAvailableBuffer(size, atlasID, offset, client);
}
示例2: UpdateAtlas
PassOwnPtr<GraphicsContext> CoordinatedLayerTreeHost::beginContentUpdate(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset)
{
OwnPtr<GraphicsContext> graphicsContext;
for (unsigned i = 0; i < m_updateAtlases.size(); ++i) {
UpdateAtlas* atlas = m_updateAtlases[i].get();
if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) {
// This will return null if there is no available buffer space.
graphicsContext = atlas->beginPaintingOnAvailableBuffer(atlasID, size, offset);
if (graphicsContext)
return graphicsContext.release();
}
}
static const int ScratchBufferDimension = 1024; // Should be a power of two.
m_updateAtlases.append(adoptPtr(new UpdateAtlas(this, ScratchBufferDimension, flags)));
scheduleReleaseInactiveAtlases();
return m_updateAtlases.last()->beginPaintingOnAvailableBuffer(atlasID, size, offset);
}
示例3: releaseInactiveAtlasesTimerFired
void CompositingCoordinator::releaseInactiveAtlasesTimerFired(Timer<CompositingCoordinator>*)
{
// We always want to keep one atlas for root contents layer.
std::unique_ptr<UpdateAtlas> atlasToKeepAnyway;
bool foundActiveAtlasForRootContentsLayer = false;
for (int i = m_updateAtlases.size() - 1; i >= 0; --i) {
UpdateAtlas* atlas = m_updateAtlases[i].get();
if (!atlas->isInUse())
atlas->addTimeInactive(ReleaseInactiveAtlasesTimerInterval);
bool usableForRootContentsLayer = !atlas->supportsAlpha();
if (atlas->isInactive()) {
if (!foundActiveAtlasForRootContentsLayer && !atlasToKeepAnyway && usableForRootContentsLayer)
atlasToKeepAnyway = std::move(m_updateAtlases[i]);
m_updateAtlases.remove(i);
} else if (usableForRootContentsLayer)
foundActiveAtlasForRootContentsLayer = true;
}
if (!foundActiveAtlasForRootContentsLayer && atlasToKeepAnyway)
m_updateAtlases.append(atlasToKeepAnyway.release());
if (m_updateAtlases.size() <= 1)
m_releaseInactiveAtlasesTimer.stop();
}