summaryrefslogtreecommitdiff
path: root/canvas/source/opengl/ogl_canvascustomsprite.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'canvas/source/opengl/ogl_canvascustomsprite.cxx')
-rw-r--r--canvas/source/opengl/ogl_canvascustomsprite.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx
index 2e930611f5bf..0c03b4491037 100644
--- a/canvas/source/opengl/ogl_canvascustomsprite.cxx
+++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx
@@ -13,11 +13,13 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolygontriangulator.hxx>
#include <basegfx/utils/canvastools.hxx>
#include <canvas/canvastools.hxx>
+#include <o3tl/safeint.hxx>
#include <verifyinput.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include "ogl_canvascustomsprite.hxx"
#include "ogl_canvastools.hxx"
@@ -32,9 +34,6 @@ namespace oglcanvas
SpriteDeviceHelper& rDeviceHelper ) :
mpSpriteCanvas( rRefDevice ),
maSize(rSpriteSize),
- mxClip(),
- maTransformation(),
- maPosition(),
mfAlpha(0.0),
mfPriority(0.0)
{
@@ -70,7 +69,7 @@ namespace oglcanvas
{
canvas::tools::verifyArgs(aNewPos, viewState, renderState,
__func__,
- static_cast< ::cppu::OWeakObject* >(this));
+ getXWeak());
::osl::MutexGuard aGuard( m_aMutex );
::basegfx::B2DHomMatrix aTransform;
@@ -194,9 +193,9 @@ namespace oglcanvas
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(mxClip)));
glBegin(GL_TRIANGLES);
- for( size_t i=0; i<rTriangulatedPolygon.size(); i++ )
+ for(const auto& i : rTriangulatedPolygon)
{
- const::basegfx::triangulator::B2DTriangle& rCandidate(rTriangulatedPolygon[i]);
+ const::basegfx::triangulator::B2DTriangle& rCandidate(i);
glTexCoord2f(
rCandidate.getA().getX()/fWidth,
rCandidate.getA().getY()/fHeight);
@@ -217,7 +216,7 @@ namespace oglcanvas
glVertex2d(
rCandidate.getC().getX(),
rCandidate.getC().getY());
- }
+ }
glEnd();
}
else
@@ -248,10 +247,7 @@ namespace oglcanvas
glVertex2d(maSize.Width+4,maSize.Height+4);
glEnd();
- std::vector<double> aVec;
- aVec.push_back(mfAlpha);
- aVec.push_back(mfPriority);
- aVec.push_back(maCanvasHelper.getRecordedActionCount());
+ std::vector<double> aVec { mfAlpha, mfPriority, o3tl::narrowing<double>(maCanvasHelper.getRecordedActionCount()) };
renderOSD( aVec, 10 );
return true;