Updates will be applied April 15th at 12pm EDT (UTC-0400). GitLab could be a little slow between 12 - 12:45pm EDT.

Commit 12463081 authored by Ken Martin's avatar Ken Martin

Fix compile warning in TextureObject

Texture object method was requiring the width and height of the
framebuffer as arguments.  It was doing error testing on these
arguments but there is no reason to.  Copying a texture where part of
the texture goes outside the framebuffer is fine. That can happen
and is not a problem. The extra texels just get discarded. This also
saves having to know the width and height of the frame buffer
to make this call.

Change-Id: I96cafda2ac900f1ecd247e6678e1e68cbccf033c
parent 386cfd4f
......@@ -172,7 +172,7 @@ vtkIdType vtkOpenGLContextBufferId::GetPickedItem(int x, int y)
this->Texture->Bind();
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
glEnable(GL_TEXTURE_2D);
this->Texture->CopyToFrameBuffer(x,y,x,y,x,y,this->Width,this->Height);
this->Texture->CopyToFrameBuffer(x,y,x,y,x,y);
glDisable(GL_TEXTURE_2D);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // restore
......
......@@ -1618,9 +1618,7 @@ void vtkTextureObject::CopyToFrameBuffer(int srcXmin,
int srcXmax,
int srcYmax,
int dstXmin,
int dstYmin,
int width,
int height)
int dstYmin)
{
assert("pre: positive_srcXmin" && srcXmin>=0);
assert("pre: max_srcXmax" &&
......@@ -1632,10 +1630,6 @@ void vtkTextureObject::CopyToFrameBuffer(int srcXmin,
assert("pre: increasing_y" && srcYmin<=srcYmax);
assert("pre: positive_dstXmin" && dstXmin>=0);
assert("pre: positive_dstYmin" && dstYmin>=0);
assert("pre: positive_width" && width>0);
assert("pre: positive_height" && height>0);
assert("pre: x_fit" && dstXmin+(srcXmax-srcXmin)<width);
assert("pre: y_fit" && dstYmin+(srcYmax-srcYmin)<height);
vtkOpenGLClearErrorMacro();
......
......@@ -433,8 +433,7 @@ public:
// Description:
// Copy a sub-part of the texture (src) in the current framebuffer
// at location (dstXmin,dstYmin). (dstXmin,dstYmin) is the location of the
// lower left corner of the rectangle. width and height are the dimensions
// of the framebuffer.
// lower left corner of the rectangle.
// \pre positive_srcXmin: srcXmin>=0
// \pre max_srcXmax: srcXmax<this->GetWidth()
// \pre increasing_x: srcXmin<=srcXmax
......@@ -443,18 +442,12 @@ public:
// \pre increasing_y: srcYmin<=srcYmax
// \pre positive_dstXmin: dstXmin>=0
// \pre positive_dstYmin: dstYmin>=0
// \pre positive_width: width>0
// \pre positive_height: height>0
// \pre x_fit: destXmin+(srcXmax-srcXmin)<width
// \pre y_fit: destYmin+(srcYmax-srcYmin)<height
void CopyToFrameBuffer(int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
int dstYmin,
int width,
int height);
int dstYmin);
// Description:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment