summaryrefslogtreecommitdiff
path: root/vcl/opengl/texture.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/opengl/texture.cxx')
-rw-r--r--vcl/opengl/texture.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index 3de7ac8d705e..03055c451bf6 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -364,7 +364,7 @@ void OpenGLTexture::GetCoord( GLfloat* pCoord, const SalTwoRect& rPosAry, bool b
{
VCL_GL_INFO( "Getting coord " << Id() << " [" << maRect.Left() << "," << maRect.Top() << "] " << GetWidth() << "x" << GetHeight() );
- if( mpImpl == nullptr )
+ if (!IsValid())
{
pCoord[0] = pCoord[1] = pCoord[2] = pCoord[3] = 0.0f;
pCoord[4] = pCoord[5] = pCoord[6] = pCoord[7] = 0.0f;
@@ -388,7 +388,7 @@ void OpenGLTexture::GetCoord( GLfloat* pCoord, const SalTwoRect& rPosAry, bool b
bool OpenGLTexture::GetTextureRect(const SalTwoRect& rPosAry, bool bInverted, GLfloat& x1, GLfloat& x2, GLfloat& y1, GLfloat& y2) const
{
- if (mpImpl)
+ if (IsValid())
{
double fTextureWidth(mpImpl->mnWidth);
double fTextureHeight(mpImpl->mnHeight);
@@ -463,7 +463,7 @@ void OpenGLTexture::GetWholeCoord( GLfloat* pCoord ) const
OpenGLTexture OpenGLTexture::GetWholeTexture()
{
- if (mpImpl)
+ if (IsValid())
return OpenGLTexture(mpImpl, Rectangle(Point(0, 0), Size(mpImpl->mnWidth, mpImpl->mnHeight)), -1);
return OpenGLTexture();
}
@@ -477,7 +477,7 @@ GLenum OpenGLTexture::GetFilter() const
bool OpenGLTexture::CopyData(int nWidth, int nHeight, int nFormat, int nType, sal_uInt8* pData)
{
- if (!pData || mpImpl == nullptr)
+ if (!pData || !IsValid())
return false;
int nX = maRect.Left();
@@ -500,7 +500,7 @@ void OpenGLTexture::SetFilter( GLenum nFilter )
void OpenGLTexture::Bind()
{
- if (mpImpl)
+ if (IsValid())
{
std::unique_ptr<RenderState>& rState = OpenGLContext::getVCLContext()->state();
rState->texture().bind(mpImpl->mnTexture);
@@ -513,7 +513,7 @@ void OpenGLTexture::Bind()
void OpenGLTexture::Unbind()
{
- if (mpImpl)
+ if (IsValid())
{
std::unique_ptr<RenderState>& rState = OpenGLContext::getVCLContext()->state();
rState->texture().unbind(mpImpl->mnTexture);
@@ -540,7 +540,7 @@ void OpenGLTexture::SaveToFile(const OUString& rFileName)
void OpenGLTexture::Read( GLenum nFormat, GLenum nType, sal_uInt8* pData )
{
- if( mpImpl == nullptr )
+ if (!IsValid())
{
SAL_WARN( "vcl.opengl", "Can't read invalid texture" );
return;
@@ -581,7 +581,7 @@ void OpenGLTexture::Read( GLenum nFormat, GLenum nType, sal_uInt8* pData )
OpenGLTexture::operator bool() const
{
- return ( mpImpl != nullptr );
+ return IsValid();
}
OpenGLTexture& OpenGLTexture::operator=( const OpenGLTexture& rTexture )