Kaydet (Commit) e69da79d authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constantparam

Change-Id: I8e2e9009f0a70d2fa390e03688a988ac935d5f36
Reviewed-on: https://gerrit.libreoffice.org/57643
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1e9bde78
...@@ -542,7 +542,7 @@ namespace oglcanvas ...@@ -542,7 +542,7 @@ namespace oglcanvas
mnTextureId(0) mnTextureId(0)
{ {
OpenGLHelper::createFramebuffer(rSize.getX(), rSize.getY(), mnFrambufferId, OpenGLHelper::createFramebuffer(rSize.getX(), rSize.getY(), mnFrambufferId,
mnDepthId, mnTextureId, false); mnDepthId, mnTextureId);
} }
virtual ~BufferContextImpl() override virtual ~BufferContextImpl() override
......
...@@ -49,10 +49,10 @@ sc/source/ui/view/cellsh1.cxx:134 ...@@ -49,10 +49,10 @@ sc/source/ui/view/cellsh1.cxx:134
sw/source/core/view/viewsh.cxx:716 sw/source/core/view/viewsh.cxx:716
void lcl_InvalidateAllContent(class SwViewShell &,enum SwInvalidateFlags) void lcl_InvalidateAllContent(class SwViewShell &,enum SwInvalidateFlags)
enum SwInvalidateFlags nInv setBits=0x2 enum SwInvalidateFlags nInv setBits=0x2
sw/source/filter/html/swhtml.hxx:713 sw/source/filter/html/swhtml.hxx:670
void SwHTMLParser::SetFrameFormatAttrs(class SfxItemSet &,enum HtmlFrameFormatFlags,class SfxItemSet &) void SwHTMLParser::SetFrameFormatAttrs(class SfxItemSet &,enum HtmlFrameFormatFlags,class SfxItemSet &)
enum HtmlFrameFormatFlags nFlags setBits=0x1 enum HtmlFrameFormatFlags nFlags setBits=0x1
sw/source/filter/ww8/wrtw8esh.cxx:1540 sw/source/filter/ww8/wrtw8esh.cxx:1538
enum ShapeFlag AddMirrorFlags(enum ShapeFlag,const class SwMirrorGrf &) enum ShapeFlag AddMirrorFlags(enum ShapeFlag,const class SwMirrorGrf &)
enum ShapeFlag nFlags setBits=0xa00 clearBits=0x5ef enum ShapeFlag nFlags setBits=0xa00 clearBits=0x5ef
xmloff/inc/MetaExportComponent.hxx:32 xmloff/inc/MetaExportComponent.hxx:32
......
...@@ -37,7 +37,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC ChartHelper ...@@ -37,7 +37,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC ChartHelper
{ {
public: public:
/// Use chart's XUpdatable::update() to update values. /// Use chart's XUpdatable::update() to update values.
static void updateChart( const css::uno::Reference< css::frame::XModel >& rXModel, bool bHardUpdate ); static void updateChart( const css::uno::Reference< css::frame::XModel >& rXModel );
// try to access rXModel in case of a chart to get the chart content // try to access rXModel in case of a chart to get the chart content
// as sequence of primitives. Return range of primitives (chart size) in rRange; // as sequence of primitives. Return range of primitives (chart size) in rRange;
......
...@@ -64,17 +64,18 @@ public: ...@@ -64,17 +64,18 @@ public:
/** /**
* The caller is responsible for deleting the buffer objects identified by * The caller is responsible for deleting the buffer objects identified by
* nFramebufferId, nRenderbufferDepthId and nRenderbufferColorId * nFramebufferId, nRenderbufferDepthId and nRenderbufferColorId.
* This create a buffer for rendering to texture and should be freed with
* glDeleteTextures.
*
* @param nWidth Width of frame * @param nWidth Width of frame
* @param nHeight Height of frame * @param nHeight Height of frame
* @param nFramebufferId FrameBuffer ID * @param nFramebufferId FrameBuffer ID
* @param nRenderbufferDepthId RenderBuffer's depth ID * @param nRenderbufferDepthId RenderBuffer's depth ID
* @param nRenderbufferColorId RenderBuffer's color ID * @param nRenderbufferColorId RenderBuffer's color ID
* @param bRenderbuffer true => off-screen rendering, false => rendering to texture
* This also affects whether to free with glDeleteRenderbuffers or glDeleteTextures
*/ */
static void createFramebuffer(long nWidth, long nHeight, GLuint& nFramebufferId, static void createFramebuffer(long nWidth, long nHeight, GLuint& nFramebufferId,
GLuint& nRenderbufferDepthId, GLuint& nRenderbufferColorId, bool bRenderbuffer = true); GLuint& nRenderbufferDepthId, GLuint& nRenderbufferColorId);
/// Get OpenGL version (needs a context) /// Get OpenGL version (needs a context)
static float getGLVersion(); static float getGLVersion();
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
using namespace ::com::sun::star; using namespace ::com::sun::star;
void ChartHelper::updateChart( const uno::Reference< ::frame::XModel >& rXModel, bool bHardUpdate ) void ChartHelper::updateChart( const uno::Reference< ::frame::XModel >& rXModel )
{ {
if (!rXModel.is()) if (!rXModel.is())
return; return;
...@@ -47,10 +47,7 @@ void ChartHelper::updateChart( const uno::Reference< ::frame::XModel >& rXModel, ...@@ -47,10 +47,7 @@ void ChartHelper::updateChart( const uno::Reference< ::frame::XModel >& rXModel,
const uno::Reference< lang::XUnoTunnel > xChartView(xChartFact->createInstance("com.sun.star.chart2.ChartView"), uno::UNO_QUERY_THROW); const uno::Reference< lang::XUnoTunnel > xChartView(xChartFact->createInstance("com.sun.star.chart2.ChartView"), uno::UNO_QUERY_THROW);
const uno::Reference<util::XUpdatable2> xUpdatable(xChartView, uno::UNO_QUERY_THROW); const uno::Reference<util::XUpdatable2> xUpdatable(xChartView, uno::UNO_QUERY_THROW);
if (bHardUpdate) xUpdatable->updateHard();
xUpdatable->updateHard();
else
xUpdatable->updateSoft();
} }
catch(uno::Exception&) catch(uno::Exception&)
{ {
...@@ -67,7 +64,7 @@ drawinglayer::primitive2d::Primitive2DContainer ChartHelper::tryToGetChartConten ...@@ -67,7 +64,7 @@ drawinglayer::primitive2d::Primitive2DContainer ChartHelper::tryToGetChartConten
if (!rXModel.is()) if (!rXModel.is())
return aRetval; return aRetval;
updateChart(rXModel, true); updateChart(rXModel);
try try
{ {
......
...@@ -643,7 +643,7 @@ std::ostream& operator<<(std::ostream& rStrm, const glm::mat4& rMatrix) ...@@ -643,7 +643,7 @@ std::ostream& operator<<(std::ostream& rStrm, const glm::mat4& rMatrix)
} }
void OpenGLHelper::createFramebuffer(long nWidth, long nHeight, GLuint& nFramebufferId, void OpenGLHelper::createFramebuffer(long nWidth, long nHeight, GLuint& nFramebufferId,
GLuint& nRenderbufferDepthId, GLuint& nRenderbufferColorId, bool bRenderbuffer) GLuint& nRenderbufferDepthId, GLuint& nRenderbufferColorId)
{ {
OpenGLZone aZone; OpenGLZone aZone;
...@@ -653,29 +653,18 @@ void OpenGLHelper::createFramebuffer(long nWidth, long nHeight, GLuint& nFramebu ...@@ -653,29 +653,18 @@ void OpenGLHelper::createFramebuffer(long nWidth, long nHeight, GLuint& nFramebu
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, nWidth, nHeight); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, nWidth, nHeight);
glBindRenderbuffer(GL_RENDERBUFFER, 0); glBindRenderbuffer(GL_RENDERBUFFER, 0);
if(bRenderbuffer) glGenTextures(1, &nRenderbufferColorId);
{ glBindTexture(GL_TEXTURE_2D, nRenderbufferColorId);
// create a renderbuffer for color attachment glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glGenRenderbuffers(1, &nRenderbufferColorId); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glBindRenderbuffer(GL_RENDERBUFFER, nRenderbufferColorId); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, nWidth, nHeight); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindRenderbuffer(GL_RENDERBUFFER, 0); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, nWidth, nHeight, 0,
} GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
else glBindTexture(GL_TEXTURE_2D, 0);
{
glGenTextures(1, &nRenderbufferColorId); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
glBindTexture(GL_TEXTURE_2D, nRenderbufferColorId); GL_TEXTURE_2D, nRenderbufferColorId, 0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, nWidth, nHeight, 0,
GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glBindTexture(GL_TEXTURE_2D, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, nRenderbufferColorId, 0);
}
// create a framebuffer object and attach renderbuffer // create a framebuffer object and attach renderbuffer
glGenFramebuffers(1, &nFramebufferId); glGenFramebuffers(1, &nFramebufferId);
......
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