本文整理汇总了C++中UpdatableTile::clearDirty方法的典型用法代码示例。如果您正苦于以下问题:C++ UpdatableTile::clearDirty方法的具体用法?C++ UpdatableTile::clearDirty怎么用?C++ UpdatableTile::clearDirty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UpdatableTile
的用法示例。
在下文中一共展示了UpdatableTile::clearDirty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCompositorResources
void TiledLayerChromium::updateCompositorResources(GraphicsContext3D* context)
{
// Painting could cause compositing to get turned off, which may cause the tiler to become invalidated mid-update.
if (m_skipsDraw || m_updateRect.isEmpty() || !m_tiler->numTiles())
return;
int left, top, right, bottom;
m_tiler->contentRectToTileIndices(m_updateRect, left, top, right, bottom);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = tileAt(i, j);
if (!tile)
tile = createTile(i, j);
else if (!tile->dirty())
continue;
// Calculate page-space rectangle to copy from.
IntRect sourceRect = m_tiler->tileContentRect(tile);
const IntPoint anchor = sourceRect.location();
sourceRect.intersect(m_tiler->layerRectToContentRect(tile->m_dirtyLayerRect));
// Paint rect not guaranteed to line up on tile boundaries, so
// make sure that sourceRect doesn't extend outside of it.
sourceRect.intersect(m_paintRect);
if (sourceRect.isEmpty())
continue;
ASSERT(tile->texture()->isReserved());
// Calculate tile-space rectangle to upload into.
IntRect destRect(IntPoint(sourceRect.x() - anchor.x(), sourceRect.y() - anchor.y()), sourceRect.size());
if (destRect.x() < 0)
CRASH();
if (destRect.y() < 0)
CRASH();
// Offset from paint rectangle to this tile's dirty rectangle.
IntPoint paintOffset(sourceRect.x() - m_paintRect.x(), sourceRect.y() - m_paintRect.y());
if (paintOffset.x() < 0)
CRASH();
if (paintOffset.y() < 0)
CRASH();
if (paintOffset.x() + destRect.width() > m_paintRect.width())
CRASH();
if (paintOffset.y() + destRect.height() > m_paintRect.height())
CRASH();
tile->texture()->bindTexture(context);
const GC3Dint filter = m_tiler->hasBorderTexels() ? GraphicsContext3D::LINEAR : GraphicsContext3D::NEAREST;
GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, filter));
GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, filter));
GLC(context, context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0));
textureUpdater()->updateTextureRect(context, tile->texture(), sourceRect, destRect);
tile->clearDirty();
}
}
}