Bug 622838: Use the right rect-rounding mode to avoid accidentally resampling resolution-scaled ThebesLayer textures. r=jrmuizel a=b

This commit is contained in:
Chris Jones
2011-01-08 00:05:35 -05:00
parent 59f070bdb6
commit 1c3a3f65b9
2 changed files with 8 additions and 3 deletions

View File

@@ -468,8 +468,13 @@ nsACString&
ContainerLayer::PrintInfo(nsACString& aTo, const char* aPrefix) ContainerLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
{ {
Layer::PrintInfo(aTo, aPrefix); Layer::PrintInfo(aTo, aPrefix);
return mFrameMetrics.IsDefault() ? if (!mFrameMetrics.IsDefault()) {
aTo : AppendToString(aTo, mFrameMetrics, " [metrics=", "]"); AppendToString(aTo, mFrameMetrics, " [metrics=", "]");
}
if (UseIntermediateSurface()) {
aTo += " [usesTmpSurf]";
}
return aTo;
} }
nsACString& nsACString&

View File

@@ -215,7 +215,7 @@ ThebesLayerBufferOGL::RenderTo(const nsIntPoint& aOffset,
// the texture size and let GL do the rest. // the texture size and let GL do the rest.
gfxRect sqr(quadRect.x, quadRect.y, quadRect.width, quadRect.height); gfxRect sqr(quadRect.x, quadRect.y, quadRect.width, quadRect.height);
sqr.Scale(xres, yres); sqr.Scale(xres, yres);
sqr.RoundOut(); sqr.Round();
nsIntRect scaledQuadRect(sqr.pos.x, sqr.pos.y, sqr.size.width, sqr.size.height); nsIntRect scaledQuadRect(sqr.pos.x, sqr.pos.y, sqr.size.width, sqr.size.height);
BindAndDrawQuadWithTextureRect(gl(), program, scaledQuadRect, BindAndDrawQuadWithTextureRect(gl(), program, scaledQuadRect,