[Libreoffice-commits] core.git: cppcanvas/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 5 11:34:26 UTC 2018


 cppcanvas/source/mtfrenderer/textaction.cxx |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 8abe2d0ff1d87f1db406ab9367a6ee7edb6d234d
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Fri Nov 2 22:49:54 2018 +0800
Commit:     Mark Hung <marklh9 at gmail.com>
CommitDate: Mon Nov 5 12:33:27 2018 +0100

    tdf#37636: pass bNormalText to cppcanvas::internal::TextRenderer.
    
    so that we know whether we are rendering a normal text or othewise
    (like shadow, etc.) because it is not necessary to use the textline
    color or overline color when rendering the shadow.
    
    Change-Id: I51c21bbb4e3cec226320b46e2cdba4cd5e8792d6
    Reviewed-on: https://gerrit.libreoffice.org/62831
    Tested-by: Jenkins
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index 3784d435b086..b43f691e931b 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -476,7 +476,7 @@ namespace cppcanvas
                 virtual ~TextRenderer() {}
 
                 /// Render text with given RenderState
-                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const = 0;
+                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const = 0;
             };
 
             /** Render effect text.
@@ -514,7 +514,7 @@ namespace cppcanvas
                         vcl::unotools::colorToDoubleSequence( rShadowColor,
                                                                 xColorSpace );
 
-                    rRenderer( aShadowState, rTextFillColor );
+                    rRenderer( aShadowState, rTextFillColor, false );
                 }
 
                 // draw relief text, if enabled
@@ -532,11 +532,11 @@ namespace cppcanvas
                         vcl::unotools::colorToDoubleSequence( rReliefColor,
                                                                 xColorSpace );
 
-                    rRenderer( aReliefState, rTextFillColor );
+                    rRenderer( aReliefState, rTextFillColor, false );
                 }
 
                 // draw normal text
-                rRenderer( rRenderState, rTextFillColor );
+                rRenderer( rRenderState, rTextFillColor, true );
 
                 return true;
             }
@@ -789,7 +789,7 @@ namespace cppcanvas
 
             private:
                 /// Interface TextRenderer
-                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override;
+                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const override;
 
                 geometry::RealRectangle2D queryTextBounds() const;
                 css::uno::Reference<css::rendering::XPolyPolygon2D> queryTextBounds(const uno::Reference<rendering::XCanvas>& rCanvas) const;
@@ -895,7 +895,7 @@ namespace cppcanvas
                                   "::cppcanvas::internal::EffectTextAction(): Invalid font or lines" );
             }
 
-            bool EffectTextAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const
+            bool EffectTextAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool /*bNormalText*/ ) const
             {
                 const rendering::ViewState& rViewState( mpCanvas->getViewState() );
                 const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() );
@@ -1246,7 +1246,7 @@ namespace cppcanvas
 
             private:
                 // TextRenderer interface
-                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override;
+                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const override;
 
                 css::uno::Reference<css::rendering::XPolyPolygon2D> queryTextBounds(const uno::Reference<rendering::XCanvas>& rCanvas) const;
 
@@ -1369,7 +1369,7 @@ namespace cppcanvas
                 return ::basegfx::unotools::xPolyPolygonFromB2DPolygon(rCanvas->getDevice(), aTextBoundsPoly);
             }
 
-            bool EffectTextArrayAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const
+            bool EffectTextArrayAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool /*bNormalText*/ ) const
             {
                 const rendering::ViewState& rViewState( mpCanvas->getViewState() );
                 const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() );
@@ -1429,7 +1429,7 @@ namespace cppcanvas
                 }
 
                 // TextRenderer interface
-                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override
+                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor,bool /*bNormalText*/ ) const override
                 {
                     mrCanvas->fillPolyPolygon( mrLinePolygon,
                                                mrViewState,
@@ -1635,7 +1635,7 @@ namespace cppcanvas
 
             private:
                 // TextRenderer interface
-                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor ) const override;
+                virtual bool operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText ) const override;
 
                 // TODO(P2): This is potentially a real mass object
                 // (every character might be a separate TextAction),
@@ -1765,7 +1765,7 @@ namespace cppcanvas
                       rTextTransform );
             }
 
-            bool OutlineAction::operator()( const rendering::RenderState& rRenderState, const ::Color& /*rTextFillColor*/ ) const
+            bool OutlineAction::operator()( const rendering::RenderState& rRenderState, const ::Color& /*rTextFillColor*/, bool /*bNormalText*/ ) const
             {
                 const rendering::ViewState&                 rViewState( mpCanvas->getViewState() );
                 const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() );


More information about the Libreoffice-commits mailing list