Bug 1012407 - Part 9: Normalize texture coordinates in DecomposeIntoNoRepeatRects (r=BenWa)

This commit is contained in:
Andreas Gal 2014-05-24 02:49:41 +02:00
parent 64c4381b8e
commit 1807413f5e

View File

@ -384,6 +384,14 @@ DecomposeIntoNoRepeatRects(const Rect& aRect,
{
Rect texCoordRect = aTexCoordRect;
// We want to normalize here instead of clamp because the rects we were
// given assume GL_REPEAT, which we explicitly won't use and instead
// manually split into sub-rects.
while (texCoordRect.x >= 1.0f)
texCoordRect.x -= 1.0f;
while (texCoordRect.y >= 1.0f)
texCoordRect.y -= 1.0f;
// If the texture should be flipped, it will have negative height. Detect that
// here and compensate for it. We will flip each rect as we emit it.
bool flipped = false;