Bug 596784 - Only draw the rects of the visible region, not the bounds. r=vlad a=b

This commit is contained in:
Joe Drew 2010-09-22 14:17:01 -04:00
Родитель 792dcc22f0
Коммит 7fe4d31af2
1 изменённых файлов: 15 добавлений и 11 удалений

Просмотреть файл

@ -163,18 +163,22 @@ ThebesLayerBufferOGL::RenderTo(const nsIntPoint& aOffset,
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexImage->Texture());
}
nsIntRect quadRect = mLayer->GetVisibleRegion().GetBounds();
program->Activate();
program->SetLayerQuadRect(quadRect);
program->SetLayerOpacity(mLayer->GetOpacity());
program->SetLayerTransform(mLayer->GetTransform());
program->SetRenderOffset(aOffset);
program->SetTextureUnit(0);
DEBUG_GL_ERROR_CHECK(gl());
nsIntRegionRectIterator iter(mLayer->GetVisibleRegion());
const nsIntRect *iterRect;
while (iterRect = iter.Next()) {
nsIntRect quadRect = *iterRect;
program->Activate();
program->SetLayerQuadRect(quadRect);
program->SetLayerOpacity(mLayer->GetOpacity());
program->SetLayerTransform(mLayer->GetTransform());
program->SetRenderOffset(aOffset);
program->SetTextureUnit(0);
DEBUG_GL_ERROR_CHECK(gl());
quadRect.MoveBy(-GetOriginOffset());
BindAndDrawQuadWithTextureRect(program, quadRect, mTexImage->GetSize(), gl());
DEBUG_GL_ERROR_CHECK(gl());
quadRect.MoveBy(-GetOriginOffset());
BindAndDrawQuadWithTextureRect(program, quadRect, mTexImage->GetSize(), gl());
DEBUG_GL_ERROR_CHECK(gl());
}
}