[Libreoffice-commits] core.git: Branch 'feature/slideshow_onlySprites' - slideshow/source
slideshow/source/engine/slide/shapemanagerimpl.cxx | 43 + slideshow/source/engine/slide/shapemanagerimpl.hxx |5 -- 2 files changed, 5 insertions(+), 43 deletions(-) New commits: commit 56e5ebf66ae2ec84824f1e2c62e5540e19420619 Author: Michael Jaumann meta_...@yahoo.com Date: Mon Mar 9 11:13:45 2015 + no more layers Change-Id: I87209817af833dcb49efc9078b368447efb624a9 diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index 0db4f80..db96265 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -56,24 +56,14 @@ ShapeManagerImpl::ShapeManagerImpl( const UnoViewContainer rViews, { } -templatetypename LayerFunc, - typename ShapeFunc void ShapeManagerImpl::manageViews( - LayerFunc layerFunc, +templatetypename ShapeFunc void ShapeManagerImpl::manageViews( ShapeFunc shapeFunc ) { -LayerSharedPtr pCurrLayer; ViewLayerSharedPtr pCurrViewLayer; LayerShapeMap::const_iterator aIter( maAllShapes.begin() ); const LayerShapeMap::const_iterator aEnd ( maAllShapes.end() ); while( aIter != aEnd ) { -LayerSharedPtr pLayer = aIter-second.lock(); -if( pLayer pLayer != pCurrLayer ) -{ -pCurrLayer = pLayer; -pCurrViewLayer = layerFunc(pCurrLayer); -} - if( pCurrViewLayer ) shapeFunc(aIter-first,pCurrViewLayer); @@ -283,12 +273,7 @@ void ShapeManagerImpl::viewAdded( const UnoViewSharedPtr rView ) rView-clearAll(); // add View to all registered shapes -manageViews( -boost::bind(Layer::addView, -_1, -boost::cref(rView)), -// repaint on view add -boost::bind(Shape::addViewLayer, +manageViews(boost::bind(Shape::addViewLayer, _1, _2, true) ); @@ -302,11 +287,7 @@ void ShapeManagerImpl::viewRemoved( const UnoViewSharedPtr rView ) rView) == mrViews.end() ); // remove View from all registered shapes -manageViews( -boost::bind(Layer::removeView, -_1, -boost::cref(rView)), -boost::bind(Shape::removeViewLayer, +manageViews(boost::bind(Shape::removeViewLayer, _1, _2) ); } @@ -332,8 +313,6 @@ void ShapeManagerImpl::viewsChanged() mrViews.end(), ::boost::mem_fn(View::clearAll) ); -// TODO(F3): resize and repaint all layers - // render all shapes std::for_each( maAllShapes.begin(), maAllShapes.end(), @@ -545,27 +524,11 @@ void ShapeManagerImpl::implRemoveShape( const ShapeSharedPtr rShape ) if( aShapeEntry == maAllShapes.end() ) return; - -const bool bShapeUpdateNotified = maUpdateShapes.erase( rShape ) != 0; - // Enter shape area to the update area, but only if shape // is visible and not in sprite mode (otherwise, updating // the area doesn't do actual harm, but costs time) // Actually, also add it if it was listed in // maUpdateShapes (might have just gone invisible). -if( bShapeUpdateNotified || -(rShape-isVisible() - !rShape-isBackgroundDetached()) ) -{ -LayerSharedPtr pLayer = aShapeEntry-second.lock(); -if( pLayer ) -{ -// store area early, once the shape is removed from -// the layers, it no longer has any view references -pLayer-addUpdateRange( rShape-getUpdateArea() ); -} -} - rShape-clearAllViewLayers(); maAllShapes.erase( aShapeEntry ); } diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index c1b9916..797bdc6 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -145,9 +145,7 @@ private: method. The only point of variation at those places are removal vs. adding. */ -templatetypename LayerFunc, - typename ShapeFunc void manageViews( LayerFunc layerFunc, - ShapeFunc shapeFunc ); +templatetypename ShapeFunc void manageViews(ShapeFunc shapeFunc ); // ShapeManager interface @@ -200,6 +198,7 @@ private: bool updateSprites(); + /** Common stuff when adding a shape */ void implAddShape( const ShapeSharedPtr rShape ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/slideshow_onlySprites' - slideshow/source
slideshow/source/engine/slide/shapemanagerimpl.cxx | 35 ++--- slideshow/source/engine/slide/shapemanagerimpl.hxx |2 + 2 files changed, 33 insertions(+), 4 deletions(-) New commits: commit 21009ded43206124264a17992cb554f89aac6b75 Author: Michael Jaumann meta_...@yahoo.com Date: Fri Mar 6 14:01:53 2015 + added updateSprites in shapemangerimpl Change-Id: I72e768be6bfaae1d6eccc25cebc12f995efdf55e diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index 47d12bf..0db4f80 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -343,8 +343,7 @@ void ShapeManagerImpl::viewsChanged() bool ShapeManagerImpl::update() { -//if( mbEnabled) - // return mpLayerManager-update(); +updateSprites(); return false; } @@ -381,8 +380,36 @@ void ShapeManagerImpl::leaveAnimationMode( const AnimatableShapeSharedPtr rShap void ShapeManagerImpl::notifyShapeUpdate( const ShapeSharedPtr rShape ) { - // if( mbEnabled ) - // mpLayerManager-notifyShapeUpdate(rShape); +if( rShape-isVisible() || rShape-isBackgroundDetached() ) + maUpdateShapes.insert( rShape ); +} + +bool ShapeManagerImpl::updateSprites() +{ +bool bRet(true); + +// send update() calls to every shape in the +// maUpdateShapes set, which is _animated_ (i.e. a +// sprite). +const ShapeUpdateSet::const_iterator aEnd=maUpdateShapes.end(); +ShapeUpdateSet::const_iterator aCurrShape=maUpdateShapes.begin(); +while( aCurrShape != aEnd ) +{ +if( (*aCurrShape)-isBackgroundDetached() ) +{ +// can update shape directly, without +// affecting layer content (shape is +// currently displayed in a sprite) +if( !(*aCurrShape)-update() ) +bRet = false; // delay error exit +} + +++aCurrShape; +} + +maUpdateShapes.clear(); + +return bRet; } ShapeSharedPtr ShapeManagerImpl::lookupShape( uno::Reference drawing::XShape const xShape ) const diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index ab98c6a..c1b9916 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -198,6 +198,8 @@ private: ::com::sun::star::drawing::XShape xShape, sal_Int16 nCursor ); +bool updateSprites(); + /** Common stuff when adding a shape */ void implAddShape( const ShapeSharedPtr rShape ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/slideshow_onlySprites' - 2 commits - slideshow/source
slideshow/source/engine/slide/shapemanagerimpl.cxx | 136 - slideshow/source/engine/slide/shapemanagerimpl.hxx | 56 +++- slideshow/source/engine/slide/slideimpl.cxx| 40 +- 3 files changed, 167 insertions(+), 65 deletions(-) New commits: commit c4f5e1e9d1984fc3d3ca689a5615d9ead92a7bd6 Author: Michael Jaumann meta_...@yahoo.com Date: Fri Mar 6 10:40:23 2015 + shape maps from LayerManager moved maps/ functionality to ShapeManager Change-Id: Iadb2c6f1b090b7ac384cb66c03fd5667e6c6971c diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index 71fc7f1..f364b2d 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -40,6 +40,9 @@ ShapeManagerImpl::ShapeManagerImpl( EventMultiplexer rMultiplexer, CursorManager rCursorManager, const ShapeEventListenerMap rGlobalListenersMap, const ShapeCursorMap rGlobalCursorMap ): +maXShapeHash( 101 ), +maAllShapes(), +maUpdateShapes(), mrMultiplexer(rMultiplexer), mrCursorManager(rCursorManager), mrGlobalListenersMap(rGlobalListenersMap), @@ -288,10 +291,14 @@ void ShapeManagerImpl::notifyShapeUpdate( const ShapeSharedPtr rShape ) ShapeSharedPtr ShapeManagerImpl::lookupShape( uno::Reference drawing::XShape const xShape ) const { - /* if( mpLayerManager ) -return mpLayerManager-lookupShape(xShape);*/ +ENSURE_OR_THROW( xShape.is(), LayerManager::lookupShape(): invalid Shape ); -return ShapeSharedPtr(); +const XShapeHash::const_iterator aIter( maXShapeHash.find( xShape )); +if( aIter == maXShapeHash.end() ) + return ShapeSharedPtr(); // not found + +// found, return data part of entry pair. +return aIter-second; } void ShapeManagerImpl::addHyperlinkArea( const HyperlinkAreaSharedPtr rArea ) @@ -375,6 +382,54 @@ bool ShapeManagerImpl::listenerAdded( return true; } +void ShapeManagerImpl::implAddShape( const ShapeSharedPtr rShape ) +{ +ENSURE_OR_THROW( rShape, ShapeManagerImpl::implAddShape(): invalid Shape ); + +LayerShapeMap::value_type aValue (rShape, LayerWeakPtr()); + +OSL_ASSERT( maAllShapes.find(rShape) == maAllShapes.end() ); // shape must not be added already + +maAllShapes.insert(aValue); + +// update shape, it's just added and not yet painted +if( rShape-isVisible() ) +notifyShapeUpdate( rShape ); +} + +void ShapeManagerImpl::implRemoveShape( const ShapeSharedPtr rShape ) +{ +ENSURE_OR_THROW( rShape, ShapeManagerImpl::implRemoveShape(): invalid Shape ); + +const LayerShapeMap::iterator aShapeEntry( maAllShapes.find(rShape) ); + +if( aShapeEntry == maAllShapes.end() ) +return; + +const bool bShapeUpdateNotified = maUpdateShapes.erase( rShape ) != 0; + +// Enter shape area to the update area, but only if shape +// is visible and not in sprite mode (otherwise, updating +// the area doesn't do actual harm, but costs time) +// Actually, also add it if it was listed in +// maUpdateShapes (might have just gone invisible). +if( bShapeUpdateNotified || +(rShape-isVisible() + !rShape-isBackgroundDetached()) ) +{ +LayerSharedPtr pLayer = aShapeEntry-second.lock(); +if( pLayer ) +{ +// store area early, once the shape is removed from +// the layers, it no longer has any view references +pLayer-addUpdateRange( rShape-getUpdateArea() ); +} +} + +rShape-clearAllViewLayers(); +maAllShapes.erase( aShapeEntry ); +} + bool ShapeManagerImpl::listenerRemoved( const uno::Referencepresentation::XShapeEventListener /*xListener*/, const uno::Referencedrawing::XShape xShape ) diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index 4f5f2f1..05d94e2 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -88,8 +88,20 @@ public: virtual void dispose() SAL_OVERRIDE; +virtual ShapeSharedPtr lookupShape( +::com::sun::star::uno::Reference + ::com::sun::star::drawing::XShape const xShape ) const SAL_OVERRIDE; + private: +class ShapeComparator +{ +public: +bool operator() (const ShapeSharedPtr rpS1, const ShapeSharedPtr rpS2 ) const +{ +return Shape::lessThanShape::compare(rpS1.get(), rpS2.get()); +} +}; // MouseEventHandler interface @@ -121,9 +133,7 @@ private: virtual void enterAnimationMode( const AnimatableShapeSharedPtr rShape ) SAL_OVERRIDE; virtual void leaveAnimationMode( const AnimatableShapeSharedPtr rShape
[Libreoffice-commits] core.git: Branch 'feature/slideshow_onlySprites' - slideshow/source
slideshow/source/engine/slide/shapemanagerimpl.cxx | 98 - slideshow/source/engine/slide/shapemanagerimpl.hxx | 22 slideshow/source/engine/slide/slideimpl.cxx|7 + 3 files changed, 122 insertions(+), 5 deletions(-) New commits: commit 42322e7f428a96eb1b2b10c81221e088613e8d1b Author: Michael Jaumann meta_...@yahoo.com Date: Fri Mar 6 12:36:44 2015 + views for shapeManager Change-Id: I9ff223f03d7edb76092e1c38f56946e35c94f229 diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index a2e68b0..47d12bf 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -36,13 +36,15 @@ using namespace com::sun::star; namespace slideshow { namespace internal { -ShapeManagerImpl::ShapeManagerImpl( EventMultiplexerrMultiplexer, +ShapeManagerImpl::ShapeManagerImpl( const UnoViewContainer rViews, +EventMultiplexerrMultiplexer, CursorManager rCursorManager, const ShapeEventListenerMap rGlobalListenersMap, const ShapeCursorMap rGlobalCursorMap ): maXShapeHash( 101 ), maAllShapes(), maUpdateShapes(), +mrViews(rViews), mrMultiplexer(rMultiplexer), mrCursorManager(rCursorManager), mrGlobalListenersMap(rGlobalListenersMap), @@ -54,6 +56,31 @@ ShapeManagerImpl::ShapeManagerImpl( EventMultiplexer rMultiplexer, { } +templatetypename LayerFunc, + typename ShapeFunc void ShapeManagerImpl::manageViews( + LayerFunc layerFunc, + ShapeFunc shapeFunc ) +{ +LayerSharedPtr pCurrLayer; +ViewLayerSharedPtr pCurrViewLayer; +LayerShapeMap::const_iterator aIter( maAllShapes.begin() ); +const LayerShapeMap::const_iterator aEnd ( maAllShapes.end() ); +while( aIter != aEnd ) +{ +LayerSharedPtr pLayer = aIter-second.lock(); +if( pLayer pLayer != pCurrLayer ) +{ +pCurrLayer = pLayer; +pCurrViewLayer = layerFunc(pCurrLayer); +} + +if( pCurrViewLayer ) +shapeFunc(aIter-first,pCurrViewLayer); + +++aIter; +} +} + void ShapeManagerImpl::activate( bool bSlideBackgoundPainted ) { if( !mbEnabled ) @@ -245,6 +272,75 @@ bool ShapeManagerImpl::handleMouseMoved( const awt::MouseEvent e ) // handler should see it, too. } +void ShapeManagerImpl::viewAdded( const UnoViewSharedPtr rView ) +{ +// view must be member of mrViews container +OSL_ASSERT( std::find(mrViews.begin(), + mrViews.end(), + rView) != mrViews.end() ); + +// init view content +rView-clearAll(); + +// add View to all registered shapes +manageViews( +boost::bind(Layer::addView, +_1, +boost::cref(rView)), +// repaint on view add +boost::bind(Shape::addViewLayer, +_1, +_2, +true) ); +} + +void ShapeManagerImpl::viewRemoved( const UnoViewSharedPtr rView ) +{ +// view must not be member of mrViews container anymore +OSL_ASSERT( std::find(mrViews.begin(), + mrViews.end(), + rView) == mrViews.end() ); + +// remove View from all registered shapes +manageViews( +boost::bind(Layer::removeView, +_1, +boost::cref(rView)), +boost::bind(Shape::removeViewLayer, +_1, +_2) ); +} + +void ShapeManagerImpl::viewChanged( const UnoViewSharedPtr rView ) +{ +(void)rView; + +// view must be member of mrViews container +OSL_ASSERT( std::find(mrViews.begin(), + mrViews.end(), + rView) != mrViews.end() ); + +// TODO(P2): selectively update only changed view +viewsChanged(); +} + +void ShapeManagerImpl::viewsChanged() +{ + +// clear view area +::std::for_each( mrViews.begin(), + mrViews.end(), + ::boost::mem_fn(View::clearAll) ); + +// TODO(F3): resize and repaint all layers + +// render all shapes +std::for_each( maAllShapes.begin(), + maAllShapes.end(), + boost::bind(Shape::render, + boost::bind( ::o3tl::select1stLayerShapeMap::value_type(), _1)) ); +} + bool ShapeManagerImpl::update() { //if( mbEnabled) diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index 108e58a..ab98c6a 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow
[Libreoffice-commits] core.git: Branch 'feature/slideshow_onlySprites' - slideshow/source
slideshow/source/engine/slide/shapemanagerimpl.cxx | 17 + slideshow/source/engine/slide/shapemanagerimpl.hxx |5 + slideshow/source/engine/slide/slideimpl.cxx|8 3 files changed, 26 insertions(+), 4 deletions(-) New commits: commit f7f8706b404b5b61856fbc3e96985b5ca70ee78c Author: Michael Jaumann meta_...@yahoo.com Date: Fri Mar 6 10:58:34 2015 + addShape for shapemanagerimpl Change-Id: I965760aa642126cf4616e7f89b4d4859efb0823a diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index f364b2d..a2e68b0 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -397,6 +397,23 @@ void ShapeManagerImpl::implAddShape( const ShapeSharedPtr rShape ) notifyShapeUpdate( rShape ); } +void ShapeManagerImpl::addShape( const ShapeSharedPtr rShape ) +{ +ENSURE_OR_THROW( rShape, ShapeManagerImpl::addShape(): invalid Shape ); + +// add shape to XShape hash map +if( !maXShapeHash.insert( +XShapeHash::value_type( rShape-getXShape(), +rShape) ).second ) +{ +// entry already present, nothing to do +return; +} + +// add shape to appropriate layer +implAddShape( rShape ); +} + void ShapeManagerImpl::implRemoveShape( const ShapeSharedPtr rShape ) { ENSURE_OR_THROW( rShape, ShapeManagerImpl::implRemoveShape(): invalid Shape ); diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index 05d94e2..108e58a 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -68,6 +68,11 @@ public: CursorManager rCursorManager, const ShapeEventListenerMap rGlobalListenersMap, const ShapeCursorMaprGlobalCursorMap ); +/** Add the shape to this object + +This method adds a shape to the page. + */ +void addShape( const ShapeSharedPtr rShape ); /** Enables event listening. diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 4c7f294..7d7ef62 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -1049,15 +1049,15 @@ bool SlideImpl::loadShapes() 0, /* shape num starts at 0 */ true ); - /* mpLayerManager-addShape( -aMPShapesFunctor.importBackgroundShape() );*/ +mpShapeManager-addShape( +aMPShapesFunctor.importBackgroundShape() ); while( !aMPShapesFunctor.isImportDone() ) { ShapeSharedPtr const rShape( aMPShapesFunctor.importShape() ); if( rShape ) - /* mpLayerManager-addShape( rShape );*/; +mpShapeManager-addShape( rShape );; } addPolygons(aMPShapesFunctor.getPolygons()); @@ -1102,7 +1102,7 @@ bool SlideImpl::loadShapes() ShapeSharedPtr const rShape( aShapesFunctor.importShape() ); if( rShape ) -/*mpLayerManager-addShape( rShape );*/; +mpShapeManager-addShape( rShape );; } addPolygons(aShapesFunctor.getPolygons()); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'feature/slideshow_onlySprites'
New branch 'feature/slideshow_onlySprites' available with the following commits: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - slideshow/source
slideshow/source/engine/shapes/viewshape.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 26d17e0f42b13af514081fc3de4145744e1bf9ce Author: Michael Jaumann meta_...@yahoo.com Date: Thu Mar 5 12:13:19 2015 + unintended condition (ab)||c instead of ab||c Change-Id: Ic26ee391a8383602e6006e93e6773424bb2516ee diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 0c57efd..35834ee 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -856,7 +856,7 @@ namespace slideshow // Hack, force use of Sprites in case of ogl canvas const uno::Reference rendering::XCanvas xCanvas( mpViewLayer-getCanvas()-getUNOCanvas() ); const uno::Reference lang::XServiceInfo xServiceInfo(xCanvas ,uno::UNO_QUERY); -if(xServiceInfo.is() xServiceInfo-getImplementationName() == com.sun.star.comp.rendering.SpriteCanvas.OGL +if((xServiceInfo.is() xServiceInfo-getImplementationName() == com.sun.star.comp.rendering.SpriteCanvas.OGL) || isBackgroundDetached() ) { return renderSprite( mpViewLayer, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvastools.cxx |9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) New commits: commit 1ff87af2bb8939562c8735056a6c6010ee7d76ab Author: Michael Jaumann meta_...@yahoo.com Date: Mon Mar 2 08:37:57 2015 + unecessary check, will be covered before Change-Id: Idcad49eae7ae1ab272babec6dc8b00e8e55f275e diff --git a/canvas/source/opengl/ogl_canvastools.cxx b/canvas/source/opengl/ogl_canvastools.cxx index 3c09f96..6490cff 100644 --- a/canvas/source/opengl/ogl_canvastools.cxx +++ b/canvas/source/opengl/ogl_canvastools.cxx @@ -48,8 +48,7 @@ namespace oglcanvas vertices.push_back(glm::vec2(rPt.getX(),rPt.getY())); } -if(vertices.size() !=0) -renderHelper-renderVertexConstColor(vertices, color, GL_TRIANGLES); +renderHelper-renderVertexConstColor(vertices, color, GL_TRIANGLES); } } @@ -73,8 +72,7 @@ namespace oglcanvas const ::basegfx::B2DPoint rPt( rTriangulatedPolygon.getB2DPoint(i) ); vertices.push_back(glm::vec2(rPt.getX(),rPt.getY())); } -if(vertices.size()!=0) -renderHelper-renderTextureTransform( vertices, nWidth, nHeight, color, GL_TRIANGLES, transform); +renderHelper-renderTextureTransform( vertices, nWidth, nHeight, color, GL_TRIANGLES, transform); } } @@ -104,8 +102,7 @@ namespace oglcanvas const ::basegfx::B2DPoint rPt( rPolygon.getB2DPoint( j % nPts ) ); vertices.push_back(glm::vec2(rPt.getX(),rPt.getY())); } -if(vertices.size()!=0) -renderHelper-renderVertexConstColor(vertices, color, GL_LINE_STRIP); +renderHelper-renderVertexConstColor(vertices, color, GL_LINE_STRIP); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvascustomsprite.cxx | 15 +-- canvas/source/opengl/ogl_canvastools.cxx|9 ++--- 2 files changed, 15 insertions(+), 9 deletions(-) New commits: commit 50f1e7e71bc59cec9c1afee473a94ff49c6de32a Author: Michael Jaumann meta_...@yahoo.com Date: Fri Feb 27 10:46:49 2015 + don't try to render with no vertices Change-Id: I42a5c21b32771fcff1fd148b55cad2d697648409 diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index 7acaceb..be4372e 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -218,14 +218,17 @@ namespace oglcanvas aSpriteSizePixel.x, aSpriteSizePixel.y))); -std::vectorglm::vec2 vertices; -vertices.reserve(rTriangulatedPolygon.count()); -for( sal_uInt32 i=0; irTriangulatedPolygon.count(); i++ ) +if(rTriangulatedPolygon.count()!=0) { -const ::basegfx::B2DPoint rPt( rTriangulatedPolygon.getB2DPoint(i) ); -vertices.push_back(glm::vec2(rPt.getX(), rPt.getY())); +std::vectorglm::vec2 vertices; +vertices.reserve(rTriangulatedPolygon.count()); +for( sal_uInt32 i=0; irTriangulatedPolygon.count(); i++ ) +{ +const ::basegfx::B2DPoint rPt( rTriangulatedPolygon.getB2DPoint(i) ); +vertices.push_back(glm::vec2(rPt.getX(), rPt.getY())); +} +pRenderHelper-renderVertexTex( vertices, fWidth, fHeight, color, GL_TRIANGLES); } -pRenderHelper-renderVertexTex( vertices, fWidth, fHeight, color, GL_TRIANGLES); } else { diff --git a/canvas/source/opengl/ogl_canvastools.cxx b/canvas/source/opengl/ogl_canvastools.cxx index 6490cff..3c09f96 100644 --- a/canvas/source/opengl/ogl_canvastools.cxx +++ b/canvas/source/opengl/ogl_canvastools.cxx @@ -48,7 +48,8 @@ namespace oglcanvas vertices.push_back(glm::vec2(rPt.getX(),rPt.getY())); } -renderHelper-renderVertexConstColor(vertices, color, GL_TRIANGLES); +if(vertices.size() !=0) +renderHelper-renderVertexConstColor(vertices, color, GL_TRIANGLES); } } @@ -72,7 +73,8 @@ namespace oglcanvas const ::basegfx::B2DPoint rPt( rTriangulatedPolygon.getB2DPoint(i) ); vertices.push_back(glm::vec2(rPt.getX(),rPt.getY())); } -renderHelper-renderTextureTransform( vertices, nWidth, nHeight, color, GL_TRIANGLES, transform); +if(vertices.size()!=0) +renderHelper-renderTextureTransform( vertices, nWidth, nHeight, color, GL_TRIANGLES, transform); } } @@ -102,7 +104,8 @@ namespace oglcanvas const ::basegfx::B2DPoint rPt( rPolygon.getB2DPoint( j % nPts ) ); vertices.push_back(glm::vec2(rPt.getX(),rPt.getY())); } -renderHelper-renderVertexConstColor(vertices, color, GL_LINE_STRIP); +if(vertices.size()!=0) +renderHelper-renderVertexConstColor(vertices, color, GL_LINE_STRIP); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/tabvwshf.cxx | 50 - 1 file changed, 25 insertions(+), 25 deletions(-) New commits: commit 1f1627f068b2c232c0191538c697f6caa418ba5d Author: Michael Jaumann meta_...@yahoo.com Date: Wed Feb 25 12:56:21 2015 + fdo#39468 translated german comments Change-Id: I369564f23d20d5b4bb890eed41ad48842615ee44 Reviewed-on: https://gerrit.libreoffice.org/14634 Tested-by: Jenkins c...@libreoffice.org Tested-by: Michael Stahl mst...@redhat.com Reviewed-by: Michael Stahl mst...@redhat.com diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index af252ad..570bf9a 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -83,7 +83,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) bVisible = static_castconst SfxBoolItem*(pItem)-GetValue(); } -if( ! bVisible )// ausblenden +if( ! bVisible )// fade out { if ( pDoc-IsDocEditable() ) { @@ -91,7 +91,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) HideTable( rMark ); } } -else// einblenden +else// fade in { std::vectorOUString rNames; rNames.push_back(aName); @@ -171,9 +171,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) SCTAB nTabNr = nCurrentTab; if ( !pDoc-IsDocEditable() ) -break; // gesperrt +break; // locked -if ( pReqArgs != NULL ) // von Basic +if ( pReqArgs != NULL ) // from basic { bool bOk = false; const SfxPoolItem* pTabItem; @@ -183,7 +183,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) if ( pReqArgs-HasItem( FN_PARAM_1, pTabItem ) pReqArgs-HasItem( nSlot, pNameItem ) ) { -// Tabellennr. von Basic: 1-basiert +// tablenumber from basic: 1-based aName = static_castconst SfxStringItem*(pNameItem)-GetValue(); nTabNr = static_castconst SfxUInt16Item*(pTabItem)-GetValue() - 1; @@ -193,9 +193,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) if (bOk) rReq.Done( *pReqArgs ); -//! sonst Fehler setzen +//! else set error } -else// Dialog +else// dialog { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, ScAbstractFactory create fail!); @@ -300,23 +300,23 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) case FID_TAB_RENAME: case FID_TAB_MENU_RENAME: { -// FID_TAB_MENU_RENAME - umbenennen im Menu -// FID_TAB_RENAME - Name-Property fuer Basic -// Execute ist gleich, aber im GetState wird MENU_RENAME evtl. disabled +// FID_TAB_MENU_RENAME - rename in menu +// FID_TAB_RENAME - name-property for basic +// equal execute, but MENU_RENAME may be disabled inside GetState if ( nSlot == FID_TAB_MENU_RENAME ) -nSlot = FID_TAB_RENAME; // Execute ist gleich +nSlot = FID_TAB_RENAME; // equal execute SCTAB nTabNr = rViewData.GetTabNo(); ScMarkData rMark = rViewData.GetMarkData(); SCTAB nTabSelCount = rMark.GetSelectCount(); if ( !pDoc-IsDocEditable() ) -break; // alles gesperrt +break; // evrything locked if ( nSlot != FID_TAB_APPEND ( pDoc-IsTabProtected( nTabNr ) || nTabSelCount 1 ) ) -break; // kein Rename +break; // no rename if( pReqArgs != NULL ) { @@ -407,7 +407,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest rReq ) if( rReq.IsAPI() ) { #if HAVE_FEATURE_SCRIPTING -StarBASIC::Error( SbERR_SETPROP_FAILED ); // XXX Fehlerbehandlung??? +StarBASIC::Error( SbERR_SETPROP_FAILED ); // XXX error handling??? #endif
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - slideshow/source
slideshow/source/engine/shapes/viewshape.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 97353530ff457b005b6df54880efdba8751177cb Author: Michael Jaumann meta_...@yahoo.com Date: Fri Feb 20 08:40:35 2015 + polite query the canvas backend throw no more exception, check if xinterface is supportet Change-Id: I18bbb672ad60c5cb6b5a88ac5cc1d8d597a47947 diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 5e29d29..0c57efd 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -854,8 +854,10 @@ namespace slideshow // Shall we render to a sprite, or to a plain canvas? // Hack, force use of Sprites in case of ogl canvas -uno::Reference lang::XServiceInfo xServiceInfo(mpViewLayer-getCanvas()-getUNOCanvas(),uno::UNO_QUERY_THROW); -if( xServiceInfo-getImplementationName() == com.sun.star.comp.rendering.SpriteCanvas.OGL || isBackgroundDetached() ) +const uno::Reference rendering::XCanvas xCanvas( mpViewLayer-getCanvas()-getUNOCanvas() ); +const uno::Reference lang::XServiceInfo xServiceInfo(xCanvas ,uno::UNO_QUERY); +if(xServiceInfo.is() xServiceInfo-getImplementationName() == com.sun.star.comp.rendering.SpriteCanvas.OGL + || isBackgroundDetached() ) { return renderSprite( mpViewLayer, rMtf, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/viewfun3.cxx | 108 - 1 file changed, 54 insertions(+), 54 deletions(-) New commits: commit a33f97bae6edd1cac4df8cdb3d4fb3996f29a82e Author: Michael Jaumann meta_...@yahoo.com Date: Wed Feb 18 12:51:42 2015 + fdo#39468 translated german comments Change-Id: I693e26cc8ce45bc246d0d039d39d81f17ebcbbe6 Reviewed-on: https://gerrit.libreoffice.org/14555 Tested-by: Michael Stahl mst...@redhat.com Reviewed-by: Michael Stahl mst...@redhat.com diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index ee1d23a..f1ce4fe 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -72,7 +72,7 @@ using namespace com::sun::star; // STATIC DATA --- -// GlobalName der Writer-DocShell kommt jetzt aus comphelper/classids.hxx +// GlobalName of writer-DocShell from comphelper/classids.hxx // C U T @@ -87,7 +87,7 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects ) return; } -ScRange aRange; // zu loeschender Bereich +ScRange aRange; // delete this range if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE ) { ScDocument* pDoc = GetViewData().GetDocument(); @@ -105,9 +105,9 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects ) MarkDataChanged(); } -CopyToClip( pClipDoc, true, false, bIncludeObjects ); // Ab ins Clipboard +CopyToClip( pClipDoc, true, false, bIncludeObjects ); // copy to clipboard -ScAddress aOldEnd( aRange.aEnd ); // Zusammengefasste Zellen im Bereich? +ScAddress aOldEnd( aRange.aEnd ); // combined cells in this range? pDoc-ExtendMerge( aRange, true ); ScDocument* pUndoDoc = NULL; @@ -135,7 +135,7 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects ) if ( !AdjustRowHeight( aRange.aStart.Row(), aRange.aEnd.Row() ) ) pDocSh-PostPaint( aRange, PAINT_GRID, nExtFlags ); -if ( bRecord ) // erst jetzt ist Draw-Undo verfuegbar +if ( bRecord ) // Draw-Undo now available pDocSh-GetUndoManager()-AddUndoAction( new ScUndoCut( pDocSh, aRange, aOldEnd, rMark, pUndoDoc ) ); @@ -360,7 +360,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList rRanges, b ScChangeTrack* pChangeTrack = pDoc-GetChangeTrack(); if ( pChangeTrack ) -pChangeTrack-ResetLastCut(); // kein CutMode mehr +pChangeTrack-ResetLastCut(); // no more cut-mode { ScDocShell* pDocSh = GetViewData().GetDocShell(); @@ -475,8 +475,8 @@ void ScViewFunc::PasteFromSystem() sal_uLong nBiff8 = SotExchange::RegisterFormatName(OUString(Biff8)); sal_uLong nBiff5 = SotExchange::RegisterFormatName(OUString(Biff5)); -// als erstes SvDraw-Model, dann Grafik -// (Grafik darf nur bei einzelner Grafik drinstehen) +// first SvDraw-model, then drawing +// (only one drawing is allowed) if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING )) { @@ -547,8 +547,8 @@ void ScViewFunc::PasteFromSystem() PasteFromSystem( SOT_FORMATSTR_ID_LINK_SOURCE_OLE ); } } -// keine Fehlermeldung, weil SID_PASTE in der idl das FastCall-Flag hat, -// also auch gerufen wird, wenn nichts im Clipboard steht (#42531#) +// no exception- SID_PASTE has FastCall-flag from idl +// will be called in case of empty clipboard (#42531#) } void ScViewFunc::PasteFromTransferable( const uno::Referencedatatransfer::XTransferable rxTransferable ) @@ -593,8 +593,8 @@ void ScViewFunc::PasteFromTransferable( const uno::Referencedatatransfer::XTran sal_uLong nBiff8 = SotExchange::RegisterFormatName(OUString(Biff8)); sal_uLong nBiff5 = SotExchange::RegisterFormatName(OUString(Biff5)); sal_uLong nFormatId = 0; -// als erstes SvDraw-Model, dann Grafik -// (Grafik darf nur bei einzelner Grafik drinstehen) +// first SvDraw-model, then drawing +// (only one drawing is allowed) if (aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING )) nFormatId = SOT_FORMATSTR_ID_DRAWING; @@ -776,9 +776,9 @@ static bool lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL return false; } -// Einfuegen auf Tabelle: +// paste into sheet: -// internes Paste +// internal paste namespace { @@ -824,13 +824,13 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 3 commits - basegfx/source include/basegfx slideshow/source
basegfx/source/tools/canvastools.cxx | 69 --- include/basegfx/tools/glm_canvastools.hxx| 19 +++ slideshow/source/engine/shapes/viewshape.cxx | 14 +++-- 3 files changed, 27 insertions(+), 75 deletions(-) New commits: commit d25bb94103d90d440953f1339a046f200c18735a Author: Michael Jaumann meta_...@yahoo.com Date: Wed Feb 18 13:08:10 2015 + this wrappers are alrdy in glm_canvastools.cxx Change-Id: I164c7e55c39bb33903f50c9c3792eeae616c1841 diff --git a/basegfx/source/tools/canvastools.cxx b/basegfx/source/tools/canvastools.cxx index c578e16..f59f447 100644 --- a/basegfx/source/tools/canvastools.cxx +++ b/basegfx/source/tools/canvastools.cxx @@ -334,41 +334,6 @@ namespace basegfx return output; } -glm::mat4 glmMatrixFromAffineMatrix( const ::com::sun::star::geometry::AffineMatrix2D input ) -{ -// ensure last row is [0,0,1] (and optimized away) -glm::mat4 output; -output[0][0] = input.m00; -output[1][0] = input.m01; -output[2][0] = input.m02; -output[0][1] = input.m10; -output[1][1] = input.m11; -output[2][1] = input.m12; - -return output; -} - -glm::mat4 glmMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D input ) -{ -glm::mat4 output; -output[0][0] = input.m00; -output[1][0] = input.m01; -output[2][0] = input.m02; -output[3][0] = input.m03; - -output[0][1] = input.m10; -output[1][1] = input.m11; -output[2][1] = input.m12; -output[3][1] = input.m13; - -output[0][2] = input.m20; -output[1][2] = input.m21; -output[2][2] = input.m22; -output[3][2] = input.m23; - -return output; -} - ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D input ) { ::basegfx::B3DHomMatrix output; @@ -404,40 +369,6 @@ namespace basegfx return output; } -glm::mat4 glmMatFromHomMatrix( const ::basegfx::B2DHomMatrix input) -{ -glm::mat4 output; -output[0][0] = input.get(0,0); -output[1][0] = input.get(0,1); -output[2][0] = input.get(0,2); -output[0][1] = input.get(1,0); -output[1][1] = input.get(1,1); -output[2][1] = input.get(1,2); - -return output; -} - -glm::mat4 glmMatFromHomMatrix3d( const ::basegfx::B3DHomMatrix input) -{ -glm::mat4 output; -output[0][0] = input.get(0,0); -output[1][0] = input.get(0,1); -output[2][0] = input.get(0,2); -output[3][0] = input.get(0,3); - -output[0][1] = input.get(1,0); -output[1][1] = input.get(1,1); -output[2][1] = input.get(1,2); -output[3][1] = input.get(1,3); - -output[0][2] = input.get(2,0); -output[1][2] = input.get(2,1); -output[2][2] = input.get(2,2); -output[3][2] = input.get(2,3); - -return output; -} - geometry::AffineMatrix3D affineMatrixFromHomMatrix3D( geometry::AffineMatrix3D output, const ::basegfx::B3DHomMatrix input) commit 4251e1a186e27f116f3958654a44d2484f41d3fe Author: Michael Jaumann meta_...@yahoo.com Date: Wed Feb 18 10:00:51 2015 + only force sprites in case of ogl canvas, care could end in an exception Change-Id: I60c38a339ff80058f5e842d4bcfe4bf3d18b67c2 diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index f22699e..5e29d29 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -48,7 +48,7 @@ #include tools.hxx #include boost/bind.hpp - +#include com/sun/star/lang/XServiceInfo.hpp using namespace ::com::sun::star; @@ -853,9 +853,10 @@ namespace slideshow ENSURE_OR_RETURN_FALSE( mpViewLayer-getCanvas(), ViewShape::update(): Invalid layer canvas ); // Shall we render to a sprite, or to a plain canvas? -// Hack, force use of Sprites -// TODO should be only the case by using ogl canvas- getImplementationName() -//if( isBackgroundDetached() ) +// Hack, force use of Sprites in case of ogl canvas +uno::Reference lang::XServiceInfo xServiceInfo(mpViewLayer-getCanvas()-getUNOCanvas(),uno::UNO_QUERY_THROW); +if( xServiceInfo-getImplementationName() == com.sun.star.comp.rendering.SpriteCanvas.OGL || isBackgroundDetached() ) +{ return renderSprite( mpViewLayer, rMtf
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - basegfx/Library_basegfx.mk basegfx/source canvas/Library_oglcanvas.mk .gitignore include/basegfx slideshow/source
.gitignore |9 ++ basegfx/Library_basegfx.mk |6 + basegfx/source/tools/glm_canvastools.cxx | 112 +++ canvas/Library_oglcanvas.mk |1 include/basegfx/tools/canvastools.hxx| 12 -- include/basegfx/tools/glm_canvastools.hxx| 49 +++ slideshow/source/engine/shapes/viewshape.cxx |8 + 7 files changed, 182 insertions(+), 15 deletions(-) New commits: commit 4be8205ed4c715e0ac6ed382f0011f38363e2005 Author: Michael Jaumann meta_...@yahoo.com Date: Mon Feb 16 14:44:32 2015 + Hack! force using sprites Change-Id: If601a687a9c39394cc39b3b35956380378db4071 diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index edbd666..f22699e 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -853,7 +853,9 @@ namespace slideshow ENSURE_OR_RETURN_FALSE( mpViewLayer-getCanvas(), ViewShape::update(): Invalid layer canvas ); // Shall we render to a sprite, or to a plain canvas? -if( isBackgroundDetached() ) +// Hack, force use of Sprites +// TODO should be only the case by using ogl canvas- getImplementationName() +//if( isBackgroundDetached() ) return renderSprite( mpViewLayer, rMtf, rArgs.maOrigBounds, @@ -864,7 +866,7 @@ namespace slideshow rArgs.mrSubsets, rArgs.mnShapePriority, bIsVisible ); -else +/*else return render( mpViewLayer-getCanvas(), rMtf, rArgs.maBounds, @@ -872,7 +874,7 @@ namespace slideshow nUpdateFlags, rArgs.mrAttr, rArgs.mrSubsets, - bIsVisible ); + bIsVisible );*/ } } commit c3f893291e71b65554934bc439aa1a8de1b7826a Author: Michael Jaumann meta_...@yahoo.com Date: Tue Nov 4 08:18:40 2014 + fdo#86190 glmwrappers for bdhommatrix/affinematrix Conflicts: include/basegfx/tools/canvastools.hxx Change-Id: I0ff0b5ed82bbe9dc0ed264b71f6cea5a72809aff diff --git a/.gitignore b/.gitignore index 1e29927..0b8efd2 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,9 @@ /AUTHORS /MAINTAINERS +#lhm stuff +build-lhm.sh + # make tags /tags @@ -105,3 +108,9 @@ xcuserdata # gdb config /.gdbinit /.gdb_history + +#ctags +/canvas/.tags +/canvas/.tags_sorted_by_file +/extras/source/gallery/gallery_system/sg1.sdv + diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk index 95ba931..7fd5541 100644 --- a/basegfx/Library_basegfx.mk +++ b/basegfx/Library_basegfx.mk @@ -9,7 +9,10 @@ $(eval $(call gb_Library_Library,basegfx)) -$(eval $(call gb_Library_use_external,basegfx,boost_headers)) +$(eval $(call gb_Library_use_externals,basegfx, \ +boost_headers \ +glm_headers \ +)) $(eval $(call gb_Library_set_precompiled_header,basegfx,$(SRCDIR)/basegfx/inc/pch/precompiled_basegfx)) @@ -70,6 +73,7 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\ basegfx/source/raster/rasterconvert3d \ basegfx/source/tools/b2dclipstate \ basegfx/source/tools/canvastools \ +basegfx/source/tools/glm_canvastools \ basegfx/source/tools/gradienttools \ basegfx/source/tools/keystoplerp \ basegfx/source/tools/numbertools \ diff --git a/basegfx/source/tools/glm_canvastools.cxx b/basegfx/source/tools/glm_canvastools.cxx new file mode 100644 index 000..e4a3907 --- /dev/null +++ b/basegfx/source/tools/glm_canvastools.cxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include com/sun/star/geometry/AffineMatrix2D.hpp +#include com/sun/star/geometry
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_renderHelper.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 83094ad07c971a8e2e643997a10e5c99f4817875 Author: Michael Jaumann meta_...@yahoo.com Date: Mon Feb 16 15:00:23 2015 + missing bracket Change-Id: I99e1febab66b6bd04e516bd97725e9711eced35d diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx index 21e03b4..ca7838b 100644 --- a/canvas/source/opengl/ogl_renderHelper.cxx +++ b/canvas/source/opengl/ogl_renderHelper.cxx @@ -87,6 +87,7 @@ namespace oglcanvas void RenderHelper::SetVP(const float nwidth, const float nheight) { m_VP = glm::ortho(0.0f, nwidth, nheight, 0.0f); +} void RenderHelper::SetVP(const glm::mat4 vp) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/formdlg/formula.cxx | 72 ++- 1 file changed, 35 insertions(+), 37 deletions(-) New commits: commit 6694a6a4069f7ca587bbf3f553d38163b01b3a5c Author: Michael Jaumann meta_...@yahoo.com Date: Thu Feb 12 15:00:08 2015 + fdo#39468 translated german comments Change-Id: Iec457e270790cb6f58b31e5002f9b2ce8acc1618 Reviewed-on: https://gerrit.libreoffice.org/1 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index b483bd3..5909f3b 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -61,7 +61,7 @@ using namespace com::sun::star; ScDocument* ScFormulaDlg::pDoc = NULL; ScAddress ScFormulaDlg::aCursorPos; -// Initialisierung / gemeinsame Funktionen fuer Dialog +// init/ shared functions for dialog ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, ScViewData* pViewData,formula::IFunctionManager* _pFunctionMgr ) @@ -117,7 +117,6 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ScFormEditData* pData = pScMod-GetFormEditData(); if (!pData) { -//Nun wird es Zeit den Inputhandler festzulegen pScMod-SetRefInputHdl(pScMod-GetInputHdl()); pDoc = pViewData-GetDocument(); @@ -126,16 +125,16 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, SCTAB nTab = pViewData-GetTabNo(); aCursorPos = ScAddress( nCol, nRow, nTab ); -pScMod-InitFormEditData(); // neu anlegen +pScMod-InitFormEditData(); // create new pData = pScMod-GetFormEditData(); pData-SetInputHandler(pScMod-GetInputHdl()); pData-SetDocShell(pViewData-GetDocShell()); OSL_ENSURE(pData,FormEditData ist nicht da); -formula::FormulaDlgMode eMode = FORMULA_FORMDLG_FORMULA;// Default... +formula::FormulaDlgMode eMode = FORMULA_FORMDLG_FORMULA;// default... -// Formel vorhanden? Dann editieren +// edit if formula exists OUString aFormula; pDoc-GetFormula( nCol, nRow, nTab, aFormula ); @@ -173,7 +172,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, pScMod-InputGetSelection( PrivStart, PrivEnd); SetMeText(pScMod-InputGetFormulaStr(),PrivStart, PrivEnd,bMatrix,false,false); -pData-SetFStart( 1 ); // hinter dem = +pData-SetFStart( 1 ); // after = } pData-SetMode( (sal_uInt16) eMode ); @@ -201,8 +200,8 @@ void ScFormulaDlg::fill() OUString rStrExp; if (pData) { -// Daten schon vorhanden - Zustand wiederherstellen (nach Umschalten) -// pDoc und aCursorPos nicht neu initialisieren +// data exists - restore state (after switch) +// don't reinitialise pDoc and aCursorPos //pDoc = pViewData-GetDocument(); if(IsInputHdl(pData-GetInputHandler())) { @@ -213,8 +212,8 @@ void ScFormulaDlg::fill() PtrTabViewShell pTabViewShell; ScInputHandler* pInputHdl = GetNextInputHandler(pData-GetDocShell(),pTabViewShell); -if ( pInputHdl == NULL ) //DocShell hat keinen InputHandler mehr, -{ //hat der Anwender halt Pech gehabt. +if ( pInputHdl == NULL ) //no more InputHandler for DocShell +{ disableOk(); pInputHdl = pScMod-GetInputHdl(); } @@ -235,7 +234,7 @@ void ScFormulaDlg::fill() SetMeText(rStrExp); Update(); -// Jetzt nochmals zurueckschalten, da evtl. neues Doc geoeffnet wurde! +// switch back, maybe new Doc has been opened pScMod-SetRefInputHdl(NULL); } } @@ -245,19 +244,19 @@ ScFormulaDlg::~ScFormulaDlg() ScModule* pScMod = SC_MOD(); ScFormEditData* pData = pScMod-GetFormEditData(); -if (pData) // wird nicht ueber Close zerstoert; +if (pData) // close dosen't destroy; { -//Referenz Inputhandler zuruecksetzen +//set back reference input handler pScMod-SetRefInputHdl(NULL); StoreFormEditData(pData); -} // if (pData) // wird nicht ueber Close zerstoert; +} } bool ScFormulaDlg::IsInputHdl(ScInputHandler* pHdl) { bool bAlive = false; -// gehoert der InputHandler zu irgendeiner ViewShell ? +// belongs InputHandler to a ViewShell? TypeId aScType = TYPE(ScTabViewShell); SfxViewShell* pSh = SfxViewShell::GetFirst( aScType ); @@ -298,23 +297,22 @@ bool ScFormulaDlg::Close() return true; } -// Funktionen fuer rechte Seite +// functions for right side bool
[Libreoffice-commits] core.git: sc/source
sc/source/ui/drawfunc/fudraw.cxx | 44 +++ 1 file changed, 22 insertions(+), 22 deletions(-) New commits: commit 8e2457415d0e8cd65491c42112e6d93222db32d9 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Feb 11 13:38:22 2015 + fdo#39468 translated german comments Change-Id: If229c1ae9a737b492948c78b619aca90b4a33e83 Reviewed-on: https://gerrit.libreoffice.org/14417 Tested-by: Michael Stahl mst...@redhat.com Reviewed-by: Michael Stahl mst...@redhat.com diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 009c2b5..40f43fc 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -43,7 +43,7 @@ /* |* -|* Basisklasse fuer alle Drawmodul-spezifischen Funktionen +|* base class for draw module specific functions |* \/ @@ -57,7 +57,7 @@ FuDraw::FuDraw(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* pViewP, /* |* -|* Destruktor +|* destructor |* \/ @@ -67,15 +67,15 @@ FuDraw::~FuDraw() /* |* -|* Modifier-Tasten auswerten +|* evaluate modifier keys |* \/ void FuDraw::DoModifiers(const MouseEvent rMEvt) { -// Shift = Ortho und AngleSnap +// Shift = Ortho and AngleSnap // Control = Snap (Toggle) -// Alt = zentrisch +// Alt = centric bool bShift = rMEvt.IsShift(); bool bAlt = rMEvt.IsMod2(); @@ -176,10 +176,10 @@ bool FuDraw::MouseButtonUp(const MouseEvent rMEvt) /* |* -|* Tastaturereignisse bearbeiten +|* process keyboard events |* -|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls -|* FALSE. +|* if a keyevent is processed - returns sal_True +|*- else FALSE |* \/ @@ -226,7 +226,7 @@ bool FuDraw::KeyInput(const KeyEvent rKEvt) case KEY_ESCAPE: if ( pViewShell-IsDrawTextShell() || aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT ) { -// in normale Draw-Shell, wenn Objekt selektiert, sonst Zeichnen aus +// if object selected - normal draw-shell, else turn off drawing rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); bReturn = true; } @@ -245,7 +245,7 @@ bool FuDraw::KeyInput(const KeyEvent rKEvt) else pView-UnmarkAll(); -// Beim Bezier-Editieren ist jetzt wieder das Objekt selektiert +// while bezier editing, object is selected if (!pView-AreObjectsMarked()) pViewShell-SetDrawShell( false ); @@ -253,7 +253,7 @@ bool FuDraw::KeyInput(const KeyEvent rKEvt) } break; -case KEY_DELETE://! ueber Accelerator +case KEY_DELETE://! via accelerator pView-DeleteMarked(); bReturn = true; break; @@ -434,25 +434,25 @@ bool FuDraw::KeyInput(const KeyEvent rKEvt) if (nCode == KEY_UP) { -// Scroll nach oben +// scroll up nX = 0; nY =-1; } else if (nCode == KEY_DOWN) { -// Scroll nach unten +// scroll down nX = 0; nY = 1; } else if (nCode == KEY_LEFT) { -// Scroll nach links +// scroll left nX =-1; nY = 0; } else if (nCode == KEY_RIGHT) { -// Scroll nach rechts +// scroll right nX = 1; nY = 0; } @@ -678,7 +678,7 @@ void FuDraw::SelectionHasChanged() /* |* -|* Function aktivieren +|* enable function |* \/ @@ -689,7 +689,7 @@ void FuDraw::Activate() /* |* -|* Function deaktivieren +|* disable function
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - canvas/source
canvas/source/opengl/ogl_canvasbitmap.cxx |5 +++ canvas/source/opengl/ogl_canvasbitmap.hxx |4 ++ canvas/source/opengl/ogl_canvashelper.cxx | 42 +- canvas/source/opengl/ogl_canvashelper.hxx |8 + canvas/source/opengl/ogl_canvastools.cxx |8 ++--- 5 files changed, 50 insertions(+), 17 deletions(-) New commits: commit 2ff6febd530646dde32d6f2b3fa2212886b74dc3 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Feb 11 12:13:10 2015 + removed unnecessary conversion Change-Id: Id5c1c7d9d26bb74d34a652655ddac8dae7568a41 diff --git a/canvas/source/opengl/ogl_canvastools.cxx b/canvas/source/opengl/ogl_canvastools.cxx index eacac6b..6490cff 100644 --- a/canvas/source/opengl/ogl_canvastools.cxx +++ b/canvas/source/opengl/ogl_canvastools.cxx @@ -112,16 +112,14 @@ namespace oglcanvas GLenum eSrcBlend, GLenum eDstBlend) { -float aGLTransform[] = -{ +const glm::mat4 aGLTransform = glm::mat4( (float) rTransform.get(0,0), (float) rTransform.get(1,0), 0, 0, (float) rTransform.get(0,1), (float) rTransform.get(1,1), 0, 0, 0, 0, 1, 0, -(float) rTransform.get(0,2), (float) rTransform.get(1,2), 0, 1 -}; +(float) rTransform.get(0,2), (float) rTransform.get(1,2), 0, 1); glEnable(GL_BLEND); glBlendFunc(eSrcBlend, eDstBlend); -return glm::make_mat4(aGLTransform); +return aGLTransform; } void renderOSD( const std::vectordouble rNumbers, double scale, RenderHelper *renderHelper) commit ec6054e0cdd03827f118cdb344595bc5b51320ec Author: Michael Jaumann meta_...@yahoo.com Date: Wed Feb 11 12:05:41 2015 + general transformation for canvasbitmaps applys the same transformation matrix additional to the basic transformation matrix for each action - the background image is composed and drawn to the same offset relative to the right border Change-Id: I85bc670841c9f884fd276451233cd1812ed6d9f7 diff --git a/canvas/source/opengl/ogl_canvasbitmap.cxx b/canvas/source/opengl/ogl_canvasbitmap.cxx index b7c5d9b..e0f0361 100644 --- a/canvas/source/opengl/ogl_canvasbitmap.cxx +++ b/canvas/source/opengl/ogl_canvasbitmap.cxx @@ -50,6 +50,11 @@ namespace oglcanvas { return maCanvasHelper.renderRecordedActions(); } + +bool CanvasBitmap::renderRecordedActions(const ::basegfx::B2DHomMatrix rGeneralTransform) const +{ +return maCanvasHelper.renderRecordedActions(rGeneralTransform); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/opengl/ogl_canvasbitmap.hxx b/canvas/source/opengl/ogl_canvasbitmap.hxx index 534837a..c5c3202 100644 --- a/canvas/source/opengl/ogl_canvasbitmap.hxx +++ b/canvas/source/opengl/ogl_canvasbitmap.hxx @@ -65,6 +65,10 @@ namespace oglcanvas */ bool renderRecordedActions() const; +/** Write out recorded actions +apply transformation for each action +*/ +bool renderRecordedActions( const ::basegfx::B2DHomMatrix rGeneralTransform) const; private: /** MUST hold here, too, since CanvasHelper only contains a raw pointer (without refcounting) diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 58e8072..c0b94ec 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -326,23 +326,21 @@ namespace oglcanvas return true; } -bool lcl_drawOwnBitmap( const CanvasHelper rHelper, +bool lcl_drawOwnBitmap( const CanvasHelper /*rHelper*/, const ::basegfx::B2DHomMatrix rTransform, -GLenum eSrcBlend, -GLenum eDstBlend, +GLenum /*eSrcBlend*/, +GLenum /*eDstBlend*/, const rendering::ARGBColor /*rColor*/, const CanvasBitmap rBitmap ) { -RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); -pRenderHelper-SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); -return rBitmap.renderRecordedActions(); +return rBitmap.renderRecordedActions(rTransform); } bool lcl_drawGenericBitmap( const CanvasHelper rHelper, const ::basegfx::B2DHomMatrix rTransform, GLenum
[Libreoffice-commits] core.git: sc/source
sc/source/core/tool/detfunc.cxx | 78 ++-- 1 file changed, 37 insertions(+), 41 deletions(-) New commits: commit e30e5ac95909d4c8aefeff8263a0ec09f3c82440 Author: Michael Jaumann meta_...@yahoo.com Date: Mon Feb 9 14:06:38 2015 + fdo#39468 translated german comments Change-Id: I96ef1c6758eaffb88e2167acee7c9d810317ca44 Reviewed-on: https://gerrit.libreoffice.org/14384 Tested-by: Michael Stahl mst...@redhat.com Reviewed-by: Michael Stahl mst...@redhat.com diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index bd94ae4..d21476f 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -79,7 +79,7 @@ using namespace com::sun::star; // The checkForUniqueItem method then finds a unique name for the item's value. #define SC_LINEEND_NAME EMPTY_OUSTRING -enum DetInsertResult { // Return-Werte beim Einfuegen in einen Level +enum DetInsertResult { // return-values for inserting in one level DET_INS_CONTINUE, DET_INS_INSERTED, DET_INS_EMPTY, @@ -144,8 +144,8 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) : aBoxSet.Put( XLineColorItem( EMPTY_OUSTRING, Color( ScDetectiveFunc::GetArrowColor() ) ) ); aBoxSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) ); -// Standard-Linienenden (wie aus XLineEndList::Create) selber zusammenbasteln, -// um von den konfigurierten Linienenden unabhaengig zu sein +// create default line endings (like XLineEndList::Create) +// to be independent from the configured line endings basegfx::B2DPolygon aTriangle; aTriangle.append(basegfx::B2DPoint(10.0, 0.0)); @@ -592,12 +592,12 @@ bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, return true; } -// DrawEntry: Formel auf dieser Tabelle, -// Referenz auf dieser oder anderer -// DrawAlienEntry: Formel auf anderer Tabelle, -// Referenz auf dieser +// DrawEntry: formula from this spreadsheet, +// reference on this or other +// DrawAlienEntry: formula from other spreadsheet, +// reference on this -// return FALSE: da war schon ein Pfeil +// return FALSE: there was already an arrow bool ScDetectiveFunc::DrawEntry( SCCOL nCol, SCROW nRow, const ScRange rRef, @@ -681,7 +681,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, bool bDestPnt ) if ( pObject-GetLayer()==SC_LAYER_INTERN pObject-IsPolyObj() pObject-GetPointCount()==2 ) { -if (aRect.IsInside(pObject-GetPoint(bDestPnt ? 1 : 0))) // Start/Zielpunkt +if (aRect.IsInside(pObject-GetPoint(bDestPnt ? 1 : 0))) // start/destinationpoint ppObj[nDelCount++] = pObject; } @@ -700,7 +700,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, bool bDestPnt ) } } -// Box um Referenz loeschen +// delete box around reference #define SC_DET_TOLERANCE50 @@ -811,7 +811,7 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetective return DET_INS_CIRCULAR; if (pFCell-GetDirty()) -pFCell-Interpret();// nach SetRunning geht's nicht mehr! +pFCell-Interpret();// can't be called after SetRunning pFCell-SetRunning(true); sal_uInt16 nResult = DET_INS_EMPTY; @@ -822,11 +822,11 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetective { if (DrawEntry( nCol, nRow, aRef, rData )) { -nResult = DET_INS_INSERTED; // neuer Pfeil eingetragen +nResult = DET_INS_INSERTED; // insert new arrow } else { -// weiterverfolgen +// continue if ( nLevel rData.GetMaxLevel() ) { @@ -851,10 +851,10 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetective if (nResult == DET_INS_EMPTY) nResult = DET_INS_CIRCULAR; break; -// DET_INS_EMPTY: unveraendert lassen +// DET_INS_EMPTY: no change } } -else// nMaxLevel erreicht +else// nMaxLevel reached if (nResult != DET_INS_INSERTED) nResult = DET_INS_CONTINUE; } @@ -884,7 +884,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevelArea( const ScRange rRef, return nResult; } -// nDeleteLevel != 0 - loeschen +// nDeleteLevel
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvashelper.cxx |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) New commits: commit d10845d1f2200ee0a889264753ebb4f083b5b40b Author: Michael Jaumann meta_...@yahoo.com Date: Thu Jan 22 09:55:43 2015 + related to last commit, forget a line :) Change-Id: I18b3b2046ac6ba54635a022c3268a5264cf6b05b diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 7cdc7e6..58e8072 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -664,12 +664,14 @@ namespace oglcanvas // via OutDev::DrawPolyPolygon(), on/off fill would // generate off areas on those self-intersections. +const sal_uInt16 nSize( aStrokedPolyPoly.count() ); + for(sal_uInt32 i=0;inSize; ++i) { -::basegfx::B2DPolyPolygon tempStrokedPoly; -tempStrokedPoly.append(aStrokedPolyPoly.getB2DPolygon(i)); +::basegfx::B2DPolyPolygon aSingleStrokedPoly; + aSingleStrokedPoly.append(aStrokedPolyPoly.getB2DPolygon(i)); -rAct.maPolyPolys.push_back(tempStrokedPoly); +rAct.maPolyPolys.push_back(aSingleStrokedPoly); rAct.maPolyPolys.back().makeUnique(); // own copy, for thread safety rAct.maFunction = lcl_fillPolyPolygon; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - canvas/source
canvas/source/opengl/ogl_canvashelper.cxx | 24 1 file changed, 16 insertions(+), 8 deletions(-) New commits: commit 12d33874d6dcecdc43b82f438da0798828c7e971 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Jan 21 09:15:59 2015 + draw strokes correct dont connect single polygons from createAreaGeometry draw each polygone for itself Change-Id: Iff10fc7a221453d48ca042dd556f86b4342b60ef diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 6397f4f0..7cdc7e6 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -659,10 +659,22 @@ namespace oglcanvas unoCapeFromCap(strokeAttributes.StartCapType) )); } -rAct.maPolyPolys.push_back(aStrokedPolyPoly); -rAct.maPolyPolys.back().makeUnique(); // own copy, for thread safety +// Note: the generated stroke poly-polygon is NOT free of +// self-intersections. Therefore, if we would render it +// via OutDev::DrawPolyPolygon(), on/off fill would +// generate off areas on those self-intersections. -rAct.maFunction = lcl_fillPolyPolygon; +for(sal_uInt32 i=0;inSize; ++i) +{ +::basegfx::B2DPolyPolygon tempStrokedPoly; +tempStrokedPoly.append(aStrokedPolyPoly.getB2DPolygon(i)); + +rAct.maPolyPolys.push_back(tempStrokedPoly); +rAct.maPolyPolys.back().makeUnique(); // own copy, for thread safety + +rAct.maFunction = lcl_fillPolyPolygon; + +} } } commit f7e8dc334ad82c182c84133420c40e77f4e68c2d Author: Michael Jaumann meta_...@yahoo.com Date: Wed Jan 21 09:09:51 2015 + no need here for color Change-Id: I7bde6d916e801eda6bb4c5db4a050b86b6758178 diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index c3b9800..6397f4f0 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -249,10 +249,6 @@ namespace oglcanvas { RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); pRenderHelper-SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); -glm::vec4 color = glm::vec4( (float) rendering::ARGBColor().Red, -(float) rendering::ARGBColor().Green, -(float) rendering::ARGBColor().Blue, -(float) rendering::ARGBColor().Alpha); // convert to weird canvas textur coordinate system (not // [0,1]^2, but path coordinate system) @@ -334,7 +330,7 @@ namespace oglcanvas const ::basegfx::B2DHomMatrix rTransform, GLenum eSrcBlend, GLenum eDstBlend, -const rendering::ARGBColor rColor, +const rendering::ARGBColor /*rColor*/, const CanvasBitmap rBitmap ) { RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvashelper.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit a435269e765bd2aa0f296bc3d09920e7628aaf0c Author: Michael Jaumann meta_...@yahoo.com Date: Thu Jan 15 13:25:21 2015 + fill polypolygons fully transparent Change-Id: I76711d305bc672e70b4ecdd2f8e1fa1b7fbf44b6 diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 9aa92e2..c3b9800 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -227,6 +227,7 @@ namespace oglcanvas (float) rColor.Green, (float) rColor.Blue, (float) rColor.Alpha); +glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ::basegfx::B2DPolyPolygonVector::const_iterator aCurr=rPolyPolygons.begin(); const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 4 commits - basegfx/source canvas/source include/basegfx
basegfx/source/polygon/b2dpolygon.cxx | 36 basegfx/source/polygon/b2dpolypolygon.cxx | 12 canvas/source/opengl/ogl_canvascustomsprite.cxx | 24 canvas/source/opengl/ogl_canvastools.cxx| 11 --- canvas/source/opengl/ogl_renderHelper.cxx | 10 ++ canvas/source/opengl/ogl_renderHelper.hxx |5 +++ canvas/source/opengl/ogl_spritedevicehelper.cxx |1 include/basegfx/polygon/b2dpolygon.hxx |9 ++ include/basegfx/polygon/b2dpolypolygon.hxx |9 ++ 9 files changed, 96 insertions(+), 21 deletions(-) New commits: commit 8c9106457ac8c515b052cbd27f6c14414b11cfbf Author: Michael Jaumann meta_...@yahoo.com Date: Wed Jan 14 12:51:43 2015 + set correct projection and viewport for sprites each sprite is drawn to a framebuffer/ texture set projection and viewport to the sprite resolution Change-Id: I3c6c53729c76ee1dc4fcb53b5b31b912be782d49 diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index ac8272e..7acaceb 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -139,6 +139,9 @@ namespace oglcanvas RenderHelper* pRenderHelper = maCanvasHelper.getDeviceHelper()-getRenderHelper(); IBufferContextSharedPtr pBufferContext; +GLint myviewport[4]; +glGetIntegerv(GL_VIEWPORT, myviewport); + if( mfAlpha != 0.0 || mxClip.is() ) { // drats. need to render to temp surface before, and then @@ -146,12 +149,20 @@ namespace oglcanvas // TODO(P3): buffer texture pBufferContext = maCanvasHelper.getDeviceHelper()-createBufferContext(aSpriteSizePixel); -//glViewport(0, 0,aSpriteSizePixel.x,aSpriteSizePixel.y); pBufferContext-startBufferRendering(); } // this ends up in pBufferContext, if that one's current +// Draw in spriteresolution +const glm::mat4 oldResulution = pRenderHelper-GetVP(); +pRenderHelper-SetVP(aSpriteSizePixel.x, aSpriteSizePixel.y); +glViewport(0, 0,aSpriteSizePixel.x,aSpriteSizePixel.y); + if( !maCanvasHelper.renderRecordedActions() ) return false; + +//go back to window resolution +pRenderHelper-SetVP(oldResulution); +glViewport(myviewport[0], myviewport[1],myviewport[2],myviewport[3]); const glm::mat4 translate = glm::translate(glm::vec3(maPosition.getX(), maPosition.getY(), 0)); if( pBufferContext ) { @@ -172,6 +183,7 @@ namespace oglcanvas pRenderHelper-SetModelAndMVP( translate *aGLTransform ); + GLuint nTexture = pBufferContext-getTextureId(); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, nTexture); @@ -237,16 +249,6 @@ namespace oglcanvas glBindTexture(GL_TEXTURE_2D, 0); } -std::vectorglm::vec2 vertices; -vertices.reserve(6); -vertices.push_back(glm::vec2(-2, -2)); -vertices.push_back(glm::vec2(-2, (float) maSize.Height+4)); -vertices.push_back(glm::vec2((float) maSize.Width+4, (float) maSize.Height+4)); -vertices.push_back(glm::vec2((float) maSize.Width+4, -2)); -vertices.push_back(glm::vec2(-2, -2)); -vertices.push_back(glm::vec2((float) maSize.Width+4, (float) maSize.Height+4)); - -pRenderHelper-renderVertexConstColor(vertices, glm::vec4(1, 0, 0, 1), GL_LINE_STRIP); #ifdef DEBUG_RENDERING std::vectordouble aVec; diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx index 50e1269..21e03b4 100644 --- a/canvas/source/opengl/ogl_renderHelper.cxx +++ b/canvas/source/opengl/ogl_renderHelper.cxx @@ -87,6 +87,15 @@ namespace oglcanvas void RenderHelper::SetVP(const float nwidth, const float nheight) { m_VP = glm::ortho(0.0f, nwidth, nheight, 0.0f); + +void RenderHelper::SetVP(const glm::mat4 vp) +{ +m_VP = vp; +} + +glm::mat4 RenderHelper::GetVP() +{ +return m_VP; } static void cleanUp() @@ -142,6 +151,7 @@ namespace oglcanvas glDeleteProgram( m_texManProgID); glDeleteProgram( m_simpleProgID); glDeleteProgram( m_texProgID); +glDeleteProgram( m_texTransProgID); glDeleteProgram( mnRectangularTwoColorGradientProgram ); glDeleteProgram( mnRectangularMultiColorGradientProgram ); glDeleteProgram( mnRadialTwoColorGradientProgram ); diff --git a/canvas/source/opengl/ogl_renderHelper.hxx b/canvas/source/opengl/ogl_renderHelper.hxx index 011120a..383bbbc 100644 --- a/canvas/source/opengl/ogl_renderHelper.hxx +++ b
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - canvas/source
canvas/source/opengl/ogl_canvascustomsprite.cxx | 47 canvas/source/opengl/ogl_canvashelper.cxx | 17 +++- 2 files changed, 39 insertions(+), 25 deletions(-) New commits: commit c74a5358d92e3c163da541add4682e9f24482f4c Author: Michael Jaumann meta_...@yahoo.com Date: Thu Dec 18 12:17:45 2014 + subdivide bezier curves Change-Id: I616eefabc083d78bd259689c77908edd45788cd6 diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 992fe87..9aa92e2 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -543,14 +543,27 @@ namespace oglcanvas Action rAct=mpRecordedActions-back(); setupGraphicsState( rAct, viewState, renderState ); +//untested code, otherways commented out should work... +basegfx::B2DPolygon aPoly; +aPoly.append(basegfx::B2DPoint(aBezierSegment.Px, aBezierSegment.Py)); +aPoly.appendBezierSegment( basegfx::B2DPoint(aBezierSegment.C1x, aBezierSegment.C1y), + basegfx::B2DPoint(aBezierSegment.C1x, aBezierSegment.C1y), + basegfx::B2DPoint(aEndPoint.X,aEndPoint.Y)); + +basegfx::B2DPolyPolygon aPolyPoly; +aPolyPoly.append(aPoly); +rAct.maPolyPolys.push_back(aPolyPoly); +rAct.maPolyPolys.back().makeUnique(); // own copy, for thread safety +rAct.maFunction = lcl_drawPolyPolygon; // TODO(F2): subdividerender whole curve -rAct.maFunction = ::boost::bind(lcl_drawLine, +/*rAct.maFunction = ::boost::bind(lcl_drawLine, _1,_2,_3,_4,_5, geometry::RealPoint2D( aBezierSegment.Px, aBezierSegment.Py), -aEndPoint); +aEndPoint);*/ + } } commit 9c3a9e987bc5a7b5f8e84349fc8c39a3999011f9 Author: Michael Jaumann meta_...@yahoo.com Date: Thu Dec 18 12:11:17 2014 + renderSprite renders still to framebuffer with the wrong offset ( polygon is clipped, or entire out of texture bounds ) Change-Id: I485fd141c73d1e9783db7f4638bb33875e3af9be diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index 9962eb4..ac8272e 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -25,6 +25,7 @@ #include basegfx/polygon/b2dpolygontriangulator.hxx #include basegfx/polygon/b2dpolypolygontools.hxx #include GL/glew.h +#include vcl/opengl/GLMHelper.hxx using namespace ::com::sun::star; @@ -131,42 +132,46 @@ namespace oglcanvas if( ::basegfx::fTools::equalZero( mfAlpha ) ) return true; -const glm::vec2 aSpriteSizePixel( -::canvas::tools::roundUp( maSize.Width ), -::canvas::tools::roundUp( maSize.Height )); -RenderHelper* pRenderHelper = maCanvasHelper.getDeviceHelper()-getRenderHelper(); +const glm::vec2 aSpriteSizePixel( +::canvas::tools::roundUp( maSize.Width), +::canvas::tools::roundUp( maSize.Height)); + +RenderHelper* pRenderHelper = maCanvasHelper.getDeviceHelper()-getRenderHelper(); IBufferContextSharedPtr pBufferContext; -if( mfAlpha != 1.0 || mxClip.is() ) + +if( mfAlpha != 0.0 || mxClip.is() ) { // drats. need to render to temp surface before, and then // composite that to screen // TODO(P3): buffer texture pBufferContext = maCanvasHelper.getDeviceHelper()-createBufferContext(aSpriteSizePixel); +//glViewport(0, 0,aSpriteSizePixel.x,aSpriteSizePixel.y); pBufferContext-startBufferRendering(); } - // this ends up in pBufferContext, if that one's current if( !maCanvasHelper.renderRecordedActions() ) return false; - const glm::mat4 translate = glm::translate(glm::vec3(maPosition.getX(), maPosition.getY(), 0)); if( pBufferContext ) { +//pRenderHelper-SetModelAndMVP( aGLTransform); +// content ended up in background buffer - compose to +// screen now. Calls below switches us back to window +// context, and binds to generated, dynamic texture + +pBufferContext-endBufferRendering(); + const glm::mat4 aGLTransform = glm::mat4( maTransformation.m00, maTransformation.m10, 0, 0
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - basegfx/CppunitTest_basegfx.mk basegfx/test canvas/source
basegfx/CppunitTest_basegfx.mk |3 basegfx/test/minimalCreateAreaGeometryTest.cxx | 87 ++ canvas/source/opengl/ogl_canvashelper.cxx | 118 +++-- 3 files changed, 202 insertions(+), 6 deletions(-) New commits: commit f70e408c975c22403bb1d6eb72e02162dcdd262c Author: Michael Jaumann meta_...@yahoo.com Date: Thu Dec 11 12:15:23 2014 + testcase for createAreaGeometry Change-Id: Ie9b6dcad91549feba738e0b3e010982a54cd327d diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk index 8f34f3b..86ebf8cd5 100644 --- a/basegfx/CppunitTest_basegfx.mk +++ b/basegfx/CppunitTest_basegfx.mk @@ -25,6 +25,8 @@ $(eval $(call gb_CppunitTest_use_libraries,basegfx,\ $(gb_UWINAPI) \ )) + + $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ basegfx/test/basegfx1d \ basegfx/test/basegfx2d \ @@ -33,6 +35,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ basegfx/test/basegfxtools \ basegfx/test/clipstate \ basegfx/test/genericclipper \ + basegfx/test/minimalCreateAreaGeometryTest \ )) # vim: set noet sw=4 ts=4: diff --git a/basegfx/test/minimalCreateAreaGeometryTest.cxx b/basegfx/test/minimalCreateAreaGeometryTest.cxx new file mode 100644 index 000..11e91a9 --- /dev/null +++ b/basegfx/test/minimalCreateAreaGeometryTest.cxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include sal/types.h +#include cppunit/TestAssert.h +#include cppunit/TestFixture.h +#include cppunit/extensions/HelperMacros.h + +#include basegfx/tools/tools.hxx +#include com/sun/star/rendering/PathCapType.hpp +#include com/sun/star/rendering/PathJoinType.hpp +#include basegfx/polygon/b2dpolypolygon.hxx +#include basegfx/polygon/b2dlinegeometry.hxx + + +using namespace ::basegfx; + +namespace basegfxtools +{ + +class createAreaGeometryTest : public CppUnit::TestFixture +{ +B2DPolygon mPoly; +const float mStrokeWidth; +static B2DPolygon getTestVector() +{ +B2DPolygon aTestPoly; +aTestPoly.reserve(6); +aTestPoly.append(B2DPoint(2.26965,2.33533)); +aTestPoly.append(B2DPoint(523.855,2.33533)); +aTestPoly.append(B2DPoint(523.855,312.263)); +aTestPoly.append(B2DPoint(2.26965,2.33533)); +aTestPoly.append(B2DPoint(523.855,2.33533)); +aTestPoly.append(B2DPoint(523.855,312.263)); +return aTestPoly; +} + +public: +createAreaGeometryTest(): +mPoly(getTestVector()), +mStrokeWidth(2.3*0.5) +{} +void setUp() SAL_OVERRIDE +{} + +void tearDown() SAL_OVERRIDE +{} + +void test() +{ + ::basegfx::B2DPolyPolygon aStrokedPolyPoly; + aStrokedPolyPoly.append(basegfx::tools::createAreaGeometry( + mPoly, + mStrokeWidth, + basegfx::B2DLINEJOIN_NONE, + com::sun::star::drawing::LineCap_SQUARE)); +} + +// Change the following lines only, if you add, remove or rename +// member functions of the current class, +// because these macros are need by auto register mechanism. + +CPPUNIT_TEST_SUITE(createAreaGeometryTest); +CPPUNIT_TEST(test); +CPPUNIT_TEST_SUITE_END(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(basegfxtools::createAreaGeometryTest); +} // namespace basegfxtools + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 851bef411081e2d922d5bd781d7e549bb4b7d3af Author: Michael Jaumann meta_...@yahoo.com Date: Thu Dec 11 10:38:10 2014 + draw stroke polygons Change-Id: I55e35eabc59ce45b9cd271f8bc8596c0082a8fde diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index ec08cf8..992fe87 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -17,6 +17,8 @@ #include basegfx/polygon/b2dpolygontriangulator.hxx #include basegfx/polygon/b2dpolypolygontools.hxx + #include basegfx/polygon/b2dpolygontools.hxx + #include com/sun
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvashelper.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit c6a91186d8807aee578693d9ec764a9b9d1a8ba6 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Dec 10 08:40:39 2014 + fix, transformation matrix for gradients Change-Id: Ib93937ab944c7197824b7c618eada4ad70e64cb0 diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index de8ef93..ec08cf8 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -213,11 +213,12 @@ namespace oglcanvas aBounds.expand(::basegfx::tools::getRange(*aCurr++)); aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY()); aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight()); +aTextureTransform.invert(); const float aTextureTransformation[] = { -float(aTextureTransform.get(1,0)), float(aTextureTransform.get(1,1)), -float(aTextureTransform.get(1,2)), float(aTextureTransform.get(0,0)), -float(aTextureTransform.get(0,1)), float(aTextureTransform.get(0,2)) +float(aTextureTransform.get(0,0)), float(aTextureTransform.get(1,0)), +float(aTextureTransform.get(0,1)), float(aTextureTransform.get(1,1)), +float(aTextureTransform.get(0,2)), float(aTextureTransform.get(1,2)) }; const glm::mat3x2 aTexTransform = glm::make_mat3x2(aTextureTransformation); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 5 commits - canvas/opengl canvas/source
canvas/opengl/constantFragmentShader.glsl |4 canvas/opengl/dummyVertexShader.glsl |7 canvas/opengl/linearMultiColorGradientFragmentShader.glsl |4 canvas/opengl/linearTwoColorGradientFragmentShader.glsl|4 canvas/opengl/radialMultiColorGradientFragmentShader.glsl |4 canvas/opengl/radialTwoColorGradientFragmentShader.glsl|4 canvas/opengl/rectangularMultiColorGradientFragmentShader.glsl |4 canvas/opengl/rectangularTwoColorGradientFragmentShader.glsl |4 canvas/source/opengl/ogl_canvashelper.cxx | 84 +- canvas/source/opengl/ogl_canvastools.cxx | 10 canvas/source/opengl/ogl_canvastools.hxx |2 canvas/source/opengl/ogl_renderHelper.cxx | 362 ++ canvas/source/opengl/ogl_renderHelper.hxx | 70 + canvas/source/opengl/ogl_spritedevicehelper.cxx| 154 canvas/source/opengl/ogl_spritedevicehelper.hxx| 20 15 files changed, 361 insertions(+), 376 deletions(-) New commits: commit 9614f9de6edfdfe6e64b4ae270bef04dc793e186 Author: Michael Jaumann meta_...@yahoo.com Date: Tue Dec 9 12:19:21 2014 + use gradients in canvashelper Change-Id: I242f63bb055336d208dad5efced3618c9f89e47f diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index eb645f6..de8ef93 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -180,7 +180,7 @@ namespace oglcanvas const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); while( aCurr != aEnd ) { -renderComplexPolyPolygon(*aCurr++, pRenderHelper, color, false); +renderComplexPolyPolygon(*aCurr++, pRenderHelper, color); } return true; @@ -213,6 +213,13 @@ namespace oglcanvas aBounds.expand(::basegfx::tools::getRange(*aCurr++)); aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY()); aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight()); +const float aTextureTransformation[] = +{ +float(aTextureTransform.get(1,0)), float(aTextureTransform.get(1,1)), +float(aTextureTransform.get(1,2)), float(aTextureTransform.get(0,0)), +float(aTextureTransform.get(0,1)), float(aTextureTransform.get(0,2)) +}; +const glm::mat3x2 aTexTransform = glm::make_mat3x2(aTextureTransformation); const sal_Int32 nNumCols=rValues.maColors.getLength(); uno::Sequence rendering::ARGBColor aColors(nNumCols); @@ -223,36 +230,45 @@ namespace oglcanvas OSL_ASSERT(nNumCols == rValues.maStops.getLength()); -switch( rValues.meType ) -{ -case ::canvas::ParametricPolyPolygon::GRADIENT_LINEAR: -rHelper.getDeviceHelper()-useLinearGradientShader(pColors, - rValues.maStops, - aTextureTransform); -break; - -case ::canvas::ParametricPolyPolygon::GRADIENT_ELLIPTICAL: -rHelper.getDeviceHelper()-useRadialGradientShader(pColors, - rValues.maStops, - aTextureTransform); -break; - -case ::canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR: - rHelper.getDeviceHelper()-useRectangularGradientShader(pColors, - rValues.maStops, - aTextureTransform); -break; - -default: -ENSURE_OR_THROW( false, - CanvasHelper lcl_fillGradientPolyPolygon(): Unexpected case ); -} - - aCurr=rPolyPolygons.begin(); while( aCurr != aEnd ) { -renderComplexPolyPolygon(*aCurr++, pRenderHelper, color, true); +::basegfx::B2DPolyPolygon aPolyPoly(*aCurr++); +if( aPolyPoly.areControlPointsUsed() ) +aPolyPoly = aPolyPoly.getDefaultAdaptiveSubdivision(); +const ::basegfx::B2DRange rBounds(aPolyPoly.getB2DRange()); +const double nWidth=rBounds.getWidth(); +const double nHeight=rBounds.getHeight(); +const ::basegfx::B2DPolygon rTriangulatedPolygon
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 8 commits - canvas/opengl canvas/Package_opengl.mk canvas/source include/vcl
canvas/Package_opengl.mk|1 canvas/opengl/transformationFragmentShader.glsl | 24 canvas/source/opengl/ogl_canvashelper.cxx | 42 +++--- canvas/source/opengl/ogl_canvastools.cxx| 64 -- canvas/source/opengl/ogl_canvastools.hxx|2 canvas/source/opengl/ogl_renderHelper.cxx | 68 +++- canvas/source/opengl/ogl_renderHelper.hxx | 10 +++ canvas/source/opengl/ogl_spritedevicehelper.cxx | 26 ++--- include/vcl/opengl/OpenGLContext.hxx|3 + 9 files changed, 170 insertions(+), 70 deletions(-) New commits: commit d81798535aba8c3f4686cb89eb2238d1df322c35 Author: Michael Jaumann meta_...@yahoo.com Date: Tue Dec 2 10:06:36 2014 + texture transformation shader New texture transformation shader. Renderhelper uses it. Draw texturedPolygon with it. Change-Id: I285bf9cce0f216fd382a933d53b786238005f74f diff --git a/canvas/Package_opengl.mk b/canvas/Package_opengl.mk index 13c6cb3..7948fda 100644 --- a/canvas/Package_opengl.mk +++ b/canvas/Package_opengl.mk @@ -22,6 +22,7 @@ $(eval $(call gb_Package_add_files,canvas_opengl_shader,$(LIBO_ETC_FOLDER)/openg textFragmentShader.glsl \ textManipulatingVertexShader.glsl \ texVertexShader.glsl \ + transformationFragmentShader.glsl \ )) # vim: set noet sw=4 ts=4: diff --git a/canvas/opengl/transformationFragmentShader.glsl b/canvas/opengl/transformationFragmentShader.glsl new file mode 100644 index 000..1a72b10 --- /dev/null +++ b/canvas/opengl/transformationFragmentShader.glsl @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#version 120 + +uniform sampler2D TextTex; +uniform vec4 colorTex; +uniform mat4 texTrans; +//Texture Coordinates +varying vec2 textCoords; + +void main() +{ + vec2 texCoord = (texTrans * vec4(textCoords, 0, 1)).xy; +gl_FragColor = texture2D( TextTex, texCoord )*colorTex; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 5c9e916..34d1342 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -35,6 +35,7 @@ #include ogl_tools.hxx #include GL/glew.h +#include glm/gtc/type_ptr.hpp #include boost/scoped_array.hpp @@ -336,14 +337,11 @@ namespace oglcanvas RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); pRenderHelper-SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); -glm::vec4 color = glm::vec4( (float) rendering::ARGBColor().Red, -(float) rendering::ARGBColor().Green, -(float) rendering::ARGBColor().Blue, -(float) rendering::ARGBColor().Alpha); - +//blend against fixed color +glm::vec4 color = glm::vec4(1,1,1,1); const unsigned int nTexId=rHelper.getDeviceHelper()-getTextureCache().getTexture( rPixelSize, rPixelData.getConstArray(), nPixelCrc32); - +glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, nTexId); glEnable(GL_TEXTURE_2D); glTexParameteri(GL_TEXTURE_2D, @@ -364,24 +362,24 @@ namespace oglcanvas ::basegfx::B2DRange aBounds; ::basegfx::B2DPolyPolygonVector::const_iterator aCurr=rPolyPolygons.begin(); const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); - /* while( aCurr != aEnd ) +while( aCurr != aEnd ) aBounds.expand(::basegfx::tools::getRange(*aCurr++)); aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY()); aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight()); aTextureTransform.invert(); -double aTexTransform[] = +float aTexTransform[] = { -aTextureTransform.get(0,0), aTextureTransform.get(1,0), 0, 0, -aTextureTransform.get(0,1), aTextureTransform.get(1,1), 0, 0, +(float) aTextureTransform.get(0,0), (float) aTextureTransform.get(1,0), 0, 0, +(float) aTextureTransform.get(0,1), (float) aTextureTransform.get(1,1), 0, 0, 0, 0, 1, 0, -aTextureTransform.get(0,2), aTextureTransform.get(1,2), 0, 1
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvashelper.cxx | 14 +++--- canvas/source/opengl/ogl_canvastools.cxx | 14 +- canvas/source/opengl/ogl_canvastools.hxx |3 ++- canvas/source/opengl/ogl_renderHelper.cxx | 23 +++ 4 files changed, 37 insertions(+), 17 deletions(-) New commits: commit 2bd148c0210571981af047245a3be9e670e99312 Author: Michael Jaumann meta_...@yahoo.com Date: Fri Nov 28 09:23:37 2014 + drawArrays with triangles, correct buffersize Change-Id: Ic2a7bff2b59e12ca4b455cbefb16ba692f81efc5 diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 7d25491..7a8e47c 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -101,7 +101,7 @@ namespace oglcanvas const geometry::RealPoint2D rPoint) { RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); -setupState(rTransform, eSrcBlend, eDstBlend); +// pRenderHelper-SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); glm::vec4 color = glm::vec4( (float) rColor.Red, (float) rColor.Green, (float) rColor.Blue, @@ -122,7 +122,7 @@ namespace oglcanvas const geometry::RealPoint2D rEndPoint) { RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); -setupState(rTransform, eSrcBlend, eDstBlend); + // pRenderHelper-SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); glm::vec4 color = glm::vec4( (float) rColor.Red, (float) rColor.Green, (float) rColor.Blue, @@ -144,7 +144,7 @@ namespace oglcanvas const ::basegfx::B2DPolyPolygonVector rPolyPolygons) { RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); -setupState(rTransform, eSrcBlend, eDstBlend); + // pRenderHelper-SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); glm::vec4 color = glm::vec4( (float) rColor.Red, (float) rColor.Green, (float) rColor.Blue, @@ -169,7 +169,7 @@ namespace oglcanvas { //no texture bind ? RenderHelper* pRenderHelper = rHelper.getDeviceHelper()-getRenderHelper(); -setupState(rTransform, eSrcBlend, eDstBlend); + // pRenderHelper-SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); glm::vec4 color = glm::vec4( (float) rColor.Red, (float) rColor.Green, (float) rColor.Blue, @@ -179,7 +179,7 @@ namespace oglcanvas const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); while( aCurr != aEnd ) { -renderPolyPolygon(*aCurr++, pRenderHelper, color); +renderComplexPolyPolygon(*aCurr++, pRenderHelper, color, false); } return true; @@ -251,7 +251,7 @@ namespace oglcanvas aCurr=rPolyPolygons.begin(); while( aCurr != aEnd ) { -renderComplexPolyPolygon(*aCurr++, pRenderHelper, color); +renderComplexPolyPolygon(*aCurr++, pRenderHelper, color, true); } glUseProgram(0); @@ -381,7 +381,7 @@ namespace oglcanvas aCurr=rPolyPolygons.begin(); while( aCurr != aEnd ) { -renderComplexPolyPolygon(*aCurr++, pRenderHelper, color); +renderComplexPolyPolygon(*aCurr++, pRenderHelper, color, true); } diff --git a/canvas/source/opengl/ogl_canvastools.cxx b/canvas/source/opengl/ogl_canvastools.cxx index 833c9eb..346d73a 100644 --- a/canvas/source/opengl/ogl_canvastools.cxx +++ b/canvas/source/opengl/ogl_canvastools.cxx @@ -29,8 +29,8 @@ using namespace ::com::sun::star; namespace oglcanvas { /// triangulates polygon before -//move to canvashelper, or take renderHelper as parameter? -void renderComplexPolyPolygon( const ::basegfx::B2DPolyPolygon rPolyPoly, RenderHelper *renderHelper, glm::vec4 color ) +void renderComplexPolyPolygon( const ::basegfx::B2DPolyPolygon rPolyPoly, RenderHelper *renderHelper, +glm::vec4 color, const bool hasTexture) { ::basegfx::B2DPolyPolygon aPolyPoly(rPolyPoly); if( aPolyPoly.areControlPointsUsed() ) @@ -47,7 +47,10 @@ namespace oglcanvas const ::basegfx::B2DPoint rPt( rTriangulatedPolygon.getB2DPoint(i) ); vertices.push_back(glm::vec2(rPt.getX(),rPt.getY())); } -renderHelper-renderVertexTex( vertices
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_renderHelper.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit ef908a07c2edf558321966f00bba4eb6257d4323 Author: Michael Jaumann meta_...@yahoo.com Date: Thu Nov 27 13:51:33 2014 + fill glbufferdata with the right verticecount Change-Id: I0efe1b6ec94daa3bac97d7e4f0768aea8d32d738 diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx index 70f1769..8d95f46 100644 --- a/canvas/source/opengl/ogl_renderHelper.cxx +++ b/canvas/source/opengl/ogl_renderHelper.cxx @@ -49,7 +49,7 @@ namespace oglcanvas void RenderHelper::SetVP(const float width, const float height) { -m_VP = glm::ortho(0.0f, width, 0.0f, height); +m_VP = glm::ortho(0.0f, width, height, 0.0f); } @@ -62,10 +62,10 @@ namespace oglcanvas void RenderHelper::renderVertexConstColor(const std::vectorglm::vec2 rVertices, glm::vec4 color, GLenum mode) const { glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); -glBufferData(GL_ARRAY_BUFFER, rVertices.size()*2, rVertices[0].x, GL_STATIC_DRAW); glUseProgram(m_texProgID); +glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), rVertices[0].x, GL_STATIC_DRAW); glUniform4fv(m_texColorUnf, 1, color[0]); glUniformMatrix4fv(m_texMVPUnf, 1, GL_FALSE, m_MVP[0][0]); glEnableVertexAttribArray(m_texPosAttrb); //vertices @@ -91,10 +91,10 @@ namespace oglcanvas void RenderHelper::renderVertexUVTex(const std::vectorglm::vec2 rVertices, const std::vectorglm::vec2 rUVcoords, glm::vec4 color, GLenum mode) const { glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); -glBufferData(GL_ARRAY_BUFFER, rVertices.size()*2, rVertices[0].x, GL_STATIC_DRAW); +glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), rVertices[0].x, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, m_uvBuffer); -glBufferData(GL_ARRAY_BUFFER, rUVcoords.size()*2, rUVcoords[0].x, GL_STATIC_DRAW); +glBufferData(GL_ARRAY_BUFFER, sizeof(rUVcoords), rUVcoords[0].x, GL_STATIC_DRAW); glUseProgram(m_simpleProgID); @@ -148,7 +148,7 @@ namespace oglcanvas void RenderHelper::renderVertexTex(const std::vectorglm::vec2 rVertices, GLfloat fWidth, GLfloat fHeight, glm::vec4 color, GLenum mode) const { glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); -glBufferData(GL_ARRAY_BUFFER, rVertices.size()*2, rVertices[0].x, GL_STATIC_DRAW); +glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), rVertices[0].x, GL_STATIC_DRAW); glUseProgram(m_texManProgID); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_renderHelper.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 95c6e4f420c2e604325151706f95f8f7d4ff9403 Author: Michael Jaumann meta_...@yahoo.com Date: Thu Nov 27 13:51:33 2014 + fill glbufferdata with the right verticecount Change-Id: I0efe1b6ec94daa3bac97d7e4f0768aea8d32d738 diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx index 8d95f46..f53ab33 100644 --- a/canvas/source/opengl/ogl_renderHelper.cxx +++ b/canvas/source/opengl/ogl_renderHelper.cxx @@ -65,7 +65,7 @@ namespace oglcanvas glUseProgram(m_texProgID); -glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), rVertices[0].x, GL_STATIC_DRAW); +glBufferData(GL_ARRAY_BUFFER, rVertices.size()*sizeof(float), rVertices[0].x, GL_STATIC_DRAW); glUniform4fv(m_texColorUnf, 1, color[0]); glUniformMatrix4fv(m_texMVPUnf, 1, GL_FALSE, m_MVP[0][0]); glEnableVertexAttribArray(m_texPosAttrb); //vertices @@ -91,10 +91,10 @@ namespace oglcanvas void RenderHelper::renderVertexUVTex(const std::vectorglm::vec2 rVertices, const std::vectorglm::vec2 rUVcoords, glm::vec4 color, GLenum mode) const { glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); -glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), rVertices[0].x, GL_STATIC_DRAW); +glBufferData(GL_ARRAY_BUFFER, rVertices.size()*sizeof(float), rVertices[0].x, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, m_uvBuffer); -glBufferData(GL_ARRAY_BUFFER, sizeof(rUVcoords), rUVcoords[0].x, GL_STATIC_DRAW); +glBufferData(GL_ARRAY_BUFFER, rUVcoords.size()*sizeof(float), rUVcoords[0].x, GL_STATIC_DRAW); glUseProgram(m_simpleProgID); @@ -148,7 +148,7 @@ namespace oglcanvas void RenderHelper::renderVertexTex(const std::vectorglm::vec2 rVertices, GLfloat fWidth, GLfloat fHeight, glm::vec4 color, GLenum mode) const { glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); -glBufferData(GL_ARRAY_BUFFER, sizeof(rVertices), rVertices[0].x, GL_STATIC_DRAW); +glBufferData(GL_ARRAY_BUFFER, rVertices.size()*sizeof(float), rVertices[0].x, GL_STATIC_DRAW); glUseProgram(m_texManProgID); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 8 commits - canvas/opengl canvas/source
canvas/opengl/simpleVertexShader.glsl |5 - canvas/opengl/texVertexShader.glsl |5 - canvas/opengl/textManipulatingVertexShader.glsl |3 canvas/source/opengl/ogl_canvascustomsprite.cxx | 48 +++-- canvas/source/opengl/ogl_canvashelper.cxx | 85 canvas/source/opengl/ogl_canvastools.cxx| 39 +++ canvas/source/opengl/ogl_canvastools.hxx|2 canvas/source/opengl/ogl_renderHelper.cxx | 66 ++ canvas/source/opengl/ogl_renderHelper.hxx | 29 +--- canvas/source/opengl/ogl_spritedevicehelper.cxx | 67 +- canvas/source/opengl/ogl_spritedevicehelper.hxx |3 11 files changed, 182 insertions(+), 170 deletions(-) New commits: commit de9b174dede3bcb0575d42f134f6f112d507abc7 Author: Michael Jaumann meta_...@yahoo.com Date: Tue Nov 25 14:45:08 2014 + compute gl_position in one line instead of two Change-Id: Id250c0092d533bf23de867ef7dfc51666fa4c1fd diff --git a/canvas/opengl/simpleVertexShader.glsl b/canvas/opengl/simpleVertexShader.glsl index 0aa110f..af3e9cc 100644 --- a/canvas/opengl/simpleVertexShader.glsl +++ b/canvas/opengl/simpleVertexShader.glsl @@ -12,9 +12,8 @@ varying vec2 textCoords; uniform mat4 MVP; void main(void) -{ -vec4 v = vec4(vPosition,1,1); -gl_Position = MVP * v; +{ +gl_Position = MVP * vec4(vPosition,1,1); textCoords = UV; } diff --git a/canvas/opengl/texVertexShader.glsl b/canvas/opengl/texVertexShader.glsl index aadf0de..cce2420 100644 --- a/canvas/opengl/texVertexShader.glsl +++ b/canvas/opengl/texVertexShader.glsl @@ -8,14 +8,13 @@ */ #version 120 - + attribute vec2 vPosition; uniform mat4 MVP; void main(void) { - vec4 v = vec4(vPosition,1,1); - gl_Position = MVP * v; + gl_Position = MVP * vec4(vPosition,1,1); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/opengl/textManipulatingVertexShader.glsl b/canvas/opengl/textManipulatingVertexShader.glsl index 172fc18..1637ff7 100644 --- a/canvas/opengl/textManipulatingVertexShader.glsl +++ b/canvas/opengl/textManipulatingVertexShader.glsl @@ -16,8 +16,7 @@ uniform mat4 MVP; void main(void) { - vec4 v = vec4(vPosition,1,1); - gl_Position = MVP * v; + gl_Position = MVP * vec4(vPosition,1,1); textCoords = vPosition/texCord; } commit 0513a38ad267a57fee69fcef7a8099e23e9b3894 Author: Michael Jaumann meta_...@yahoo.com Date: Tue Nov 25 14:11:29 2014 + use const refs and vectors instead of arrays Change-Id: Ie853e719528ef7f6f72935c8749a5cb8e97c3153 diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index 6073e5a..9962eb4 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -161,7 +161,8 @@ namespace oglcanvas maTransformation.m02, maTransformation.m12, 0, 1 ); -pRenderHelper-SetModelAndMVP(translate * aGLTransform); +//pRenderHelper-SetModelAndMVP(translate * aGLTransform); +pRenderHelper-SetModelAndMVP( aGLTransform); // content ended up in background buffer - compose to // screen now. Calls below switches us back to window // context, and binds to generated, dynamic texture @@ -200,12 +201,12 @@ namespace oglcanvas aSpriteSizePixel.x, aSpriteSizePixel.y))); -GLfloat vertices[rTriangulatedPolygon.count()*2]; +std::vectorglm::vec2 vertices; +vertices.reserve(rTriangulatedPolygon.count()); for( sal_uInt32 i=0; irTriangulatedPolygon.count(); i++ ) { const ::basegfx::B2DPoint rPt( rTriangulatedPolygon.getB2DPoint(i) ); -vertices[i*2]= rPt.getX(); -vertices[i*2+1]= rPt.getY(); +vertices.push_back(glm::vec2(rPt.getX(), rPt.getY())); } pRenderHelper-renderVertexTex( vertices, fWidth, fHeight, color, GL_TRIANGLES); } @@ -214,14 +215,19 @@ namespace oglcanvas const double fWidth=maSize.Width/aSpriteSizePixel.x; const double fHeight=maSize.Height/aSpriteSizePixel.y; -GLfloat vertices[] = {0, 0, - 0, (float) aSpriteSizePixel.y, - (float) aSpriteSizePixel.x, 0, - (float) aSpriteSizePixel.x, (float) aSpriteSizePixel.y }; -GLfloat uvCoordinates[] = {0, 0, - 0, (float) fHeight
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 5 commits - canvas/source vcl/source
canvas/source/opengl/ogl_canvascustomsprite.cxx |7 - canvas/source/opengl/ogl_canvashelper.cxx | 32 --- canvas/source/opengl/ogl_canvastools.cxx| 33 +--- canvas/source/opengl/ogl_canvastools.hxx|5 ++- canvas/source/opengl/ogl_renderHelper.cxx | 13 + canvas/source/opengl/ogl_spritedevicehelper.cxx |4 -- vcl/source/opengl/OpenGLHelper.cxx | 19 +++-- 7 files changed, 57 insertions(+), 56 deletions(-) New commits: commit 293a54dd59928330baf1873e23f4cb61c73e33e0 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Nov 19 08:20:59 2014 + unbind buffers, remove GlewInit() Change-Id: I9304fa6ae3b02812d53c91dde0470d09b4cc3668 diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx index 7bf6a94..1d1379b 100644 --- a/canvas/source/opengl/ogl_renderHelper.cxx +++ b/canvas/source/opengl/ogl_renderHelper.cxx @@ -11,7 +11,6 @@ namespace oglcanvas } void RenderHelper::InitOpenGL() { -GLenum err = glewInit(); //Load Shaders // m_texManProgID = OpenGLHelper::LoadShaders(textManipulatingVertexShader, textFragmentShader); m_simpleProgID = OpenGLHelper::LoadShaders(simpleVertexShader, textFragmentShader); @@ -37,7 +36,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) @@ -77,8 +76,8 @@ namespace oglcanvas glDrawArrays(mode, 0, sizeof(vertices) / sizeof(vertices[0]) /2); glDisableVertexAttribArray(m_texPosAttrb); -glUseProgram(0); glBindBuffer(GL_ARRAY_BUFFER, 0); +glUseProgram(0); } //Renders a TriangleStrip, Texture has to be stored in TextureUnit0 @@ -122,6 +121,7 @@ namespace oglcanvas glDisableVertexAttribArray(m_simplePosAttrb); glDisableVertexAttribArray(m_simpleUvAttrb); +glBindBuffer(GL_ARRAY_BUFFER, 0); glUseProgram(0); } @@ -164,6 +164,7 @@ namespace oglcanvas glDrawArrays(mode, 0, sizeof(vertices) / sizeof(vertices[0]) /2); glDisableVertexAttribArray(m_manPosAttrb); +glBindBuffer(GL_ARRAY_BUFFER, 0); glUseProgram(0); } } \ No newline at end of file commit 2dee7ecb904e956542a3d74cf28e8a52e2b1af60 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Nov 19 08:15:07 2014 + assign lcl_drawPolyPolygon to maFunction Change-Id: I58b465938e64fd44e1dd27b71c248a540dd3abbe diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 33d5814..cd9823d 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -500,7 +500,7 @@ namespace oglcanvas ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon)); rAct.maPolyPolys.back().makeUnique(); // own copy, for thread safety - // rAct.maFunction = lcl_drawPolyPolygon; +rAct.maFunction = lcl_drawPolyPolygon; } // TODO(P1): Provide caching here. commit 0f8b4f8b9827cb726aa9c8eb604f95beda527cf4 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Nov 19 08:13:17 2014 + renderOSD with renderHelper Change-Id: I1acff597434f870504d58e699cb55c76080db15d diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index 58b2561..6073e5a 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -127,6 +127,7 @@ namespace oglcanvas bool CanvasCustomSprite::renderSprite() { + if( ::basegfx::fTools::equalZero( mfAlpha ) ) return true; @@ -152,6 +153,7 @@ namespace oglcanvas const glm::mat4 translate = glm::translate(glm::vec3(maPosition.getX(), maPosition.getY(), 0)); if( pBufferContext ) { + const glm::mat4 aGLTransform = glm::mat4( maTransformation.m00, maTransformation.m10, 0, 0, maTransformation.m01, maTransformation.m11, 0, 0, @@ -225,7 +227,9 @@ namespace oglcanvas } glBindTexture(GL_TEXTURE_2D, 0); + } + // translate sprite to output position pRenderHelper-SetModelAndMVP(translate); GLfloat vertices[] = {-2, -2, @@ -241,7 +245,8 @@ namespace oglcanvas aVec.push_back(mfAlpha); aVec.push_back(mfPriority); aVec.push_back(maCanvasHelper.getRecordedActionCount()); -renderOSD( aVec, 10
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - canvas/source officecfg/registry vcl/source
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_...@yahoo.com Date: Mon Nov 10 13:24:30 2014 + 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; iaPolyPoly.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::vectordouble 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
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - canvas/opengl canvas/source
canvas/opengl/rectangularMultiColorGradientFragmentShader.glsl |6 canvas/source/opengl/ogl_canvascustomsprite.cxx| 30 +-- canvas/source/opengl/ogl_canvascustomsprite.hxx|1 canvas/source/opengl/ogl_canvashelper.cxx | 78 ++ canvas/source/opengl/ogl_canvashelper.hxx |2 canvas/source/opengl/ogl_renderHelper.cxx |6 canvas/source/opengl/ogl_renderHelper.hxx |3 canvas/source/opengl/ogl_spritedevicehelper.cxx|8 + canvas/source/opengl/ogl_spritedevicehelper.hxx|7 9 files changed, 86 insertions(+), 55 deletions(-) New commits: commit 56fb90618a731567bf44339bd4e0b8d0e4dd4dd9 Author: Michael Jaumann meta_...@yahoo.com Date: Fri Nov 7 11:22:32 2014 + mv renderHelper-Spritedevicehelper,init OglContxt Change-Id: I81e4035796e47bd845c8f211d30cc2655b9c09f0 diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index f64e25c..58b2561 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -47,7 +47,6 @@ namespace oglcanvas ::canvas::tools::setIdentityAffineMatrix2D(maTransformation); maCanvasHelper.init( *rRefDevice.get(), rDeviceHelper ); -mRenderHelper.SetVP(1600, 900);//is this right? } void CanvasCustomSprite::disposeThis() @@ -55,7 +54,6 @@ namespace oglcanvas ::osl::MutexGuard aGuard( m_aMutex ); mpSpriteCanvas.clear(); -mRenderHelper.dispose(); // forward to parent CanvasCustomSpriteBaseT::disposeThis(); } @@ -132,10 +130,10 @@ namespace oglcanvas if( ::basegfx::fTools::equalZero( mfAlpha ) ) return true; -const ::basegfx::B2IVector aSpriteSizePixel( +const glm::vec2 aSpriteSizePixel( ::canvas::tools::roundUp( maSize.Width ), ::canvas::tools::roundUp( maSize.Height )); - +RenderHelper* pRenderHelper = maCanvasHelper.getDeviceHelper()-getRenderHelper(); IBufferContextSharedPtr pBufferContext; if( mfAlpha != 1.0 || mxClip.is() ) { @@ -161,7 +159,7 @@ namespace oglcanvas maTransformation.m02, maTransformation.m12, 0, 1 ); -mRenderHelper.SetModelAndMVP(translate * aGLTransform); +pRenderHelper-SetModelAndMVP(translate * aGLTransform); // content ended up in background buffer - compose to // screen now. Calls below switches us back to window // context, and binds to generated, dynamic texture @@ -197,8 +195,8 @@ namespace oglcanvas rTriangulatedPolygon, basegfx::B2DRange( 0,0, -aSpriteSizePixel.getX(), -aSpriteSizePixel.getY(; +aSpriteSizePixel.x, +aSpriteSizePixel.y))); GLfloat vertices[rTriangulatedPolygon.count()*2]; for( sal_uInt32 i=0; irTriangulatedPolygon.count(); i++ ) @@ -207,29 +205,29 @@ namespace oglcanvas vertices[i*2]= rPt.getX(); vertices[i*2+1]= rPt.getY(); } -mRenderHelper.renderVertexTex( vertices, fWidth, fHeight, color, GL_TRIANGLES); +pRenderHelper-renderVertexTex( vertices, fWidth, fHeight, color, GL_TRIANGLES); } else { -const double fWidth=maSize.Width/aSpriteSizePixel.getX(); -const double fHeight=maSize.Height/aSpriteSizePixel.getY(); +const double fWidth=maSize.Width/aSpriteSizePixel.x; +const double fHeight=maSize.Height/aSpriteSizePixel.y; GLfloat vertices[] = {0, 0, - 0, (float) aSpriteSizePixel.getY(), - (float) aSpriteSizePixel.getX(), 0, - (float) aSpriteSizePixel.getX(), (float) aSpriteSizePixel.getY() }; + 0, (float) aSpriteSizePixel.y, + (float) aSpriteSizePixel.x, 0, + (float) aSpriteSizePixel.x, (float) aSpriteSizePixel.y }; GLfloat uvCoordinates[] = {0, 0, 0, (float) fHeight, (float) fWidth, 0, (float) fWidth, (float) fHeight
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/Package_opengl.mk
canvas/Package_opengl.mk |4 1 file changed, 4 insertions(+) New commits: commit f819beb74e6e09930eb8042caac612b87d2f431a Author: Michael Jaumann meta_...@yahoo.com Date: Thu Nov 6 13:44:50 2014 + added shaders to makefile Change-Id: Ic90c69c0af087ca18c9cbe7e0199139b41e16901 diff --git a/canvas/Package_opengl.mk b/canvas/Package_opengl.mk index 5e54b73..a92fffc 100644 --- a/canvas/Package_opengl.mk +++ b/canvas/Package_opengl.mk @@ -17,6 +17,10 @@ $(eval $(call gb_Package_add_files,canvas_opengl_shader,$(LIBO_ETC_FOLDER)/openg radialTwoColorGradientFragmentShader.glsl \ rectangularMultiColorGradientFragmentShader.glsl \ rectangularTwoColorGradientFragmentShader.glsl \ +constantFragmentShader.glsl \ +simpleVertexShader.glsl \ +textFragmentShader.glsl \ +textManipulatingVertexShader.glsl \ )) # vim: set noet sw=4 ts=4: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/opengl canvas/Package_opengl.mk
canvas/Package_opengl.mk|1 + canvas/opengl/constantFragmentShader.glsl |2 +- canvas/opengl/texVertexShader.glsl |3 +++ canvas/opengl/textFragmentShader.glsl |4 ++-- canvas/opengl/textManipulatingVertexShader.glsl |3 +++ 5 files changed, 10 insertions(+), 3 deletions(-) New commits: commit ea88a49e33cd9182eca412d1198e3cdf548bab64 Author: Michael Jaumann meta_...@yahoo.com Date: Thu Nov 6 14:31:25 2014 + fixed some problems with glsl version Change-Id: Id1cf9382680ae225c205535dbafd06abce269eaf diff --git a/canvas/Package_opengl.mk b/canvas/Package_opengl.mk index a92fffc..13c6cb3 100644 --- a/canvas/Package_opengl.mk +++ b/canvas/Package_opengl.mk @@ -21,6 +21,7 @@ $(eval $(call gb_Package_add_files,canvas_opengl_shader,$(LIBO_ETC_FOLDER)/openg simpleVertexShader.glsl \ textFragmentShader.glsl \ textManipulatingVertexShader.glsl \ +texVertexShader.glsl \ )) # vim: set noet sw=4 ts=4: diff --git a/canvas/opengl/constantFragmentShader.glsl b/canvas/opengl/constantFragmentShader.glsl index 6deb08f..67b0a9c 100644 --- a/canvas/opengl/constantFragmentShader.glsl +++ b/canvas/opengl/constantFragmentShader.glsl @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#version 120 core +#version 120 uniform vec4 constantColor; diff --git a/canvas/opengl/texVertexShader.glsl b/canvas/opengl/texVertexShader.glsl index c359f11..aadf0de 100644 --- a/canvas/opengl/texVertexShader.glsl +++ b/canvas/opengl/texVertexShader.glsl @@ -6,6 +6,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#version 120 + attribute vec2 vPosition; uniform mat4 MVP; diff --git a/canvas/opengl/textFragmentShader.glsl b/canvas/opengl/textFragmentShader.glsl index 32a0423e..b81b07a 100644 --- a/canvas/opengl/textFragmentShader.glsl +++ b/canvas/opengl/textFragmentShader.glsl @@ -7,12 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#version 120 core +#version 120 uniform sampler2D TextTex; uniform vec4 colorTex; //Texture Coordinates -varying vec2 textC oords; +varying vec2 textCoords; void main() { diff --git a/canvas/opengl/textManipulatingVertexShader.glsl b/canvas/opengl/textManipulatingVertexShader.glsl index dfe10d2..172fc18 100644 --- a/canvas/opengl/textManipulatingVertexShader.glsl +++ b/canvas/opengl/textManipulatingVertexShader.glsl @@ -6,6 +6,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#version 120 + attribute vec2 vPosition; varying vec2 textCoords; uniform vec2 texCord; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - officecfg/registry
officecfg/registry/data/org/openoffice/Office/Canvas.xcu |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 3f2f07ba88d78168873d5e90716a65f42a21e2f2 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Nov 5 08:29:44 2014 + pick the ogl-canvas Change-Id: I940663ad7f3b016aed51ad0879628d32380e659b diff --git a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu index f1d965e..377f211 100644 --- a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu @@ -46,9 +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.DX9, +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.VCL, + com.sun.star.comp.rendering.SpriteCanvas.DX9 -- /value /prop prop oor:name=AcceleratedImplementations oor:type=oor:string-list ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - basegfx/Library_basegfx.mk basegfx/source include/basegfx
basegfx/Library_basegfx.mk|3 - basegfx/source/tools/canvastools.cxx | 69 ++ include/basegfx/tools/canvastools.hxx | 12 + 3 files changed, 82 insertions(+), 2 deletions(-) New commits: commit 6a45c27ba42e8e51a427a90a3fc745f149b948d8 Author: Michael Jaumann meta_...@yahoo.com Date: Tue Nov 4 08:18:40 2014 + wrappers for bdhommatrix/affinematrix -glm::mat4 Change-Id: I0ff0b5ed82bbe9dc0ed264b71f6cea5a72809aff diff --git a/basegfx/source/tools/canvastools.cxx b/basegfx/source/tools/canvastools.cxx index f59f447..c578e16 100644 --- a/basegfx/source/tools/canvastools.cxx +++ b/basegfx/source/tools/canvastools.cxx @@ -334,6 +334,41 @@ namespace basegfx return output; } +glm::mat4 glmMatrixFromAffineMatrix( const ::com::sun::star::geometry::AffineMatrix2D input ) +{ +// ensure last row is [0,0,1] (and optimized away) +glm::mat4 output; +output[0][0] = input.m00; +output[1][0] = input.m01; +output[2][0] = input.m02; +output[0][1] = input.m10; +output[1][1] = input.m11; +output[2][1] = input.m12; + +return output; +} + +glm::mat4 glmMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D input ) +{ +glm::mat4 output; +output[0][0] = input.m00; +output[1][0] = input.m01; +output[2][0] = input.m02; +output[3][0] = input.m03; + +output[0][1] = input.m10; +output[1][1] = input.m11; +output[2][1] = input.m12; +output[3][1] = input.m13; + +output[0][2] = input.m20; +output[1][2] = input.m21; +output[2][2] = input.m22; +output[3][2] = input.m23; + +return output; +} + ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D input ) { ::basegfx::B3DHomMatrix output; @@ -369,6 +404,40 @@ namespace basegfx return output; } +glm::mat4 glmMatFromHomMatrix( const ::basegfx::B2DHomMatrix input) +{ +glm::mat4 output; +output[0][0] = input.get(0,0); +output[1][0] = input.get(0,1); +output[2][0] = input.get(0,2); +output[0][1] = input.get(1,0); +output[1][1] = input.get(1,1); +output[2][1] = input.get(1,2); + +return output; +} + +glm::mat4 glmMatFromHomMatrix3d( const ::basegfx::B3DHomMatrix input) +{ +glm::mat4 output; +output[0][0] = input.get(0,0); +output[1][0] = input.get(0,1); +output[2][0] = input.get(0,2); +output[3][0] = input.get(0,3); + +output[0][1] = input.get(1,0); +output[1][1] = input.get(1,1); +output[2][1] = input.get(1,2); +output[3][1] = input.get(1,3); + +output[0][2] = input.get(2,0); +output[1][2] = input.get(2,1); +output[2][2] = input.get(2,2); +output[3][2] = input.get(2,3); + +return output; +} + geometry::AffineMatrix3D affineMatrixFromHomMatrix3D( geometry::AffineMatrix3D output, const ::basegfx::B3DHomMatrix input) diff --git a/include/basegfx/tools/canvastools.hxx b/include/basegfx/tools/canvastools.hxx index c678805..2a3030a 100644 --- a/include/basegfx/tools/canvastools.hxx +++ b/include/basegfx/tools/canvastools.hxx @@ -23,6 +23,7 @@ #include com/sun/star/uno/Reference.hxx #include com/sun/star/uno/Sequence.hxx #include basegfx/basegfxdllapi.h +#include glm/glm.hpp namespace com { namespace sun { namespace star { namespace geometry @@ -128,12 +129,21 @@ namespace basegfx BASEGFX_DLLPUBLIC ::basegfx::B2DHomMatrix homMatrixFromAffineMatrix( ::basegfx::B2DHomMatrix transform, const ::com::sun::star::geometry::AffineMatrix2Dmatrix ); + BASEGFX_DLLPUBLIC ::basegfx::B3DHomMatrix +homMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D matrix ); -BASEGFX_DLLPUBLIC ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D matrix ); + + +BASEGFX_DLLPUBLIC glm::mat4 glmMatrixFromAffineMatrix( const ::com::sun::star::geometry::AffineMatrix2D matrix ); + +BASEGFX_DLLPUBLIC glm::mat4 glmMatrixFromAffineMatrix3D( const ::com::sun::star::geometry::AffineMatrix3D matrix ); BASEGFX_DLLPUBLIC ::com::sun::star::geometry::Matrix2D matrixFromHomMatrix( ::com::sun::star::geometry::Matrix2D matrix, const ::basegfx::B2DHomMatrix transform
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - basegfx/source canvas/source include/basegfx
basegfx/source/glm_matrix/b2dglmmatrixtools.cxx | 360 canvas/source/opengl/ogl_spritedevicehelper.cxx |8 canvas/source/opengl/ogl_spritedevicehelper.hxx |3 include/basegfx/matrix/b2dglmmatrixtools.hxx| 134 4 files changed, 500 insertions(+), 5 deletions(-) New commits: commit 813fe994f5588db9639b0cbe7aa6778e400513b8 Author: Michael Jaumann meta_...@yahoo.com Date: Mon Nov 3 13:34:01 2014 + replaced B2IVector with glm::vec2 Change-Id: Id89699358ec0a831184b4180a1e0c34c5ce2d9d0 diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index 5b712b8..70c9507 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -543,7 +543,7 @@ namespace oglcanvas class BufferContextImpl : public IBufferContext { -::basegfx::B2IVector maSize; +glm::vec2 maSize; GLuint mnFrambufferId; GLuint mnDepthId; GLuint mnTextureId; @@ -566,13 +566,13 @@ namespace oglcanvas } public: -BufferContextImpl(const ::basegfx::B2IVector rSize) : +BufferContextImpl(const glm::vec2 rSize) : maSize(rSize), mnFrambufferId(0), mnDepthId(0), mnTextureId(0) { -OpenGLHelper::createFramebuffer(maSize.getX(), maSize.getY(), mnFrambufferId, +OpenGLHelper::createFramebuffer(maSize.x, maSize.y, mnFrambufferId, mnDepthId, mnTextureId, false); } @@ -585,7 +585,7 @@ namespace oglcanvas }; } -IBufferContextSharedPtr SpriteDeviceHelper::createBufferContext(const ::basegfx::B2IVector rSize) const +IBufferContextSharedPtr SpriteDeviceHelper::createBufferContext(const glm::vec2 rSize) const { return IBufferContextSharedPtr(new BufferContextImpl(rSize)); } diff --git a/canvas/source/opengl/ogl_spritedevicehelper.hxx b/canvas/source/opengl/ogl_spritedevicehelper.hxx index 4eb3c4b..e9ecdc2 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.hxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.hxx @@ -20,6 +20,7 @@ #include ogl_buffercontext.hxx +#include glm/glm.hpp #include set namespace vcl { class Window; } @@ -110,7 +111,7 @@ namespace oglcanvas const ::basegfx::B2DHomMatrix rTexTransform ); /// create a pbuffer context (for rendering into background surface) -IBufferContextSharedPtr createBufferContext(const ::basegfx::B2IVector rSize) const; +IBufferContextSharedPtr createBufferContext(const glm::vec2 rSize) const; /// Get instance of internal texture cache TextureCache getTextureCache() const; commit 6dedd443191f5da89d9b1414274aa1ecaa10c95c Author: Michael Jaumann meta_...@yahoo.com Date: Mon Nov 3 13:24:29 2014 + migrate matrixtools to glm Change-Id: Ibd558f5d85f78e52fc6a73ba14acf2ea68ce8a37 diff --git a/basegfx/source/glm_matrix/b2dglmmatrixtools.cxx b/basegfx/source/glm_matrix/b2dglmmatrixtools.cxx new file mode 100644 index 000..0c81327 --- /dev/null +++ b/basegfx/source/glm_matrix/b2dglmmatrixtools.cxx @@ -0,0 +1,360 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include basegfx/matrix/b2dglmmatrixtools.hxx +#include basegfx/matrix/b2dhommatrixtools.hxx +#include rtl/ustring.hxx +#include rtl/ustrbuf.hxx + +namespace basegfx +{ +namespace tools +{ + +glm::mat4 createScaleGlmMatrix(double fScaleX, double fScaleY) +{ +glm::mat4 aRetval; +const double fOne(1.0); + +if(!fTools::equal(fScaleX, fOne)) +{ +aRetval[0][0] = fScaleX; +} + +if(!fTools::equal(fScaleY, fOne)) +{ +aRetval[1][1] = fScaleY; +} + +return aRetval; +} + +glm::mat4
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvascustomsprite.cxx | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) New commits: commit 37c274ed4c39aefc0e8d3e02d48032e312f6a3a9 Author: Michael Jaumann meta_...@yahoo.com Date: Thu Oct 30 08:31:01 2014 + apply transformation matrice before rendering Change-Id: I3eef5aa445dc2476266da55d9ea7012e62711ca0 diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index f6126f5..f64e25c 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -151,10 +151,17 @@ namespace oglcanvas if( !maCanvasHelper.renderRecordedActions() ) return false; +const glm::mat4 translate = glm::translate(glm::vec3(maPosition.getX(), maPosition.getY(), 0)); if( pBufferContext ) { -//no transformation -mRenderHelper.SetModelAndMVP(glm::mat4()); +const glm::mat4 aGLTransform = glm::mat4( +maTransformation.m00, maTransformation.m10, 0, 0, +maTransformation.m01, maTransformation.m11, 0, 0, +0,0,1, 0, +maTransformation.m02, maTransformation.m12, 0, 1 +); + +mRenderHelper.SetModelAndMVP(translate * aGLTransform); // content ended up in background buffer - compose to // screen now. Calls below switches us back to window // context, and binds to generated, dynamic texture @@ -178,7 +185,7 @@ namespace oglcanvas if( mxClip.is() ) { const double fWidth=maSize.Width; -const double fHeight=maSize.Height; +const double fHeight=maSize.Height; // TODO(P3): buffer triangulation const ::basegfx::B2DPolygon rTriangulatedPolygon( @@ -222,7 +229,7 @@ namespace oglcanvas glBindTexture(GL_TEXTURE_2D, 0); } // translate sprite to output position - mRenderHelper.SetModelAndMVP(glm::translate(glm::vec3(maPosition.getX(), maPosition.getY(), 0))); +mRenderHelper.SetModelAndMVP(translate); GLfloat vertices[] = {-2, -2, -2, (float) maSize.Height+4, (float) maSize.Width+4, (float) maSize.Height+4, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/core/tool/interpr4.cxx | 55 ++- 1 file changed, 26 insertions(+), 29 deletions(-) New commits: commit bff6b297fcb2ee88f663d20c9f03c6b998602256 Author: Michael Jaumann meta_...@yahoo.com Date: Thu Oct 30 14:32:05 2014 + fdo#39468 translate german comments Change-Id: Ife2b6e9729ae7335a87f077368a984c417ab5e66 Reviewed-on: https://gerrit.libreoffice.org/12154 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index e6bff29..276713b 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -84,7 +84,7 @@ using ::std::unique_ptr; //-static data - -// Funktionen fuer den Zugriff auf das Document +// document access functions void ScInterpreter::ReplaceCell( ScAddress rPos ) { @@ -2598,11 +2598,10 @@ void ScInterpreter::ScExternal() } else { -// nach dem Laden Asyncs wieder anwerfen +// enable asyncs after loading if ( rArr.IsRecalcModeNormal() ) rArr.SetExclusiveRecalcModeOnLoad(); -// garantiert identischer Handle bei identischem Aufruf?!? -// sonst schei*e ... +// assure identical handler with identical call? double nErg = 0.0; ppParam[0] = nErg; pFuncData-Call(ppParam); @@ -2617,9 +2616,7 @@ void ScInterpreter::ScExternal() } else { -// falls per cut/copy/paste pMyFormulaCell-StartListening( *pAs ); -// in anderes Dokument? if ( !pAs-HasDocument( pDok ) ) pAs-AddDocument( pDok ); } @@ -3097,7 +3094,7 @@ void ScInterpreter::ScMacro() { #if !HAVE_FEATURE_SCRIPTING -PushNoValue(); // ohne DocShell kein CallBasic +PushNoValue(); // without DocShell no CallBasic return; #else SbxBase::ResetError(); @@ -3108,18 +3105,18 @@ void ScInterpreter::ScMacro() SfxObjectShell* pDocSh = pDok-GetDocumentShell(); if ( !pDocSh || !pDok-CheckMacroWarn() ) { -PushNoValue(); // ohne DocShell kein CallBasic +PushNoValue(); // without DocShell no CallBasic return; } -// keine Sicherheitsabfrage mehr vorneweg (nur CheckMacroWarn), das passiert im CallBasic +// no security queue beforehand (just CheckMacroWarn), moved to CallBasic -// Wenn das Dok waehrend eines Basic-Calls geladen wurde, -// ist das Sbx-Objekt evtl. nicht angelegt (?) +// If the Dok was loaded during a Basic-Calls, +// is the Sbx-Objekt created(?) // pDocSh-GetSbxObject(); -// Funktion ueber den einfachen Namen suchen, -// dann aBasicStr, aMacroStr fuer SfxObjectShell::CallBasic zusammenbauen +// search function with the name, +// then assemble SfxObjectShell::CallBasic from aBasicStr, aMacroStr StarBASIC* pRoot; @@ -3330,7 +3327,7 @@ void ScInterpreter::ScMacro() SCCOL nColIdx; SCROW nRowIdx; if ( nDim == 1 ) -{ // array( cols ) eine Zeile, mehrere Spalten +{ // array( cols ) one line, several columns pDimArray-GetDim32( 1, nCs, nCe ); nC = static_castSCSIZE(nCe - nCs + 1); nRs = nRe = 0; @@ -3355,8 +3352,8 @@ void ScInterpreter::ScMacro() for ( SCSIZE j=0; j nR; j++ ) { sal_Int32 nIdx[ 2 ]; -// bei eindimensionalem array( cols ) wird nIdx[1] -// von SbxDimArray::Get ignoriert +// in one-dimensional array( cols ) nIdx[1] +// from SbxDimArray::Get is ignored nIdx[ nRowIdx ] = nRs + static_castsal_Int32(j); for ( SCSIZE i=0; i nC; i++ ) { @@ -3588,7 +3585,7 @@ void ScInterpreter::ScColRowNameAuto() SCsCOL nStartCol; SCsROW nStartRow; -// evtl. Begrenzung durch definierte ColRowNameRanges merken +// maybe remember limit by using defined ColRowNameRange SCsCOL nCol2 = aAbs.aEnd.Col(); SCsROW nRow2 = aAbs.aEnd.Row(); // DataArea of the first cell @@ -3605,26 +3602,26 @@ void ScInterpreter::ScColRowNameAuto() aAbs.aEnd.SetRow(nDARow2); } -//! korrespondiert mit ScCompiler::GetToken +//! corresponds with ScCompiler::GetToken if ( aRefData.Ref1.IsColRel() ) { // ColName
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 3 commits - canvas/source
canvas/source/opengl/ogl_canvascustomsprite.cxx |6 - canvas/source/opengl/ogl_canvashelper.cxx | 101 +--- canvas/source/opengl/ogl_canvashelper.hxx |3 canvas/source/opengl/ogl_canvastools.cxx| 28 +- canvas/source/opengl/ogl_canvastools.hxx| 17 ++-- canvas/source/opengl/ogl_renderHelper.cxx | 14 +-- canvas/source/opengl/ogl_renderHelper.hxx | 14 ++- 7 files changed, 97 insertions(+), 86 deletions(-) New commits: commit f8b451457fbbf80e42e3fdd41a2d3776920579f9 Author: Michael Jaumann meta_...@yahoo.com Date: Tue Oct 28 08:38:54 2014 + renderHelper instead fixedPipeline part 1 Change-Id: Ic866a76be6a06ee259e25e2b1901693cd35562aa diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 8c4969b..58e234f 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -98,15 +98,16 @@ namespace oglcanvas GLenum eSrcBlend, GLenum eDstBlend, const rendering::ARGBColor rColor, -const geometry::RealPoint2D rPoint ) +const geometry::RealPoint2D rPoint, +RenderHelper mRenderHelper) { -TransformationPreserver aPreserver; -setupState(rTransform, eSrcBlend, eDstBlend, rColor); - -glBegin(GL_POINTS); -glVertex2d(rPoint.X, rPoint.Y); -glEnd(); - +mRenderHelper.SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); +glm::vec4 color = glm::vec4( (float) rColor.Red, +(float) rColor.Green, +(float) rColor.Blue, +(float) rColor.Alpha); +GLfloat vertices[] = {(float) rPoint.X, (float) rPoint.Y}; +mRenderHelper.renderVertexConstColor(vertices, color, GL_POINTS); return true; } @@ -116,16 +117,17 @@ namespace oglcanvas GLenum eDstBlend, const rendering::ARGBColor rColor, const geometry::RealPoint2D rStartPoint, - const geometry::RealPoint2D rEndPoint ) + const geometry::RealPoint2D rEndPoint, + RenderHelper mRenderHelper) { -TransformationPreserver aPreserver; -setupState(rTransform, eSrcBlend, eDstBlend, rColor); - -glBegin(GL_LINES); -glVertex2d(rStartPoint.X, rStartPoint.Y); -glVertex2d(rEndPoint.X, rEndPoint.Y); -glEnd(); - +mRenderHelper.SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); +glm::vec4 color = glm::vec4( (float) rColor.Red, +(float) rColor.Green, +(float) rColor.Blue, +(float) rColor.Alpha); +GLfloat vertices[] = {(float) rStartPoint.X, (float) rStartPoint.Y, + (float) rEndPoint.X, (float) rEndPoint.Y }; +mRenderHelper.renderVertexConstColor(vertices, color, GL_LINES); return true; } @@ -136,9 +138,12 @@ namespace oglcanvas const rendering::ARGBColor rColor, const ::basegfx::B2DPolyPolygonVector rPolyPolygons ) { -TransformationPreserver aPreserver; -setupState(rTransform, eSrcBlend, eDstBlend, rColor); - +//move renderPolyPolygon here? + // mRenderHelper.SetModelAndMVP(setupState(rTransform, eSrcBlend, eDstBlend)); +glm::vec4 color = glm::vec4( (float) rColor.Red, +(float) rColor.Green, +(float) rColor.Blue, +(float) rColor.Alpha); ::basegfx::B2DPolyPolygonVector::const_iterator aCurr=rPolyPolygons.begin(); const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); while( aCurr != aEnd ) @@ -154,8 +159,9 @@ namespace oglcanvas const rendering::ARGBColor rColor, const ::basegfx::B2DPolyPolygonVector rPolyPolygons ) { +//no texture bind ? TransformationPreserver aPreserver; -setupState(rTransform, eSrcBlend, eDstBlend, rColor); +setupState(rTransform, eSrcBlend, eDstBlend); ::basegfx::B2DPolyPolygonVector::const_iterator aCurr=rPolyPolygons.begin(); const ::basegfx
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/source
canvas/source/opengl/ogl_canvascustomsprite.cxx | 24 + canvas/source/opengl/ogl_canvascustomsprite.hxx |2 - canvas/source/opengl/ogl_renderHelper.cxx | 27 canvas/source/opengl/ogl_renderHelper.hxx | 27 +++- 4 files changed, 60 insertions(+), 20 deletions(-) New commits: commit 964c17891c580c6ef8821b5f9c3d380f448565ca Author: Michael Jaumann meta_...@yahoo.com Date: Fri Oct 24 07:39:11 2014 + renderHelper uses MVP shader, removed matricestack Change-Id: I850216b6d52df52f71672d3b7b8142de90a63f83 diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index 812ab73..3f95107 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -47,6 +47,7 @@ namespace oglcanvas ::canvas::tools::setIdentityAffineMatrix2D(maTransformation); maCanvasHelper.init( *rRefDevice.get(), rDeviceHelper ); +mRenderHelper.SetVP(1600, 900);//is this right? } void CanvasCustomSprite::disposeThis() @@ -126,30 +127,14 @@ namespace oglcanvas } -bool CanvasCustomSprite::renderSprite() const +bool CanvasCustomSprite::renderSprite() { if( ::basegfx::fTools::equalZero( mfAlpha ) ) return true; -TransformationPreserver aPreserver1; const ::basegfx::B2IVector aSpriteSizePixel( ::canvas::tools::roundUp( maSize.Width ), ::canvas::tools::roundUp( maSize.Height )); -// translate sprite to output position -glTranslated(maPosition.getX(), maPosition.getY(), 0); - -{ -TransformationPreserver aPreserver2; - -// apply sprite content transformation matrix -double aGLTransform[] = -{ -maTransformation.m00, maTransformation.m10, 0, 0, -maTransformation.m01, maTransformation.m11, 0, 0, -0,0,1, 0, -maTransformation.m02, maTransformation.m12, 0, 1 -}; -glMultMatrixd(aGLTransform); IBufferContextSharedPtr pBufferContext; if( mfAlpha != 1.0 || mxClip.is() ) @@ -168,6 +153,8 @@ namespace oglcanvas if( pBufferContext ) { +//no transformation +mRenderHelper.SetModelAndMVP(glm::mat4()); // content ended up in background buffer - compose to // screen now. Calls below switches us back to window // context, and binds to generated, dynamic texture @@ -235,7 +222,8 @@ namespace oglcanvas glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D); } -} +// translate sprite to output position + mRenderHelper.SetModelAndMVP(glm::translate(glm::vec3(maPosition.getX(), maPosition.getY(), 0))); GLfloat vertices[] = {-2, -2, -2, (float) maSize.Height+4, (float) maSize.Width+4, (float) maSize.Height+4, diff --git a/canvas/source/opengl/ogl_canvascustomsprite.hxx b/canvas/source/opengl/ogl_canvascustomsprite.hxx index b678f1a..6f78a72 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.hxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.hxx @@ -78,7 +78,7 @@ namespace oglcanvas double getPriority() const { return mfPriority; } /// Render sprite content at sprite position -bool renderSprite() const; +bool renderSprite(); private: /** MUST hold here, too, since CanvasHelper only contains a diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx index 5447a54..3bc934e 100644 --- a/canvas/source/opengl/ogl_renderHelper.cxx +++ b/canvas/source/opengl/ogl_renderHelper.cxx @@ -4,6 +4,9 @@ namespace oglcanvas { RenderHelper::RenderHelper() +: m_iWidth(1600) //Why this dimensions? +, m_iHeight(900) +, m_Model(glm::mat4(1.0f)) { InitOpenGL(); } @@ -16,10 +19,16 @@ namespace oglcanvas // Get a handle for uniforms m_manTexUnf = glGetUniformLocation(m_texManProgID, TextTex); m_simpleTexUnf = glGetUniformLocation(m_simpleProgID, TextTex); + m_manCordUnf = glGetUniformLocation(m_texManProgID, texCord); m_texColorUnf = glGetUniformLocation(m_texProgID, constantColor); + m_manColorUnf = glGetUniformLocation(m_texManProgID,colorTex); m_simpleColorUnf = glGetUniformLocation(m_simpleProgID,colorTex); + +m_texMVPUnf = glGetUniformLocation(m_texProgID, MVP); +m_manMVPUnf = glGetUniformLocation(m_texManProgID, MVP); +m_simpleMVPUnf = glGetUniformLocation(m_simpleProgID, MVP); //Gen Buffers
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/opengl
canvas/opengl/simpleVertexShader.glsl |7 --- canvas/opengl/texVertexShader.glsl |4 +++- canvas/opengl/textManipulatingVertexShader.glsl |5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) New commits: commit 9967a0b20acb16cdf9ada926d67ac16448ce8c40 Author: Michael Jaumann meta_...@yahoo.com Date: Thu Oct 23 12:57:00 2014 + vertex shaders live now in the MVP space Change-Id: I36dcecabe79bbd1c29d4148dd01a47483450eb85 diff --git a/canvas/opengl/simpleVertexShader.glsl b/canvas/opengl/simpleVertexShader.glsl index 56ad104..0aa110f 100644 --- a/canvas/opengl/simpleVertexShader.glsl +++ b/canvas/opengl/simpleVertexShader.glsl @@ -9,12 +9,13 @@ attribute vec2 vPosition; attribute vec2 UV; varying vec2 textCoords; +uniform mat4 MVP; void main(void) { -gl_Position = vec4(vPosition,1,1); - - textCoords = UV; +vec4 v = vec4(vPosition,1,1); +gl_Position = MVP * v; +textCoords = UV; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/opengl/texVertexShader.glsl b/canvas/opengl/texVertexShader.glsl index e7b2566..c359f11 100644 --- a/canvas/opengl/texVertexShader.glsl +++ b/canvas/opengl/texVertexShader.glsl @@ -7,10 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ attribute vec2 vPosition; +uniform mat4 MVP; void main(void) { -gl_Position = vec4(vPosition,1,1); + vec4 v = vec4(vPosition,1,1); + gl_Position = MVP * v; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/opengl/textManipulatingVertexShader.glsl b/canvas/opengl/textManipulatingVertexShader.glsl index 8ebeae9..dfe10d2 100644 --- a/canvas/opengl/textManipulatingVertexShader.glsl +++ b/canvas/opengl/textManipulatingVertexShader.glsl @@ -9,11 +9,12 @@ attribute vec2 vPosition; varying vec2 textCoords; uniform vec2 texCord; +uniform mat4 MVP; void main(void) { -gl_Position = vec4(vPosition,1,1); - + vec4 v = vec4(vPosition,1,1); + gl_Position = MVP * v; textCoords = vPosition/texCord; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/Library_oglcanvas.mk canvas/source
canvas/Library_oglcanvas.mk |1 canvas/source/opengl/ogl_canvascustomsprite.cxx | 127 + canvas/source/opengl/ogl_canvascustomsprite.hxx | 23 --- canvas/source/opengl/ogl_renderHelper.cxx | 142 canvas/source/opengl/ogl_renderHelper.hxx | 35 + 5 files changed, 189 insertions(+), 139 deletions(-) New commits: commit 5e7b0adfd78e8a636a4b8de809fc6ecbe8efe799 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Oct 22 08:25:47 2014 + refactoring,shader input to renderHelper Change-Id: Ic695032e57374d1736004fa577cdc31d3e67a951 diff --git a/canvas/Library_oglcanvas.mk b/canvas/Library_oglcanvas.mk index b5d3377..17edbb1 100644 --- a/canvas/Library_oglcanvas.mk +++ b/canvas/Library_oglcanvas.mk @@ -39,6 +39,7 @@ $(eval $(call gb_Library_add_exception_objects,oglcanvas,\ canvas/source/opengl/ogl_spritedevicehelper \ canvas/source/opengl/ogl_textlayout \ canvas/source/opengl/ogl_texturecache \ + canvas/source/opengl/ogl_renderHelper \ )) $(eval $(call gb_Library_use_externals,oglcanvas,\ diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index bf5f347..a9c127b 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -24,7 +24,6 @@ #include basegfx/polygon/b2dpolygonclipper.hxx #include basegfx/polygon/b2dpolygontriangulator.hxx #include basegfx/polygon/b2dpolypolygontools.hxx -#include vcl/opengl/OpenGLHelper.hxx #include GL/glew.h using namespace ::com::sun::star; @@ -48,7 +47,7 @@ namespace oglcanvas ::canvas::tools::setIdentityAffineMatrix2D(maTransformation); maCanvasHelper.init( *rRefDevice.get(), rDeviceHelper ); -InitOpenGL(); +mRenderHelper = RenderHelper(); } void CanvasCustomSprite::disposeThis() @@ -56,11 +55,7 @@ namespace oglcanvas ::osl::MutexGuard aGuard( m_aMutex ); mpSpriteCanvas.clear(); -glDeleteBuffers(1, m_vertexBuffer); -glDeleteBuffers(1, m_uvBuffer); -glDeleteProgram( m_texManProgID); -glDeleteProgram( m_simpleProgID); -glDeleteProgram( m_texProgID); +mRenderHelper.dispose(); // forward to parent CanvasCustomSpriteBaseT::disposeThis(); } @@ -131,27 +126,6 @@ namespace oglcanvas return this; } -void CanvasCustomSprite::InitOpenGL() -{ -//Load Shaders // -m_texManProgID = OpenGLHelper::LoadShaders(textManipulatingVertexShader, textFragmentShader); -m_simpleProgID = OpenGLHelper::LoadShaders(simpleVertexShader, textFragmentShader); -m_texProgID = OpenGLHelper::LoadShaders(texVertrexShader, constantFragmentShader); -// Get a handle for uniforms -m_manTexUnf = glGetUniformLocation(m_texManProgID, TextTex); -m_simpleTexUnf = glGetUniformLocation(m_simpleProgID, TextTex); -m_manCordUnf = glGetUniformLocation(m_texManProgID, texCord); -m_texColorUnf = glGetUniformLocation(m_texProgID, constantColor); -m_manColorUnf = glGetUniformLocation(m_texManProgID,colorTex); -m_simpleColorUnf = glGetUniformLocation(m_simpleProgID,colorTex); -//Gen Buffers for texturecoordinates/vertices -glGenBuffers(1, m_vertexBuffer); -glGenBuffers(1, m_uvBuffer); -m_manPosAttrb = glGetAttribLocation(m_texManProgID ,vPosition); -m_simpleUvAttrb = glGetAttribLocation(m_simpleProgID ,UV); -m_simplePosAttrb = glGetAttribLocation(m_simpleProgID ,vPosition); -m_texPosAttrb = glGetAttribLocation(m_texProgID ,vPosition); -} bool CanvasCustomSprite::renderSprite() const { @@ -213,7 +187,8 @@ namespace oglcanvas glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -// blend against fixed vertex color; texture alpha is multiplied in +GLfloat color[] = {1, 1, 1, (float)mfAlpha}; + if( mxClip.is() ) { const double fWidth=maSize.Width; @@ -239,33 +214,7 @@ namespace oglcanvas vertices[i*2]= rPt.getX(); vertices[i*2+1]= rPt.getY(); } - -//Bind Buffers -glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); -glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - -glUseProgram(m_texManProgID); - -//Set Uniforms -glUniform1i(m_manTexUnf, 0); -glUniform2f(m_manCordUnf,fWidth,fHeight); -glUniform4f(m_manColorUnf, 1, 1, 1, mfAlpha); - -glEnableVertexAttribArray(m_manPosAttrb); -glBindBuffer(GL_ARRAY_BUFFER
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - 2 commits - canvas/source
canvas/source/opengl/ogl_canvascustomsprite.cxx |1 - canvas/source/opengl/ogl_renderHelper.cxx |2 +- canvas/source/opengl/ogl_renderHelper.hxx |6 -- 3 files changed, 5 insertions(+), 4 deletions(-) New commits: commit 90bf2ef6bd1ef90111dc8e4655b52307bcbbbf15 Author: Michael Jaumann meta_...@yahoo.com Date: Wed Oct 22 09:21:27 2014 + moving includes Change-Id: I2101d84a74a7f2b5dd06c546b9618e537b39ed36 diff --git a/canvas/source/opengl/ogl_renderHelper.cxx b/canvas/source/opengl/ogl_renderHelper.cxx index c3d6a87..5447a54 100644 --- a/canvas/source/opengl/ogl_renderHelper.cxx +++ b/canvas/source/opengl/ogl_renderHelper.cxx @@ -1,12 +1,12 @@ #include GL/glew.h #include ogl_renderHelper.hxx +#include vcl/opengl/OpenGLHelper.hxx namespace oglcanvas { RenderHelper::RenderHelper() { InitOpenGL(); } - void RenderHelper::InitOpenGL() { //Load Shaders // diff --git a/canvas/source/opengl/ogl_renderHelper.hxx b/canvas/source/opengl/ogl_renderHelper.hxx index 60698ce..454b3ff 100644 --- a/canvas/source/opengl/ogl_renderHelper.hxx +++ b/canvas/source/opengl/ogl_renderHelper.hxx @@ -1,5 +1,4 @@ #include GL/glew.h -#include vcl/opengl/OpenGLHelper.hxx namespace oglcanvas { class RenderHelper commit f24e4c52d503ecfe5c884206dc742b35f65ef12a Author: Michael Jaumann meta_...@yahoo.com Date: Wed Oct 22 09:14:33 2014 + fixes a ressource leak Change-Id: I7a27be09e377c2c6306e768dbaf8e8239da2c86e diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index a9c127b..812ab73 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -47,7 +47,6 @@ namespace oglcanvas ::canvas::tools::setIdentityAffineMatrix2D(maTransformation); maCanvasHelper.init( *rRefDevice.get(), rDeviceHelper ); -mRenderHelper = RenderHelper(); } void CanvasCustomSprite::disposeThis() diff --git a/canvas/source/opengl/ogl_renderHelper.hxx b/canvas/source/opengl/ogl_renderHelper.hxx index ea368a7..60698ce 100644 --- a/canvas/source/opengl/ogl_renderHelper.hxx +++ b/canvas/source/opengl/ogl_renderHelper.hxx @@ -5,12 +5,15 @@ namespace oglcanvas class RenderHelper { public: -RenderHelper(); + void renderVertexConstColor(GLfloat vertices[] , GLfloat color[4], GLenum mode) const ; void renderVertexUVTex(GLfloat vertices[], GLfloat uvCoordinates[], GLfloat color[4], GLenum mode) const ; void renderVertexTex(GLfloat vertices[], GLfloat, GLfloat, GLfloat color[4], GLenum mode) const; void dispose(); +RenderHelper(); private: +RenderHelper operator = (const RenderHelper other); +RenderHelper(const RenderHelper other); void InitOpenGL(); GLuintm_vertexBuffer; GLuintm_uvBuffer; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'feature/opengl-canvas-rework'
New branch 'feature/opengl-canvas-rework' available with the following commits: commit 242902d60797dd69a42fcd4b4e3024e4377c334f Author: Michael Jaumann meta_...@yahoo.com Date: Mon Oct 20 08:46:48 2014 + replaced fixed pipeline in ogl_canvashelper Change-Id: I380dd31636df8b125166ac6cdf2e00b0d263e15f ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/opengl canvas/source
canvas/opengl/textFragmentShader.glsl |5 +++-- canvas/source/opengl/ogl_canvascustomsprite.cxx | 23 +-- canvas/source/opengl/ogl_canvascustomsprite.hxx | 20 +--- 3 files changed, 37 insertions(+), 11 deletions(-) New commits: commit 5943fdb3dfa10268699cd55ea79aee5d1ca156fb Author: Michael Jaumann meta_...@yahoo.com Date: Mon Oct 20 12:14:42 2014 + reformating, alpha blending now in fragment shader Change-Id: I9f1d707e2434712efb9e3e346ecf50aa9c539d5b diff --git a/canvas/opengl/textFragmentShader.glsl b/canvas/opengl/textFragmentShader.glsl index b1589c6..32a0423e 100644 --- a/canvas/opengl/textFragmentShader.glsl +++ b/canvas/opengl/textFragmentShader.glsl @@ -9,13 +9,14 @@ #version 120 core -uniform sampler2D TextTex; +uniform sampler2D TextTex; +uniform vec4 colorTex; //Texture Coordinates varying vec2 textC oords; void main() { -gl_FragColor = texture2D( TextTex, textCoords ); +gl_FragColor = texture2D( TextTex, textCoords )*colorTex; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index cc04907..bf5f347 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -142,6 +142,8 @@ namespace oglcanvas m_simpleTexUnf = glGetUniformLocation(m_simpleProgID, TextTex); m_manCordUnf = glGetUniformLocation(m_texManProgID, texCord); m_texColorUnf = glGetUniformLocation(m_texProgID, constantColor); +m_manColorUnf = glGetUniformLocation(m_texManProgID,colorTex); +m_simpleColorUnf = glGetUniformLocation(m_simpleProgID,colorTex); //Gen Buffers for texturecoordinates/vertices glGenBuffers(1, m_vertexBuffer); glGenBuffers(1, m_uvBuffer); @@ -212,8 +214,6 @@ namespace oglcanvas GL_ONE_MINUS_SRC_ALPHA); // blend against fixed vertex color; texture alpha is multiplied in -glColor4f(1,1,1,mfAlpha); - if( mxClip.is() ) { const double fWidth=maSize.Width; @@ -243,10 +243,14 @@ namespace oglcanvas //Bind Buffers glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); + glUseProgram(m_texManProgID); + //Set Uniforms glUniform1i(m_manTexUnf, 0); glUniform2f(m_manCordUnf,fWidth,fHeight); +glUniform4f(m_manColorUnf, 1, 1, 1, mfAlpha); + glEnableVertexAttribArray(m_manPosAttrb); glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); glVertexAttribPointer( @@ -257,7 +261,9 @@ namespace oglcanvas 0,// stride (void*)0 // array buffer offset ); + glDrawArrays(GL_TRIANGLES, 0, rTriangulatedPolygon.count()); + glDisableVertexAttribArray(m_manPosAttrb); glUseProgram(0); } @@ -265,6 +271,7 @@ namespace oglcanvas { const double fWidth=maSize.Width/aSpriteSizePixel.getX(); const double fHeight=maSize.Height/aSpriteSizePixel.getY(); + GLfloat vertices[] = {0, 0, 0, (float) aSpriteSizePixel.getY(), (float) aSpriteSizePixel.getX(), 0, @@ -273,13 +280,17 @@ namespace oglcanvas 0, (float) fHeight, (float) fWidth, 0, (float) fWidth, (float) fHeight }; + glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, m_uvBuffer); glBufferData(GL_ARRAY_BUFFER, sizeof(uvCoordinates), uvCoordinates, GL_STATIC_DRAW); glUseProgram(m_simpleProgID); + glUniform1i(m_simpleTexUnf, 0); +glUniform4f(m_simpleColorUnf, 1, 1, 1, mfAlpha); glEnableVertexAttribArray(m_simplePosAttrb); //richtige ID herausfinden glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer); @@ -302,7 +313,9 @@ namespace oglcanvas 0,// stride (void*)0 // array buffer offset ); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4
[Libreoffice-commits] core.git: Changes to 'refs/changes/50/11450/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/34/11334/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/34/11334/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/34/11334/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/50/11450/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/50/11450/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/18/11418/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/11609/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/38/11338/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/38/11338/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/16/11416/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/38/11338/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/38/11338/5'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/11609/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/48/11348/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/48/11348/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/16/11416/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/17/11417/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/48/11348/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/18/11418/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/11609/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/11609/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/11609/5'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: LiMux student kick-off
Hi everybody, which GLSL version should be used? The existing shaders in chart2/opengl/ use the version 1.50. The shaders in canvas/opengl use version 1.20. Cheers Michael Tobias tobias_m...@web.de schrieb am 13:58 Freitag, 19.September 2014: At the moment i'm trying to get the unoxml/test/domtest.cxx (Bug 39625) working. So we'll see if it's usefull :) Cheers Tobi Am 19.09.2014 08:47, schrieb Matúš Kukan: On Wed, 2014-09-17 at 11:10 +0100, Michael Meeks wrote: On Wed, 2014-09-17 at 11:47 +0200, Jan-Marek Glogowski wrote: AFAIK Miklos was Michaels suggestion for the mentoring - can't remember. Matus is the XFastParser expert =) I guess it'd be nice to have a small XFastParser unit test as well (as some sort of entry-level easy-hack there). There is one in sax/qa/cppunit/parser.cxx - but needs more love. I've added simple css::xml::sax::XFastTokenHandler implementation in 6503be5311716cf520cf534ca1bb0fd595b93d72 What I think should be done there: 1, We need a better, more complicated input :-) 2, Extend DummyTokenHandler to recognize some of the element/attribute strings used in the input. 3, Implement simple XFastDocumentHandler and use setFastDocumentHandler() examples for this: - oox/source/crypto/DocumentDecryption.cxx - but we want to use tokens, not compare strings - unoxml/test/domtest.cxx - we don't build this, maybe we should, no idea how obsolete it is http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1xml_1_1sax_1_1XFastParser.html contains some description and there is also a link to a wiki with rather useful information. Best, Matus ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: i18npool/source
i18npool/source/search/levdis.cxx | 91 +++--- i18npool/source/search/levdis.hxx |4 - 2 files changed, 49 insertions(+), 46 deletions(-) New commits: commit 1ea8f156ac51b721dfea327c47212bef6ce74afb Author: Michael Jaumann meta_...@yahoo.com Date: Mon Sep 8 12:27:23 2014 + fdo#39468 tranlation German to English Change-Id: Icafab1c345a3a5291e4b19821710f439a1c70048 Reviewed-on: https://gerrit.libreoffice.org/11338 Reviewed-by: Chris Sherlock chris.sherloc...@gmail.com Tested-by: Chris Sherlock chris.sherloc...@gmail.com diff --git a/i18npool/source/search/levdis.cxx b/i18npool/source/search/levdis.cxx index 9af4430..d23a278 100644 --- a/i18npool/source/search/levdis.cxx +++ b/i18npool/source/search/levdis.cxx @@ -68,7 +68,7 @@ #endif #define LEVDISBIG (nLimit + 1)// Return value if distance nLimit -#define LEVDISDOUBLEBUF 2048// dadrueber wird nicht mehr gedoppelt +#define LEVDISDOUBLEBUF 2048// no doubling atop this border static sal_Int32 Impl_WLD_StringLen( const sal_Unicode* pStr ) { @@ -84,19 +84,18 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) int nSPMin = 0; // penalty point Minimum int nRepS = 0; // for SplitCount -// Laengendifferenz von Pattern und String +// length difference between pattern and string int nLenDiff = nPatternLen - nStars - nStringLen; -// mehr Einfuegungen oder Loeschungen noetig als Limit? = raus hier +// more insertions or deletions necessary as the limit? Then leave if ( (nLenDiff * nInsQ0 nLimit) || ((nStars == 0) (nLenDiff * nDelR0 -nLimit)) ) return(LEVDISBIG); -// wenn der zu vergleichende String groesser ist als das bisherige Array -// muss dieses angepasst werden + // comparative String greater than instantaneous array +// - adapt array size if ( nStringLen = nArrayLen ) { -// gib ihm moeglichst mehr, damit nicht gleich naechstesmal -// wieder realloziert werden muss +// increase size much more to avoid reallocation if ( nStringLen LEVDISDOUBLEBUF ) nArrayLen = 2 * nStringLen; else @@ -104,18 +103,18 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) npDistance = aDisMem.NewMem( nArrayLen ); } -// Anfangswerte der zweiten Spalte (erstes Pattern-Zeichen) berechnen -// die erste Spalte (0-Len Pattern) ist immer 0 .. nStringLen * nInsQ0, -// deren Minimum also 0 +// calculate start values of the second column(first Pattern-value) +// first column (0-Len Pattern) is always zero .. nStringLen * nInsQ0, +// therefore the minimum is 0 if ( nPatternLen == 0 ) { -// Anzahl der Loeschungen, um auf Pattern zu kommen +// Count of deletions, to determine the Pattern for ( sal_Int32 i=0; i = nStringLen; i++ ) npDistance[i] = i * nDelR0; } else if ( cpPattern[0] == '*' bpPatIsWild[0] ) { -// statt einem '*' ist alles einsetzbar +// instead of a '*' you can fit in anything for ( sal_Int32 i=0; i = nStringLen; i++ ) npDistance[i] = 0; } @@ -125,11 +124,11 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) int nP; c = cpPattern[0]; if ( c == '?' bpPatIsWild[0] ) -nP = 0; // ein '?' kann jedes Zeichen sein +nP = 0; // a '?' could be any character. else -// Minimum von Ersetzen und Loeschen+Einfuegen Gewichtung +// Minimum replace and delete +insert weighting nP = Min3( nRepP0, nRepP0, nDelR0 + nInsQ0 ); -npDistance[0] = nInsQ0; // mit einfachem Einfuegen geht's los +npDistance[0] = nInsQ0; // start with simple insert npDistance[1] = nInsQ0; npDistance[2] = nInsQ0; int nReplacePos = -1; // tristate flag @@ -137,22 +136,22 @@ int WLevDistance::WLD( const sal_Unicode* cString, sal_Int32 nStringLen ) for ( sal_Int32 i=1; i = nStringLen; i++, nDelCnt += nDelR0 ) { if ( cString[i-1] == c ) -nP = 0; // Replace ab dieser Stelle ist 0 -// Loeschungen um auf Pattern zu kommen + Replace +nP = 0; // Replace from this postion with 0 +// Deletion to determine the Pattern + Replace npDistance[i] = nDelCnt + nP; if ( bSplitCount ) { if ( nReplacePos 0 nP ) -{ // diese Stelle wird ersetzt +{ // this Postion will be replaced nRepS++; nReplacePos = i; } else if ( nReplacePos 0 !nP ) { - // gleiche Anzahl c + // same count c
[Libreoffice-commits] core.git: unotools/qa
unotools/qa/unit/testGetEnlishSearchName.cxx | 29 +-- 1 file changed, 19 insertions(+), 10 deletions(-) New commits: commit a1d51bf9aa9742eede83ae016360381c5c0e Author: Michael Jaumann meta_...@yahoo.com Date: Tue Sep 9 08:58:52 2014 + fdo#82854 extended unit-tests Conflicts: unotools/qa/unit/testGetEnlishSearchName.cxx Change-Id: Ie721cbc275998b37a4f6206079d55734b85308b0 Reviewed-on: https://gerrit.libreoffice.org/11348 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/unotools/qa/unit/testGetEnlishSearchName.cxx b/unotools/qa/unit/testGetEnlishSearchName.cxx index 1701215..06ffcef 100644 --- a/unotools/qa/unit/testGetEnlishSearchName.cxx +++ b/unotools/qa/unit/testGetEnlishSearchName.cxx @@ -28,27 +28,36 @@ public: }; void Test::setUp() -{}; +{ +} void Test::testSingleElement() { { // lowercase OUString test1 = GetEnglishSearchFontName( SYMBOL ); -CPPUNIT_ASSERT_EQUAL(test1, OUString(symbol)); -// trailingWhitespaces +CPPUNIT_ASSERT_EQUAL( OUString(symbol),test1); +//trailingWhitespaces test1 = GetEnglishSearchFontName( Symbol ); -CPPUNIT_ASSERT_EQUAL(test1, OUString(symbol)); -// removing Skripts +CPPUNIT_ASSERT_EQUAL(OUString(symbol),test1); +//removing Skripts test1 = GetEnglishSearchFontName( Symbol(skript) ); -CPPUNIT_ASSERT_EQUAL(test1, OUString(symbol)); -// remove Whitespaces between +CPPUNIT_ASSERT_EQUAL(OUString(symbol),test1); +//remove Whitespaces between test1 = GetEnglishSearchFontName( Symbol (skript) ); -CPPUNIT_ASSERT_EQUAL(test1, OUString(symbol)); -// trailingWhitespaces +CPPUNIT_ASSERT_EQUAL( OUString(symbol),test1); +//remove special characters; leave semicolon, numbers +test1 = GetEnglishSearchFontName( sy;mb?=ol129 ); +CPPUNIT_ASSERT_EQUAL( OUString(sy;mbol129),test1); + +//transformation + +sal_Unicode const transfor[] ={ 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o','n',0}; + +test1 = GetEnglishSearchFontName(transfor ); +CPPUNIT_ASSERT_EQUAL( OUString(hiraginomarugothicpron),test1); } } - CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Michael Jaumann license statement
Hi, all my current and past contributions made to the LibreOffice project may be licensed under the MPLv2/LGPLv3+ dual license. Until further notice, all my future contributions to the LibreOffice project are available under the MPLv2/LGPLv3+ dual license. Best regards, Michael Jaumann___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Statement
Hi, all my current and past contributions made to the LibreOffice project may be licensed under the MPLv2/LGPLv3+ dual license. Until further notice, all my future contributions to the LibreOffice project are available under the MPLv2/LGPLv3+ dual license. Best regards, Michael Jaumann___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice