[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - canvas/source officecfg/registry vcl/source
Michael Jaumann
meta_dev at yahoo.com
Mon Nov 10 05:27:08 PST 2014
canvas/source/opengl/ogl_canvastools.cxx | 8 ++-
canvas/source/opengl/ogl_renderHelper.cxx | 2
canvas/source/opengl/ogl_spritedevicehelper.cxx | 2
officecfg/registry/data/org/openoffice/Office/Canvas.xcu | 4 -
vcl/source/opengl/OpenGLHelper.cxx | 32 ++++++++++++++-
5 files changed, 40 insertions(+), 8 deletions(-)
New commits:
commit f2a39e02dc86dd86cdffaf359f1fba20ed0ff8bc
Author: Michael Jaumann <meta_dev at yahoo.com>
Date: Mon Nov 10 13:24:30 2014 +0000
additional comments / todos /thoughts
Change-Id: I0aae1c85a685d9153c7b0ab251aed545ef702de8
diff --git a/canvas/source/opengl/ogl_canvastools.cxx b/canvas/source/opengl/ogl_canvastools.cxx
index 64f5dc4..0022905 100644
--- a/canvas/source/opengl/ogl_canvastools.cxx
+++ b/canvas/source/opengl/ogl_canvastools.cxx
@@ -28,6 +28,7 @@ using namespace ::com::sun::star;
namespace oglcanvas
{
/// triangulates polygon before
+ //move to canvashelper, or take renderHelper as parameter?
void renderComplexPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly )
{
::basegfx::B2DPolyPolygon aPolyPoly(rPolyPoly);
@@ -52,6 +53,7 @@ namespace oglcanvas
better not leave triangulation to OpenGL. also, ignores texturing
*/
+ //move to canvashelper, or take renderHelper as parameter?
void renderPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly )
{
::basegfx::B2DPolyPolygon aPolyPoly(rPolyPoly);
@@ -60,6 +62,7 @@ namespace oglcanvas
for( sal_uInt32 i=0; i<aPolyPoly.count(); i++ )
{
+
glBegin(GL_LINE_STRIP);
const ::basegfx::B2DPolygon& rPolygon( aPolyPoly.getB2DPolygon(i) );
@@ -75,7 +78,7 @@ namespace oglcanvas
glEnd();
}
}
-
+ //makes it sence to enable evrytime glBlend glBlendfunc...?
glm::mat4 setupState( const ::basegfx::B2DHomMatrix& rTransform,
GLenum eSrcBlend,
GLenum eDstBlend)
@@ -93,6 +96,7 @@ namespace oglcanvas
return glm::make_mat4(aGLTransform);
}
+ //What does it make,
void renderOSD( const std::vector<double>& rNumbers, double scale )
{
double y=4.0;
@@ -105,7 +109,7 @@ namespace oglcanvas
{
aTmp.identity();
aTmp.translate(0,y);
- y += 1.2*scale;
+ y += 1.2*scale; //send to renderHelper
basegfx::B2DPolyPolygon aPoly=
basegfx::tools::number2PolyPolygon(rNumbers[i],10,3);
diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx
index 36a1306..c6b127a 100644
--- a/canvas/source/opengl/ogl_renderHelper.cxx
+++ b/canvas/source/opengl/ogl_renderHelper.cxx
@@ -37,7 +37,7 @@ namespace oglcanvas
m_simplePosAttrb = glGetAttribLocation(m_simpleProgID ,"vPosition");
m_texPosAttrb = glGetAttribLocation(m_texProgID ,"vPosition");
- glViewport(0, 0, m_iWidth, m_iHeight);
+ //glViewport(0, 0, m_iWidth, m_iHeight);
}
//Todo figgure out, which parameters i should use :)
void RenderHelper::SetVP(int width, int height)
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index 5d8ed44..92820ce 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -109,7 +109,7 @@ namespace oglcanvas
// init window context
initContext();
mRenderHelper.InitOpenGL();
- mRenderHelper.SetVP(1600, 900);//is this right?
+ mRenderHelper.SetVP(1200, 600);//is this right?
mnLinearMultiColorGradientProgram =
OpenGLHelper::LoadShaders("dummyVertexShader", "linearMultiColorGradientFragmentShader");
diff --git a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
index 377f211..4a621d2 100644
--- a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu
@@ -46,10 +46,10 @@
</node>
<node oor:name="com.sun.star.rendering.SpriteCanvas" oor:op="replace">
<prop oor:name="PreferredImplementations" oor:type="oor:string-list">
- <value oor:separator=",">com.sun.star.comp.rendering.SpriteCanvas.OGL<!--,
+ <value oor:separator=",">com.sun.star.comp.rendering.SpriteCanvas.OGL,
com.sun.star.comp.rendering.SpriteCanvas.Cairo,
com.sun.star.comp.rendering.SpriteCanvas.VCL,
- com.sun.star.comp.rendering.SpriteCanvas.DX9 -->
+ com.sun.star.comp.rendering.SpriteCanvas.DX9
</value>
</prop>
<prop oor:name="AcceleratedImplementations" oor:type="oor:string-list">
commit 77e419947fe32142ebb7e69d0865e4e7b0433250
Author: Michael Jaumann <meta_dev at yahoo.com>
Date: Mon Nov 10 13:15:07 2014 +0000
additional warnings for invalid framebuffer status
Change-Id: Iedc8f238b809cb009938a23bd832d39b109d3cce
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index c94e290..c3bf509 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -319,9 +319,37 @@ void OpenGLHelper::createFramebuffer(long nWidth, long nHeight, GLuint& nFramebu
glBindRenderbuffer(GL_RENDERBUFFER, nRenderbufferDepthId);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, nRenderbufferDepthId);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- if (status != GL_FRAMEBUFFER_COMPLETE)
+ if(status == GL_FRAMEBUFFER_UNDEFINED)
{
- SAL_WARN("vcl.opengl", "invalid framebuffer status");
+ SAL_WARN("vcl.opengl", "undefined framebuffer status");
+ }
+ else if (status == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)
+ {
+ SAL_WARN("vcl.opengl", "incomplete framebuffer attachment");
+ }
+ else if (status == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)
+ {
+ SAL_WARN("vcl.opengl", "incomplete missing framebuffer attachment ");
+ }
+ else if (status == GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER)
+ {
+ SAL_WARN("vcl.opengl", "incomplete drawbuffer framebuffer");
+ }
+ else if (status == GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER)
+ {
+ SAL_WARN("vcl.opengl", "incomplete readbuffer framebuffer");
+ }
+ else if (status == GL_FRAMEBUFFER_UNSUPPORTED)
+ {
+ SAL_WARN("vcl.opengl", "unsupported framebuffer status");
+ }
+ else if (status == GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS )
+ {
+ SAL_WARN("vcl.opengl", "incomplete layer_targets framebuffer");
+ }
+ else if (status == GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE)
+ {
+ SAL_WARN("vcl.opengl", "incomplete multisample framebuffer");
}
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
More information about the Libreoffice-commits
mailing list