include/tools/poly.hxx         |    2 ++
 include/vcl/outdev.hxx         |    3 ---
 tools/source/generic/poly.cxx  |   12 ++++++++++++
 tools/source/generic/poly2.cxx |   11 +++++++++++
 vcl/Library_vcl.mk             |    1 -
 vcl/source/outdev/bezier.cxx   |   41 -----------------------------------------
 vcl/source/outdev/polygon.cxx  |    6 +++---
 vcl/source/outdev/polyline.cxx |   19 ++-----------------
 8 files changed, 30 insertions(+), 65 deletions(-)

New commits:
commit c1bc990aa5fd2a40191dae9683db7b0cd3e9a0d0
Author: Chris Sherlock <chris.sherloc...@gmail.com>
Date:   Thu Apr 17 02:03:23 2014 +1000

    No need for vcl/source/outdev/bezier.cxx any more
    
    Change-Id: Ie3c401b5f40972999f45da7d2c4b8ed732454af0

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 7c8b3eb..72285c5 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -236,7 +236,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/gdi/oldprintadaptor \
     vcl/source/outdev/outdev \
     vcl/source/outdev/tworect \
-    vcl/source/outdev/bezier \
     vcl/source/outdev/polygon \
     vcl/source/outdev/transparent \
     vcl/source/outdev/blend \
diff --git a/vcl/source/outdev/bezier.cxx b/vcl/source/outdev/bezier.cxx
deleted file mode 100644
index 5046f65..0000000
--- a/vcl/source/outdev/bezier.cxx
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- 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 <vcl/outdev.hxx>
-#include <tools/poly.hxx>
commit 97ce12cd2ef1805a68d210dd41ab2ae3371a8d06
Author: Chris Sherlock <chris.sherloc...@gmail.com>
Date:   Thu Apr 17 02:01:20 2014 +1000

    Remove commented out code in polyline.cxx
    
    Change-Id: I400d38ccb2e87c6435bc767c13a52beb62baa435

diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx
index b9da23e..97dab0f 100644
--- a/vcl/source/outdev/polyline.cxx
+++ b/vcl/source/outdev/polyline.cxx
@@ -234,21 +234,6 @@ void OutputDevice::ImplDrawPolyLineWithLineInfo(const 
Polygon& rPoly, const Line
 
     Polygon aPoly = ImplLogicToDevicePixel( rPoly );
 
-    // #100127# LineInfo is not curve-safe, subdivide always
-
-    // What shall this mean? It's wrong to subdivide here when the
-    // polygon is a fat line. In that case, the painted geometry
-    // WILL be much different.
-    // I also have no idea how this could be related to the given ID
-    // which reads 'consolidate boost versions' in the task description.
-    // Removing.
-
-    //if( aPoly.HasFlags() )
-    //{
-    //    aPoly = ImplSubdivideBezier( aPoly );
-    //    nPoints = aPoly.GetSize();
-    //}
-
     // we need a graphics
     if ( !mpGraphics && !ImplGetGraphics() )
         return;
commit 2024224a4ee351841f50a6f7b8a267f605a17096
Author: Chris Sherlock <chris.sherloc...@gmail.com>
Date:   Thu Apr 17 01:45:58 2014 +1000

    Move bezier functions
    
    Move ImplSubdivideBezier(Polygon) to Polygon as a static function.
    Move ImplSubdivideBezier(PolyPolygon) to PolyPolygon as a static function.
    
    Change-Id: I0d006a8a2d3a8d9ba1aec913ceecb38507e4dd2f

diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index 5f5171c..dbfb94da 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -156,6 +156,7 @@ public:
         pixel.
      */
     void                AdaptiveSubdivide( Polygon& rResult, const double d = 
1.0 ) const;
+    static Polygon      SubdivideBezier( const Polygon& rPoly );
 
     void                Move( long nHorzMove, long nVertMove );
     void                Translate( const Point& rTrans );
@@ -242,6 +243,7 @@ public:
         pixel.
      */
     void                AdaptiveSubdivide( PolyPolygon& rResult, const double 
d = 1.0 ) const;
+    static PolyPolygon  SubdivideBezier( const PolyPolygon& rPolyPoly );
 
     void                GetIntersection( const PolyPolygon& rPolyPoly, 
PolyPolygon& rResult ) const;
     void                GetUnion( const PolyPolygon& rPolyPoly, PolyPolygon& 
rResult ) const;
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 6b19451..420fe44 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -275,9 +275,6 @@ typedef ::std::vector< VCLXGraphics* > 
VCLXGraphicsList_impl;
 
 const char* ImplDbgCheckOutputDevice( const void* pObj );
 
-Polygon ImplSubdivideBezier( const Polygon& rPoly );
-PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly );
-
 sal_uLong ImplAdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix );
 void ImplAdjustTwoRect( SalTwoRect& rTwoRect, const Rectangle& rValidSrcRect );
 
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index c237795..f9a23a9 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -277,6 +277,18 @@ void ImplPolygon::ImplCreateFlagArray()
     }
 }
 
