Fix random viewport calculation in lifetime tests.
authorMika Isojärvi <misojarvi@google.com>
Mon, 13 Apr 2015 20:54:16 +0000 (13:54 -0700)
committerMika Isojärvi <misojarvi@google.com>
Mon, 13 Apr 2015 20:54:16 +0000 (13:54 -0700)
Bug: 20177344
Change-Id: I9e0043642ad63257b663823c99a8ea01118138f7

modules/glshared/glsLifetimeTests.cpp

index e1c59ad..2332bae 100644 (file)
@@ -494,9 +494,9 @@ Rectangle randomViewport (const RenderContext& ctx, GLint maxWidth, GLint maxHei
 {
        const RenderTarget&     target  = ctx.getRenderTarget();
        const GLint                     width   = de::min(target.getWidth(), maxWidth);
-       const GLint                     xOff    = rnd.getInt(0, width - maxWidth);
+       const GLint                     xOff    = rnd.getInt(0, target.getWidth() - width);
        const GLint                     height  = de::min(target.getHeight(), maxHeight);
-       const GLint                     yOff    = rnd.getInt(0, height - maxHeight);
+       const GLint                     yOff    = rnd.getInt(0, target.getHeight() - height);
 
        return Rectangle(xOff, yOff, width, height);
 }