summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-21 12:14:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-25 13:53:21 +0200
commit4583911575edf98ccd5b15af8eafa6a3a7b64034 (patch)
treef3f33e53c45dd870f19e7e42db9bb5b4bf1f23bf /vcl/opengl
parent1942182a3d1817bc539229d7fda3af69f7e295b8 (diff)
improve loplugin:simplifyconstruct
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/LineRenderUtils.cxx12
-rw-r--r--vcl/opengl/gdiimpl.cxx4
-rw-r--r--vcl/opengl/program.cxx2
-rw-r--r--vcl/opengl/salbmp.cxx6
4 files changed, 12 insertions, 12 deletions
diff --git a/vcl/opengl/LineRenderUtils.cxx b/vcl/opengl/LineRenderUtils.cxx
index 61d0dc38457c..e130fb93bb22 100644
--- a/vcl/opengl/LineRenderUtils.cxx
+++ b/vcl/opengl/LineRenderUtils.cxx
@@ -121,8 +121,8 @@ void LineBuilder::appendBevelJoint(glm::vec2 const& point, const glm::vec2& prev
// All the magic is done by the fact that we draw triangle strips, so we
// cover the joins correctly.
- glm::vec2 prevNormal = glm::vec2(-prevLineVector.y, prevLineVector.x);
- glm::vec2 nextNormal = glm::vec2(-nextLineVector.y, nextLineVector.x);
+ glm::vec2 prevNormal(-prevLineVector.y, prevLineVector.x);
+ glm::vec2 nextNormal(-nextLineVector.y, nextLineVector.x);
appendAndConnectLinePoint(point, prevNormal, 1.0f);
appendAndConnectLinePoint(point, nextNormal, 1.0f);
@@ -139,8 +139,8 @@ void LineBuilder::appendRoundJoint(glm::vec2 const& point, const glm::vec2& prev
// line joins look round. Ideally the number of vectors could be
// calculated.
- glm::vec2 prevNormal = glm::vec2(-prevLineVector.y, prevLineVector.x);
- glm::vec2 nextNormal = glm::vec2(-nextLineVector.y, nextLineVector.x);
+ glm::vec2 prevNormal(-prevLineVector.y, prevLineVector.x);
+ glm::vec2 nextNormal(-nextLineVector.y, nextLineVector.x);
glm::vec2 middle = vcl::vertex::normalize(prevNormal + nextNormal);
glm::vec2 middleLeft = vcl::vertex::normalize(prevNormal + middle);
@@ -158,7 +158,7 @@ void LineBuilder::appendRoundLineCapVertices(const glm::vec2& rPoint1, const glm
constexpr int nRoundCapIteration = 12;
glm::vec2 lineVector = vcl::vertex::normalize(rPoint2 - rPoint1);
- glm::vec2 normal = glm::vec2(-lineVector.y, lineVector.x);
+ glm::vec2 normal(-lineVector.y, lineVector.x);
glm::vec2 previousRoundNormal = normal;
for (int nFactor = 1; nFactor <= nRoundCapIteration; nFactor++)
@@ -176,7 +176,7 @@ void LineBuilder::appendRoundLineCapVertices(const glm::vec2& rPoint1, const glm
void LineBuilder::appendSquareLineCapVertices(const glm::vec2& rPoint1, const glm::vec2& rPoint2)
{
glm::vec2 lineVector = vcl::vertex::normalize(rPoint2 - rPoint1);
- glm::vec2 normal = glm::vec2(-lineVector.y, lineVector.x);
+ glm::vec2 normal(-lineVector.y, lineVector.x);
glm::vec2 extrudedPoint = rPoint1 + -lineVector * (mfLineWidth / 2.0f);
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 1914a4f6f60a..1924d46f268b 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -548,7 +548,7 @@ void OpenGLSalGraphicsImpl::CheckOffscreenTexture()
SalTwoRect aPosAry(0, 0, fWidth, fHeight, 0,0, fWidth, fHeight);
// TODO: lfrb: User GL_ARB_copy_image?
- OpenGLTexture aNewTex = OpenGLTexture( GetWidth(), GetHeight() );
+ OpenGLTexture aNewTex( GetWidth(), GetHeight() );
mpContext->state().scissor().disable();
mpContext->state().stencil().disable();
@@ -670,7 +670,7 @@ void OpenGLSalGraphicsImpl::DrawLineSegment(float x1, float y1, float x2, float
glm::vec2 aPoint2(x2, y2);
glm::vec2 aLineVector = vcl::vertex::normalize(aPoint2 - aPoint1);
- glm::vec2 aNormal = glm::vec2(-aLineVector.y, aLineVector.x);
+ glm::vec2 aNormal(-aLineVector.y, aLineVector.x);
vcl::vertex::addLineSegmentVertices(aVertices, aExtrusionVectors,
aPoint1, aNormal, 1.0f,
diff --git a/vcl/opengl/program.cxx b/vcl/opengl/program.cxx
index 4de2c5decac0..6557eccf8f42 100644
--- a/vcl/opengl/program.cxx
+++ b/vcl/opengl/program.cxx
@@ -326,7 +326,7 @@ void OpenGLProgram::SetTransform(
void OpenGLProgram::SetIdentityTransform(const OString& rName)
{
GLuint nUniform = GetUniformLocation(rName);
- glm::mat4 aMatrix = glm::mat4();
+ glm::mat4 aMatrix {};
glUniformMatrix4fv(nUniform, 1, GL_FALSE, glm::value_ptr( aMatrix ) );
CHECK_GL_ERROR();
}
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 27d2e19e2734..4de793ea6797 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -684,7 +684,7 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, BitmapChecksu
int nNewWidth = ceil( nWidth / 4.0 );
int nNewHeight = ceil( nHeight / 4.0 );
- OpenGLTexture aFirstPassTexture = OpenGLTexture(nNewWidth, nNewHeight);
+ OpenGLTexture aFirstPassTexture(nNewWidth, nNewHeight);
OpenGLFramebuffer* pFramebuffer = xContext->AcquireFramebuffer(aFirstPassTexture);
pProgram->SetUniform1f( "xstep", 1.0 / mnWidth );
@@ -711,7 +711,7 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, BitmapChecksu
nNewWidth = ceil( nWidth / 4.0 );
nNewHeight = ceil( nHeight / 4.0 );
- OpenGLTexture aSecondPassTexture = OpenGLTexture(nNewWidth, nNewHeight);
+ OpenGLTexture aSecondPassTexture(nNewWidth, nNewHeight);
pFramebuffer = xContext->AcquireFramebuffer(aSecondPassTexture);
pProgram->SetUniform1f( "xstep", 1.0 / mnWidth );
@@ -912,7 +912,7 @@ bool OpenGLSalBitmap::Replace( const Color& rSearchColor, const Color& rReplaceC
if( !pProgram )
return false;
- OpenGLTexture aNewTex = OpenGLTexture( mnWidth, mnHeight );
+ OpenGLTexture aNewTex( mnWidth, mnHeight );
pFramebuffer = xContext->AcquireFramebuffer( aNewTex );
pProgram->SetTexture( "sampler", maTexture );