+
+Polygon Polygon::SubdivideBezier( const Polygon& rPoly )
+{
+    Polygon aPoly;
+
+    // #100127# Use adaptive subdivide instead of fixed 25 segments
+    rPoly.AdaptiveSubdivide( aPoly );
+
+    return aPoly;
+}
+
+
 inline void Polygon::ImplMakeUnique()
 {
     // copy references if any exist
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index 3804cdb..4bff362 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -295,6 +295,17 @@ void PolyPolygon::AdaptiveSubdivide( PolyPolygon& rResult, 
const double d ) cons
     }
 }
 
+PolyPolygon PolyPolygon::SubdivideBezier( const PolyPolygon& rPolyPoly )
+{
+    sal_uInt16 i, nPolys = rPolyPoly.Count();
+    PolyPolygon aPolyPoly( nPolys );
+    for( i=0; i<nPolys; ++i )
+        aPolyPoly.Insert( Polygon::SubdivideBezier( rPolyPoly.GetObject(i) ) );
+
+    return aPolyPoly;
+}
+
+
 void PolyPolygon::GetIntersection( const PolyPolygon& rPolyPoly, PolyPolygon& 
rResult ) const
 {
     ImplDoOperation( rPolyPoly, rResult, POLY_CLIP_INT );
diff --git a/vcl/source/outdev/bezier.cxx b/vcl/source/outdev/bezier.cxx
index f60eb57..5046f65 100644
--- a/vcl/source/outdev/bezier.cxx
+++ b/vcl/source/outdev/bezier.cxx
@@ -19,23 +19,3 @@
 
 #include <vcl/outdev.hxx>
 #include <tools/poly.hxx>
-
-Polygon ImplSubdivideBezier( const Polygon& rPoly )
-{
-    Polygon aPoly;
-
-    // #100127# Use adaptive subdivide instead of fixed 25 segments
-    rPoly.AdaptiveSubdivide( aPoly );
-
-    return aPoly;
-}
-
-PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly )
-{
-    sal_uInt16 i, nPolys = rPolyPoly.Count();
-    PolyPolygon aPolyPoly( nPolys );
-    for( i=0; i<nPolys; ++i )
-        aPolyPoly.Insert( ImplSubdivideBezier( rPolyPoly.GetObject(i) ) );
-
-    return aPolyPoly;
-}
diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index 312625d..7402675 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -219,7 +219,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
         const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
         if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, this ) )
         {
-            aPoly = ImplSubdivideBezier(aPoly);
+            aPoly = Polygon::SubdivideBezier(aPoly);
             pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
             mpGraphics->DrawPolygon( aPoly.GetSize(), pPtAry, this );
         }
@@ -373,7 +373,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, 
const PolyPolygon& rPo
         {
             if( !mpGraphics->DrawPolygonBezier( *pPointAry, *pPointAryAry, 
*pFlagAryAry, this ) )
             {
-                Polygon aPoly = ImplSubdivideBezier( rPolyPoly.GetObject( last 
) );
+                Polygon aPoly = Polygon::SubdivideBezier( rPolyPoly.GetObject( 
last ) );
                 mpGraphics->DrawPolygon( aPoly.GetSize(), (const 
SalPoint*)aPoly.GetConstPointAry(), this );
             }
         }
@@ -389,7 +389,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, 
const PolyPolygon& rPo
         {
             if( !mpGraphics->DrawPolyPolygonBezier( j, pPointAry, 
pPointAryAry, pFlagAryAry, this ) )
             {
-                PolyPolygon aPolyPoly = ImplSubdivideBezier( rPolyPoly );
+                PolyPolygon aPolyPoly = PolyPolygon::SubdivideBezier( 
rPolyPoly );
                 ImplDrawPolyPolygon( aPolyPoly.Count(), aPolyPoly );
             }
         }
diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx
index 2669337..b9da23e 100644
--- a/vcl/source/outdev/polyline.cxx
+++ b/vcl/source/outdev/polyline.cxx
@@ -87,7 +87,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
         const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry();
         if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) )
         {
-            aPoly = ImplSubdivideBezier(aPoly);
+            aPoly = Polygon::SubdivideBezier(aPoly);
             pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
             mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, this );
         }
@@ -277,7 +277,7 @@ void OutputDevice::ImplDrawPolyLineWithLineInfo(const 
Polygon& rPoly, const Line
         // NO way to find out there that it's a curve.
         if( aPoly.HasFlags() )
         {
-            aPoly = ImplSubdivideBezier( aPoly );
+            aPoly = Polygon::SubdivideBezier( aPoly );
             nPoints = aPoly.GetSize();
         }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to