summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-05-14 10:25:09 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-05-14 15:56:58 +0200
commitee2199a4356c9a74b4a3e817f7aef268efba5123 (patch)
treea9cbc7ecdeed18f103daaa428ed92590c101c44f /canvas
parentf6b8e813e2a33221c400a050b183eb33b9237618 (diff)
Directly initialize vectors in ogl_spritedevicehelper.cxx
since we've got all the information from the beginning. static_cast were needed to avoid this kind of error: /home/julien/lo/libreoffice/canvas/source/opengl/ogl_spritedevicehelper.cxx:305:36: error: non-constant-expression cannot be narrowed from type 'sal_uInt32' (aka 'unsigned int') to 'double' in initializer list [-Wc++11-narrowing] mpTextureCache->getCacheMissCount(), mpTextureCache->getCacheHitCount() } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/julien/lo/libreoffice/canvas/source/opengl/ogl_spritedevicehelper.cxx:305:36: note: insert an explicit cast to silence this issue mpTextureCache->getCacheMissCount(), mpTextureCache->getCacheHitCount() } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static_cast<double>( ) Change-Id: If2705251cc4a246c2b8cb0bf873d413b3c572880 Change-Id: Ie1ce45cb6518fe97442ec5f3f05d34bae586b417 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115585 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/opengl/ogl_spritedevicehelper.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index bcca03d0bd45..7e838162e6c3 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -301,11 +301,10 @@ namespace oglcanvas
maLastUpdate.reset();
const double fps(denominator == 0.0 ? 100.0 : 1.0/denominator);
- std::vector<double> aVec; aVec.push_back(fps);
- aVec.push_back(maActiveSprites.size());
- aVec.push_back(mpTextureCache->getCacheSize());
- aVec.push_back(mpTextureCache->getCacheMissCount());
- aVec.push_back(mpTextureCache->getCacheHitCount());
+ std::vector<double> aVec { fps, static_cast<double>(maActiveSprites.size()),
+ static_cast<double>(mpTextureCache->getCacheSize()),
+ static_cast<double>(mpTextureCache->getCacheMissCount()),
+ static_cast<double>(mpTextureCache->getCacheHitCount()) };
renderOSD( aVec, 20 );
/*