You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/02/05 15:16:19 UTC
svn commit: r1442597 [1/3] - in /openoffice/branches/alg/sysdepgs/main:
basegfx/inc/basegfx/polygon/ basegfx/inc/basegfx/tools/ basegfx/prj/
basegfx/source/polygon/ basegfx/source/tools/ drawinglayer/
drawinglayer/inc/drawinglayer/processor2d/ drawingl...
Author: alg
Date: Tue Feb 5 14:16:19 2013
New Revision: 1442597
URL: http://svn.apache.org/viewvc?rev=1442597&view=rev
Log:
First basic changes to get a start
Added:
openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cacheable.hxx (with props)
openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cmanager.hxx (with props)
openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/cmanager.cxx (with props)
openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/win_pixelprocessor2d.hxx (with props)
openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/win_pixelprocessor2d.cxx (with props)
openoffice/branches/alg/sysdepgs/main/vcl/inc/win/gdiplusobjectbuffer.hxx (with props)
Modified:
openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
openoffice/branches/alg/sysdepgs/main/basegfx/prj/d.lst
openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolygon.cxx
openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolypolygon.cxx
openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/makefile.mk
openoffice/branches/alg/sysdepgs/main/drawinglayer/Library_drawinglayer.mk
openoffice/branches/alg/sysdepgs/main/drawinglayer/Package_inc.mk
openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/processor2dtools.cxx
openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
openoffice/branches/alg/sysdepgs/main/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
openoffice/branches/alg/sysdepgs/main/vcl/inc/vcl/svapp.hxx
openoffice/branches/alg/sysdepgs/main/vcl/inc/win/salbmp.h
openoffice/branches/alg/sysdepgs/main/vcl/inc/win/saldata.hxx
openoffice/branches/alg/sysdepgs/main/vcl/win/source/app/salinst.cxx
openoffice/branches/alg/sysdepgs/main/vcl/win/source/gdi/salbmp.cxx
openoffice/branches/alg/sysdepgs/main/vcl/win/source/gdi/salgdi_gdiplus.cxx
Modified: openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolygon.hxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolygon.hxx (original)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolygon.hxx Tue Feb 5 14:16:19 2013
@@ -42,6 +42,10 @@ namespace basegfx
class B2DCubicBezier;
} // end of namespace basegfx
+#ifdef WNT
+namespace basegfx { namespace cache { class cacheable; }}
+#endif
+
//////////////////////////////////////////////////////////////////////////////
namespace basegfx
@@ -262,6 +266,10 @@ namespace basegfx
const B2DPoint* end() const;
B2DPoint* begin();
B2DPoint* end();
+
+#ifdef WNT
+ basegfx::cache::cacheable& getCacheable() const;
+#endif
};
// typedef for a vector of B2DPolygons
Modified: openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx (original)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx Tue Feb 5 14:16:19 2013
@@ -37,6 +37,10 @@ namespace basegfx
class B2DHomMatrix;
} // end of namespace basegfx
+#ifdef WNT
+namespace basegfx { namespace cache { class cacheable; }}
+#endif
+
//////////////////////////////////////////////////////////////////////////////
namespace basegfx
@@ -127,6 +131,10 @@ namespace basegfx
const B2DPolygon* end() const;
B2DPolygon* begin();
B2DPolygon* end();
+
+#ifdef WNT
+ basegfx::cache::cacheable& getCacheable() const;
+#endif
};
// typedef for a vector of B2DPolyPolygons
Added: openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cacheable.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cacheable.hxx?rev=1442597&view=auto
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cacheable.hxx (added)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cacheable.hxx Tue Feb 5 14:16:19 2013
@@ -0,0 +1,77 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _BGFX_CACHE_CACHEABLE_HXX
+#define _BGFX_CACHE_CACHEABLE_HXX
+
+#include <sal/types.h>
+#include <basegfx/tools/cmanager.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace cache
+ {
+ // helper class to allow caching of a c++ object with tooling. To
+ // be able to use this, the object you want to cache needs to be derived
+ // from this tooling class. It just adds a pointer for managing purposes,
+ // but needs no virtuality and only this include file. For more info on how
+ // to cache these objects, see the coc::cmanager and node
+ // clases in the same namespace (normally in the file coc_manager.hxx in
+ // the same dir as this file)
+ class cacheable
+ {
+ private:
+ friend class cmanager;
+ friend class node;
+
+ // the managing data node
+ node* mpNode;
+
+ // access for manager and node
+ void setNode(node* pNew) { mpNode = pNew; }
+ const node* getNode() const { return mpNode; }
+
+ protected:
+ // call this always when the original data changes, will remove
+ // all evtl. cached instances
+ void onChange() { if(mpNode) delete mpNode; mpNode = 0; }
+
+ public:
+ // constructor/destructor/copy constructor; do *not* copy pointer to
+ // managing data node
+ cacheable() : mpNode(0) {}
+ ~cacheable() { if(mpNode) delete mpNode; }
+ cacheable(const cacheable& /*rCacheable*/) : mpNode(0) {}
+
+ // assigment operator; do *not* copy managing data node
+ cacheable& operator=(const cacheable& /*rCacheable*/) { mpNode = 0; return *this; }
+ };
+ } // end of namespace cache
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _BGFX_CACHE_CACHEABLE_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
Propchange: openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cacheable.hxx
------------------------------------------------------------------------------
svn:executable = *
Added: openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cmanager.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cmanager.hxx?rev=1442597&view=auto
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cmanager.hxx (added)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cmanager.hxx Tue Feb 5 14:16:19 2013
@@ -0,0 +1,152 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _BGFX_CACHE_MANAGER_HXX
+#define _BGFX_CACHE_MANAGER_HXX
+
+#include <sal/types.h>
+#include <comphelper/broadcasthelper.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace cache
+ {
+ class node;
+ class cacheable;
+
+ // the manager part to allow caching of any c++ object derived from the helper class
+ // cacheable, see this calss in the same namespace. normally in file
+ // cacheable.hxx in the same dir as this file.
+ // An object derived from cacheable can be cached with this manager class. It
+ // will allow you to access cached entries using getEntry() which also resets the
+ // lifetime counter if found. If not found the cached object should be incarnated and
+ // added to the cache.
+ // This mechanism uses the helper class node where the management is done. It
+ // implements basic mechanisms for organizing this.
+ // to use this, you need to derive own classes from cmanager and from node.
+ //
+ // On the cmanager derivation:
+ // - react on the cache being empty by overloading (onEmpty())
+ // - react on getting the first element by overloading (onFilled())
+ // - test if there are cached instances using empty()
+ // - try to get a cached entry using getEntry()
+ // - trigger the lifetime counter using trigger() which will remove
+ // cached objects with zero count (probably timer based)
+ // - implement a access method to your cached data type using getEntry().
+ // When you get one, it's the cached instance. If not, construct your
+ // instance of node (it will be added automatically) and return it
+ //
+ // On the node derivation:
+ // - Add a data entry to hold the cached data
+ // - Implement creating that data from the original cached object in the
+ // constructor
+ // - destroy it in the destuctor
+ //
+ // To access your cached instance, you can use getEntry() at the manager instance
+ // which may return the cached entry or a newly created one. On that instance,
+ // access your cached data.
+ // The insertion to manager, access to the instance and the removal at lifetime
+ // end are all linear operations.
+ // Usage examples would e.g. derive from cmanager and the Timer calss in sal,
+ // call trigger in the overloaded timer callback and switch the timer on/off
+ // in overlods of onEmpty()/onFilled(). I will use it to e.g. cache Widows-specific
+ // data creatatble from system-independent bitmap data.
+ class cmanager : protected comphelper::OBaseMutex
+ {
+ private:
+ friend class node;
+
+ sal_uInt32 mnLifetime;
+ node* mpNodes;
+
+ void removeNode(node& rNode);
+ void insertNode(node& rNode);
+
+ protected:
+ public:
+ // constructor allows to give lifetime count for newly
+ // added cached objects
+ cmanager(sal_uInt32 nLifetime = 60);
+ virtual ~cmanager();
+
+ // react on last cached object removed
+ virtual void onEmpty();
+
+ // react on first cached object added
+ virtual void onFilled();
+
+ // ask if objects are cached
+ bool empty() const { return 0 == mpNodes; }
+
+ // flush all cached objects (delete them)
+ void flush();
+
+ // try to access entry
+ const node* getEntry(const cacheable& rCacheable);
+
+ // decrease lifetime, delete cached objects which
+ // rech zero
+ void trigger();
+
+ // return default lifetime
+ sal_uInt32 getLifetime() const { return mnLifetime; }
+ };
+ } // end of namespace cache
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace cache
+ {
+ class node
+ {
+ private:
+ friend class cmanager;
+ friend class cacheable;
+
+ node* mpNext;
+ node* mpPrev;
+
+ cmanager& mrManager;
+ const cacheable& mrCacheable;
+
+ sal_uInt32 mnLifetime;
+
+ protected:
+ public:
+ node(cmanager& rManager, const cacheable& rCacheable);
+ virtual ~node();
+
+ void touch();
+ };
+ } // end of namespace cache
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _BGFX_CACHE_MANAGER_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
Propchange: openoffice/branches/alg/sysdepgs/main/basegfx/inc/basegfx/tools/cmanager.hxx
------------------------------------------------------------------------------
svn:executable = *
Modified: openoffice/branches/alg/sysdepgs/main/basegfx/prj/d.lst
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/prj/d.lst?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/prj/d.lst (original)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/prj/d.lst Tue Feb 5 14:16:19 2013
@@ -90,7 +90,8 @@ mkdir: %_DEST%\inc%_EXT%\basegfx\tuple
..\inc\basegfx\tuple\b3i64tuple.hxx %_DEST%\inc%_EXT%\basegfx\tuple\b3i64tuple.hxx
mkdir: %_DEST%\inc%_EXT%\basegfx\tools
-..\inc\basegfx\tools\canvastools.hxx %_DEST%\inc%_EXT%\basegfx\tools\canvastools.hxx
+..\inc\basegfx\tools\cacheable.hxx %_DEST%\inc%_EXT%\basegfx\tools\cacheable.hxx
+..\inc\basegfx\tools\cmanager.hxx %_DEST%\inc%_EXT%\basegfx\tools\cmanager.hxx
..\inc\basegfx\tools\keystoplerp.hxx %_DEST%\inc%_EXT%\basegfx\tools\keystoplerp.hxx
..\inc\basegfx\tools\lerp.hxx %_DEST%\inc%_EXT%\basegfx\tools\lerp.hxx
..\inc\basegfx\tools\unopolypolygon.hxx %_DEST%\inc%_EXT%\basegfx\tools\unopolypolygon.hxx
Modified: openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolygon.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolygon.cxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolygon.cxx (original)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolygon.cxx Tue Feb 5 14:16:19 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basegfx.hxx"
#include <osl/diagnose.h>
@@ -35,6 +33,10 @@
#include <vector>
#include <algorithm>
+#ifdef WNT
+#include <basegfx/tools/cacheable.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
struct CoordinateData2D : public basegfx::B2DPoint
@@ -614,6 +616,9 @@ public:
//////////////////////////////////////////////////////////////////////////////
class ImplB2DPolygon
+#ifdef WNT
+ : public basegfx::cache::cacheable
+#endif
{
private:
// The point vector. This vector exists always and defines the
@@ -630,6 +635,22 @@ private:
// flag which decides if this polygon is opened or closed
bool mbIsClosed;
+ void ensureBufferedData()
+ {
+ if(!mpBufferedData)
+ {
+ mpBufferedData.reset(new ImplBufferedData);
+ }
+ }
+
+ void changed()
+ {
+ mpBufferedData.reset();
+#ifdef WNT
+ onChange();
+#endif
+ }
+
public:
const basegfx::B2DPolygon& getDefaultAdaptiveSubdivision(const basegfx::B2DPolygon& rSource) const
{
@@ -638,20 +659,14 @@ public:
return rSource;
}
- if(!mpBufferedData)
- {
- const_cast< ImplB2DPolygon* >(this)->mpBufferedData.reset(new ImplBufferedData);
- }
+ const_cast< ImplB2DPolygon* >(this)->ensureBufferedData();
return mpBufferedData->getDefaultAdaptiveSubdivision(rSource);
}
const basegfx::B2DRange& getB2DRange(const basegfx::B2DPolygon& rSource) const
{
- if(!mpBufferedData)
- {
- const_cast< ImplB2DPolygon* >(this)->mpBufferedData.reset(new ImplBufferedData);
- }
+ const_cast< ImplB2DPolygon* >(this)->ensureBufferedData();
return mpBufferedData->getB2DRange(rSource);
}
@@ -661,7 +676,8 @@ public:
mpControlVector(),
mpBufferedData(),
mbIsClosed(false)
- {}
+ {
+ }
ImplB2DPolygon(const ImplB2DPolygon& rToBeCopied)
: maPoints(rToBeCopied.maPoints),
@@ -688,7 +704,9 @@ public:
mpControlVector.reset( new ControlVectorArray2D(*rToBeCopied.mpControlVector, nIndex, nCount) );
if(!mpControlVector->isUsed())
+ {
mpControlVector.reset();
+ }
}
}
@@ -696,13 +714,16 @@ public:
{
maPoints = rToBeCopied.maPoints;
mpControlVector.reset();
- mpBufferedData.reset();
+ changed();
mbIsClosed = rToBeCopied.mbIsClosed;
// complete initialization using copy
if(rToBeCopied.mpControlVector && rToBeCopied.mpControlVector->isUsed())
+ {
mpControlVector.reset( new ControlVectorArray2D(*rToBeCopied.mpControlVector) );
+ }
+ changed();
return *this;
}
@@ -720,8 +741,8 @@ public:
{
if(bNew != mbIsClosed)
{
- mpBufferedData.reset();
- mbIsClosed = bNew;
+ changed();
+ mbIsClosed = bNew;
}
}
@@ -771,7 +792,7 @@ public:
void setPoint(sal_uInt32 nIndex, const basegfx::B2DPoint& rValue)
{
- mpBufferedData.reset();
+ changed();
maPoints.setCoordinate(nIndex, rValue);
}
@@ -782,7 +803,7 @@ public:
void append(const basegfx::B2DPoint& rPoint)
{
- mpBufferedData.reset(); // TODO: is this needed?
+ changed();
const CoordinateData2D aCoordinate(rPoint);
maPoints.append(aCoordinate);
@@ -797,7 +818,7 @@ public:
{
if(nCount)
{
- mpBufferedData.reset();
+ changed();
CoordinateData2D aCoordinate(rPoint);
maPoints.insert(nIndex, aCoordinate, nCount);
@@ -827,18 +848,20 @@ public:
{
if(!rValue.equalZero())
{
- mpBufferedData.reset();
+ changed();
mpControlVector.reset( new ControlVectorArray2D(maPoints.count()) );
mpControlVector->setPrevVector(nIndex, rValue);
}
}
else
{
- mpBufferedData.reset();
+ changed();
mpControlVector->setPrevVector(nIndex, rValue);
if(!mpControlVector->isUsed())
+ {
mpControlVector.reset();
+ }
}
}
@@ -860,18 +883,20 @@ public:
{
if(!rValue.equalZero())
{
- mpBufferedData.reset();
+ changed();
mpControlVector.reset( new ControlVectorArray2D(maPoints.count()) );
mpControlVector->setNextVector(nIndex, rValue);
}
}
else
{
- mpBufferedData.reset();
+ changed();
mpControlVector->setNextVector(nIndex, rValue);
if(!mpControlVector->isUsed())
+ {
mpControlVector.reset();
+ }
}
}
@@ -888,7 +913,7 @@ public:
void resetControlVectors()
{
- mpBufferedData.reset();
+ changed();
mpControlVector.reset();
}
@@ -900,7 +925,7 @@ public:
void appendBezierSegment(const basegfx::B2DVector& rNext, const basegfx::B2DVector& rPrev, const basegfx::B2DPoint& rPoint)
{
- mpBufferedData.reset();
+ changed();
const sal_uInt32 nCount(maPoints.count());
if(nCount)
@@ -918,7 +943,7 @@ public:
if(nCount)
{
- mpBufferedData.reset();
+ changed();
if(rSource.mpControlVector && rSource.mpControlVector->isUsed() && !mpControlVector)
{
@@ -932,7 +957,9 @@ public:
mpControlVector->insert(nIndex, *rSource.mpControlVector);
if(!mpControlVector->isUsed())
+ {
mpControlVector.reset();
+ }
}
else if(mpControlVector)
{
@@ -946,7 +973,7 @@ public:
{
if(nCount)
{
- mpBufferedData.reset();
+ changed();
maPoints.remove(nIndex, nCount);
if(mpControlVector)
@@ -954,7 +981,9 @@ public:
mpControlVector->remove(nIndex, nCount);
if(!mpControlVector->isUsed())
+ {
mpControlVector.reset();
+ }
}
}
}
@@ -963,7 +992,7 @@ public:
{
if(maPoints.count() > 1)
{
- mpBufferedData.reset();
+ changed();
// flip points
maPoints.flip(mbIsClosed);
@@ -1026,7 +1055,7 @@ public:
// Only remove DoublePoints at Begin and End when poly is closed
if(mbIsClosed)
{
- mpBufferedData.reset();
+ changed();
if(mpControlVector)
{
@@ -1079,7 +1108,7 @@ public:
void removeDoublePointsWholeTrack()
{
- mpBufferedData.reset();
+ changed();
if(mpControlVector)
{
@@ -1127,43 +1156,46 @@ public:
void transform(const basegfx::B2DHomMatrix& rMatrix)
{
- mpBufferedData.reset();
-
- if(mpControlVector)
- {
- for(sal_uInt32 a(0); a < maPoints.count(); a++)
- {
- basegfx::B2DPoint aCandidate = maPoints.getCoordinate(a);
+ if(!rMatrix.isIdentity())
+ {
+ changed();
- if(mpControlVector->isUsed())
- {
- const basegfx::B2DVector& rPrevVector(mpControlVector->getPrevVector(a));
- const basegfx::B2DVector& rNextVector(mpControlVector->getNextVector(a));
+ if(mpControlVector)
+ {
+ for(sal_uInt32 a(0); a < maPoints.count(); a++)
+ {
+ basegfx::B2DPoint aCandidate = maPoints.getCoordinate(a);
+
+ if(mpControlVector->isUsed())
+ {
+ const basegfx::B2DVector& rPrevVector(mpControlVector->getPrevVector(a));
+ const basegfx::B2DVector& rNextVector(mpControlVector->getNextVector(a));
- if(!rPrevVector.equalZero())
- {
- basegfx::B2DVector aPrevVector(rMatrix * rPrevVector);
- mpControlVector->setPrevVector(a, aPrevVector);
- }
-
- if(!rNextVector.equalZero())
- {
- basegfx::B2DVector aNextVector(rMatrix * rNextVector);
- mpControlVector->setNextVector(a, aNextVector);
- }
- }
+ if(!rPrevVector.equalZero())
+ {
+ basegfx::B2DVector aPrevVector(rMatrix * rPrevVector);
+ mpControlVector->setPrevVector(a, aPrevVector);
+ }
+
+ if(!rNextVector.equalZero())
+ {
+ basegfx::B2DVector aNextVector(rMatrix * rNextVector);
+ mpControlVector->setNextVector(a, aNextVector);
+ }
+ }
+
+ aCandidate *= rMatrix;
+ maPoints.setCoordinate(a, aCandidate);
+ }
- aCandidate *= rMatrix;
- maPoints.setCoordinate(a, aCandidate);
- }
-
- if(!mpControlVector->isUsed())
- mpControlVector.reset();
- }
- else
- {
- maPoints.transform(rMatrix);
- }
+ if(!mpControlVector->isUsed())
+ mpControlVector.reset();
+ }
+ else
+ {
+ maPoints.transform(rMatrix);
+ }
+ }
}
const basegfx::B2DPoint* begin() const
@@ -1178,13 +1210,13 @@ public:
basegfx::B2DPoint* begin()
{
- mpBufferedData.reset();
+ changed();
return maPoints.begin();
}
basegfx::B2DPoint* end()
{
- mpBufferedData.reset();
+ changed();
return maPoints.end();
}
};
@@ -1198,6 +1230,13 @@ namespace basegfx
struct DefaultPolygon: public rtl::Static<B2DPolygon::ImplType, DefaultPolygon> {};
}
+#ifdef WNT
+ basegfx::cache::cacheable& B2DPolygon::getCacheable() const
+ {
+ return const_cast< ImplB2DPolygon& >(*mpPolygon);
+ }
+#endif
+
B2DPolygon::B2DPolygon()
: mpPolygon(DefaultPolygon::get())
{}
Modified: openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolypolygon.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolypolygon.cxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolypolygon.cxx (original)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/source/polygon/b2dpolypolygon.cxx Tue Feb 5 14:16:19 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basegfx.hxx"
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -34,12 +32,27 @@
#include <vector>
#include <algorithm>
+#ifdef WNT
+#include <basegfx/tools/cacheable.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
class ImplB2DPolyPolygon
+#ifdef WNT
+ : public basegfx::cache::cacheable
+#endif
{
+private:
basegfx::B2DPolygonVector maPolygons;
+ void changed()
+ {
+#ifdef WNT
+ onChange();
+#endif
+ }
+
public:
ImplB2DPolyPolygon() : maPolygons()
{
@@ -70,6 +83,7 @@ public:
void setB2DPolygon(sal_uInt32 nIndex, const basegfx::B2DPolygon& rPolygon)
{
+ changed();
maPolygons[nIndex] = rPolygon;
}
@@ -81,6 +95,7 @@ public:
basegfx::B2DPolygonVector::iterator aIndex(maPolygons.begin());
aIndex += nIndex;
maPolygons.insert(aIndex, nCount, rPolygon);
+ changed();
}
}
@@ -100,6 +115,8 @@ public:
aIndex = maPolygons.insert(aIndex, rPolyPolygon.getB2DPolygon(a));
aIndex++;
}
+
+ changed();
}
}
@@ -113,6 +130,7 @@ public:
const basegfx::B2DPolygonVector::iterator aEnd(aStart + nCount);
maPolygons.erase(aStart, aEnd);
+ changed();
}
}
@@ -127,6 +145,8 @@ public:
{
maPolygons[a].setClosed(bNew);
}
+
+ changed();
}
void flip()
@@ -134,6 +154,7 @@ public:
std::for_each( maPolygons.begin(),
maPolygons.end(),
std::mem_fun_ref( &basegfx::B2DPolygon::flip ));
+ changed();
}
void removeDoublePoints()
@@ -141,14 +162,20 @@ public:
std::for_each( maPolygons.begin(),
maPolygons.end(),
std::mem_fun_ref( &basegfx::B2DPolygon::removeDoublePoints ));
+ changed();
}
void transform(const basegfx::B2DHomMatrix& rMatrix)
{
- for(sal_uInt32 a(0L); a < maPolygons.size(); a++)
- {
- maPolygons[a].transform(rMatrix);
- }
+ if(!rMatrix.isIdentity())
+ {
+ for(sal_uInt32 a(0L); a < maPolygons.size(); a++)
+ {
+ maPolygons[a].transform(rMatrix);
+ }
+
+ changed();
+ }
}
void makeUnique()
@@ -198,6 +225,13 @@ namespace basegfx
namespace { struct DefaultPolyPolygon: public rtl::Static<B2DPolyPolygon::ImplType,
DefaultPolyPolygon> {}; }
+#ifdef WNT
+ basegfx::cache::cacheable& B2DPolyPolygon::getCacheable() const
+ {
+ return const_cast< ImplB2DPolyPolygon& >(*mpPolyPolygon);
+ }
+#endif
+
B2DPolyPolygon::B2DPolyPolygon() :
mpPolyPolygon(DefaultPolyPolygon::get())
{
Added: openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/cmanager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/cmanager.cxx?rev=1442597&view=auto
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/cmanager.cxx (added)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/cmanager.cxx Tue Feb 5 14:16:19 2013
@@ -0,0 +1,188 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_basegfx.hxx"
+
+#include <osl/diagnose.h>
+#include <basegfx/tools/cmanager.hxx>
+#include <basegfx/tools/cacheable.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace cache
+ {
+ void cmanager::removeNode(node& rNode)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ if(mpNodes == &rNode)
+ {
+ mpNodes = rNode.mpNext;
+ }
+
+ if(rNode.mpPrev)
+ {
+ rNode.mpPrev->mpNext = rNode.mpNext;
+ }
+
+ if(rNode.mpNext)
+ {
+ rNode.mpNext->mpPrev = rNode.mpPrev;
+ }
+
+ rNode.mpNext = rNode.mpPrev = 0;
+
+ if(!mpNodes)
+ {
+ onEmpty();
+ }
+ }
+
+ void cmanager::insertNode(node& rNode)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ rNode.mpNext = rNode.mpPrev = 0;
+
+ if(mpNodes)
+ {
+ rNode.mpNext = mpNodes;
+
+ if(mpNodes->mpPrev)
+ {
+ mpNodes->mpPrev->mpNext = &rNode;
+ }
+
+ rNode.mpPrev = mpNodes->mpPrev;
+ mpNodes->mpPrev = &rNode;
+ }
+
+ bool bWasEmpty(0 == mpNodes);
+
+ mpNodes = &rNode;
+
+ if(bWasEmpty)
+ {
+ onFilled();
+ }
+ }
+
+ cmanager::cmanager(sal_uInt32 nLifetime)
+ : mnLifetime(nLifetime),
+ mpNodes(0)
+ {
+ }
+
+ cmanager::~cmanager()
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ while(mpNodes)
+ {
+ delete mpNodes;
+ }
+ }
+
+ void cmanager::onEmpty()
+ {
+ }
+
+ void cmanager::onFilled()
+ {
+ }
+
+ const node* cmanager::getEntry(const cacheable& rCacheable)
+ {
+ return rCacheable.getNode();
+ }
+
+ void cmanager::trigger()
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ node* pCurr = mpNodes;
+
+ while(pCurr)
+ {
+ if(pCurr->mnLifetime)
+ {
+ pCurr->mnLifetime--;
+ pCurr = pCurr->mpNext;
+ }
+ else
+ {
+ node* pNext = pCurr->mpNext;
+ delete pCurr;
+ pCurr = pNext;
+ }
+ }
+ }
+
+ void cmanager::flush()
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ while(mpNodes)
+ {
+ delete mpNodes;
+ }
+ }
+ } // end of namespace cache
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////?
+
+namespace basegfx
+{
+ namespace cache
+ {
+ node::node(cmanager& rManager, const cacheable& rCacheable)
+ : mpNext(0),
+ mpPrev(0),
+ mrManager(rManager),
+ mrCacheable(rCacheable),
+ mnLifetime(rManager.getLifetime())
+ {
+ if(mrCacheable.getNode())
+ {
+ OSL_ENSURE(false, "OOps, instance is already buffered (!)");
+ }
+
+ const_cast< cacheable& >(mrCacheable).setNode(this);
+ mrManager.insertNode(*this);
+ }
+
+ node::~node()
+ {
+ const_cast< cacheable& >(mrCacheable).setNode(0);
+ mrManager.removeNode(*this);
+ }
+
+ void node::touch()
+ {
+ mnLifetime = mrManager.getLifetime();
+ }
+ } // end of namespace cache
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
Propchange: openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/cmanager.cxx
------------------------------------------------------------------------------
svn:executable = *
Modified: openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/makefile.mk?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/makefile.mk (original)
+++ openoffice/branches/alg/sysdepgs/main/basegfx/source/tools/makefile.mk Tue Feb 5 14:16:19 2013
@@ -34,6 +34,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= $(SLO)$/b2dclipstate.obj \
+ $(SLO)$/cmanager.obj \
$(SLO)$/canvastools.obj \
$(SLO)$/gradienttools.obj \
$(SLO)$/debugplotter.obj \
Modified: openoffice/branches/alg/sysdepgs/main/drawinglayer/Library_drawinglayer.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/Library_drawinglayer.mk?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/Library_drawinglayer.mk (original)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/Library_drawinglayer.mk Tue Feb 5 14:16:19 2013
@@ -62,6 +62,18 @@ $(eval $(call gb_Library_add_linked_libs
$(gb_STDLIBS) \
))
+ifeq ($(OS),WNT)
+
+$(eval $(call gb_Library_add_exception_objects,drawinglayer,\
+ drawinglayer/source/processor2d/win_pixelprocessor2d \
+))
+
+$(eval $(call gb_Library_add_linked_libs,drawinglayer,\
+ gdiplus \
+))
+
+endif
+
$(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/animation/animationtiming \
drawinglayer/source/attribute/fillgradientattribute \
Modified: openoffice/branches/alg/sysdepgs/main/drawinglayer/Package_inc.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/Package_inc.mk?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/Package_inc.mk (original)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/Package_inc.mk Tue Feb 5 14:16:19 2013
@@ -110,7 +110,6 @@ $(eval $(call gb_Package_add_file,drawin
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/objectinfoextractor2d.hxx,drawinglayer/processor2d/objectinfoextractor2d.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/baseprocessor3d.hxx,drawinglayer/processor3d/baseprocessor3d.hxx))
-$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/defaultprocessor3d.hxx,drawinglayer/processor3d/defaultprocessor3d.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/cutfindprocessor3d.hxx,drawinglayer/processor3d/cutfindprocessor3d.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/geometry2dextractor.hxx,drawinglayer/processor3d/geometry2dextractor.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/shadow3dextractor.hxx,drawinglayer/processor3d/shadow3dextractor.hxx))
Modified: openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx (original)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx Tue Feb 5 14:16:19 2013
@@ -19,14 +19,15 @@
*
*************************************************************/
-
-
#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLPIXELPROCESSOR2D_HXX
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/processor2d/vclprocessor2d.hxx>
-#include <vcl/outdev.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class OutputDevice;
//////////////////////////////////////////////////////////////////////////////
@@ -44,7 +45,7 @@ namespace drawinglayer
{
private:
protected:
- /* the local processor for BasePrinitive2D-Implementation based primitives,
+ /** the local processor for BasePrinitive2D-Implementation based primitives,
called from the common process()-implementation
*/
virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
Modified: openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx (original)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx Tue Feb 5 14:16:19 2013
@@ -29,6 +29,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/color/bcolormodifier.hxx>
#include <svtools/optionsdrawinglayer.hxx>
+#include <vector>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -71,9 +72,10 @@ namespace drawinglayer
*/
class VclProcessor2D : public BaseProcessor2D
{
- protected:
- // the destination OutDev
+ private:
+ // the destination OutDev and the stack of OutputDevices
OutputDevice* mpOutputDevice;
+ std::vector< OutputDevice* > mnOutputDevices;
// the modifiedColorPrimitive stack
basegfx::BColorModifierStack maBColorModifierStack;
@@ -88,11 +90,30 @@ namespace drawinglayer
// stack value (increment and decrement) to count how deep we are in
// PolygonStrokePrimitive2D's decompositions (normally only one)
- sal_uInt32 mnPolygonStrokePrimitive2D;
+ sal_uInt32 mnPolygonStrokePrimitive2DCounter;
- //////////////////////////////////////////////////////////////////////////////
- // common VCL rendering support
+ protected:
+ //////////////////////////////////////////////////////////////////////////////
+ // tooling
+ void pushOutputDevice(OutputDevice& rNew);
+ void popOutputDevice();
+ OutputDevice& getOutputDevice() const { OSL_ENSURE(0 != mpOutputDevice, "0 == mpOutputDevice (!)"); return *mpOutputDevice; }
+
+ // access to transformation stack
+ const basegfx::B2DHomMatrix& getCurrentTransformation() const { return maCurrentTransformation; }
+ void setCurrentTransformation(const basegfx::B2DHomMatrix& rNew) { maCurrentTransformation = rNew; }
+
+ // access to color modifyer stack
+ basegfx::BColorModifierStack& getBColorModifierStack() { return maBColorModifierStack; }
+
+ // access to counter to manage depth of fat line sub-usings
+ sal_uInt32& getPolygonStrokePrimitive2DCounter() { return mnPolygonStrokePrimitive2DCounter; }
+ // access to Drawinglayer configuration options
+ const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // common VCL rendering support
void RenderTextSimpleOrDecoratedPortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
void RenderPolygonHairlinePrimitive2D(const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased);
void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
@@ -123,9 +144,6 @@ namespace drawinglayer
const geometry::ViewInformation2D& rViewInformation,
OutputDevice& rOutDev);
virtual ~VclProcessor2D();
-
- // access to Drawinglayer configuration options
- const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
};
} // end of namespace processor2d
} // end of namespace drawinglayer
Added: openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/win_pixelprocessor2d.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/win_pixelprocessor2d.hxx?rev=1442597&view=auto
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/win_pixelprocessor2d.hxx (added)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/win_pixelprocessor2d.hxx Tue Feb 5 14:16:19 2013
@@ -0,0 +1,228 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_WIN_PIXELPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_WIN_PIXELPROCESSOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
+#include <tools/svwin.h>
+#include <vector>
+
+#ifndef min
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef max
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+
+#include <GdiPlus.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class OutputDevice;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** Win_PixelProcessor2D class
+
+ This processor derived from BaseProcessor2D is the base class for rendering
+ system-dependent on Win, using GDI+ for now
+ */
+ class Win_PixelProcessor2D : public BaseProcessor2D
+ {
+ private:
+ // the OutputDevice started with
+ OutputDevice& mrOutDev;
+
+ // the current Gdiplus::Graphics and the stack
+ Gdiplus::Graphics* mpGraphics;
+ std::vector< Gdiplus::Graphics* > maGraphics;
+
+ // the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ // the current transformation. Since VCL pixel renderer transforms to pixels
+ // and VCL MetaFile renderer to World (logic) coordinates, the local
+ // ViewInformation2D cannot directly be used, but needs to be kept up to date
+ basegfx::B2DHomMatrix maCurrentTransformation;
+
+ // SvtOptionsDrawinglayer incarnation to react on diverse settings
+ const SvtOptionsDrawinglayer maDrawinglayerOpt;
+
+ protected:
+ //////////////////////////////////////////////////////////////////////////////
+ // tooling
+ void pushGraphics(Gdiplus::Graphics& rNew);
+ void popGraphics();
+ Gdiplus::Graphics& getGraphics() const { OSL_ENSURE(0 != mpGraphics, "0 == mpGraphics (!)"); return *mpGraphics; }
+
+ // access to transformation stack
+ const basegfx::B2DHomMatrix& getCurrentTransformation() const { return maCurrentTransformation; }
+ void setCurrentTransformation(const basegfx::B2DHomMatrix& rNew) { maCurrentTransformation = rNew; }
+
+ // access to color modifyer stack
+ basegfx::BColorModifierStack& getBColorModifierStack() { return maBColorModifierStack; }
+
+ // access to Drawinglayer configuration options
+ const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // the local processor for BasePrinitive2D-Implementation based primitives,
+ // called from the common process()-implementation
+ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ /// constructor/destructor
+ Win_PixelProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ OutputDevice& rOutDev);
+ virtual ~Win_PixelProcessor2D();
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_WIN_PIXELPROCESSOR2D_HXX
+
+// eof
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_WIN_PIXELPROCESSOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_WIN_PIXELPROCESSOR2D_HXX
+
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolormodifier.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
+#include <tools/svwin.h>
+#include <vector>
+
+#ifndef min
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef max
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+
+#include <GdiPlus.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+class OutputDevice;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** Win_PixelProcessor2D class
+
+ This processor derived from BaseProcessor2D is the base class for rendering
+ system-dependent on Win, using GDI+ for now
+ */
+ class Win_PixelProcessor2D : public BaseProcessor2D
+ {
+ private:
+ // the OutputDevice started with
+ OutputDevice& mrOutDev;
+
+ // the current Gdiplus::Graphics and the stack
+ Gdiplus::Graphics* mpGraphics;
+ std::vector< Gdiplus::Graphics* > maGraphics;
+
+ // the modifiedColorPrimitive stack
+ basegfx::BColorModifierStack maBColorModifierStack;
+
+ // the current transformation. Since VCL pixel renderer transforms to pixels
+ // and VCL MetaFile renderer to World (logic) coordinates, the local
+ // ViewInformation2D cannot directly be used, but needs to be kept up to date
+ basegfx::B2DHomMatrix maCurrentTransformation;
+
+ // SvtOptionsDrawinglayer incarnation to react on diverse settings
+ const SvtOptionsDrawinglayer maDrawinglayerOpt;
+
+ protected:
+ //////////////////////////////////////////////////////////////////////////////
+ // tooling
+ void pushGraphics(Gdiplus::Graphics& rNew);
+ void popGraphics();
+ Gdiplus::Graphics& getGraphics() const { OSL_ENSURE(0 != mpGraphics, "0 == mpGraphics (!)"); return *mpGraphics; }
+
+ // access to transformation stack
+ const basegfx::B2DHomMatrix& getCurrentTransformation() const { return maCurrentTransformation; }
+ void setCurrentTransformation(const basegfx::B2DHomMatrix& rNew) { maCurrentTransformation = rNew; }
+
+ // access to color modifyer stack
+ basegfx::BColorModifierStack& getBColorModifierStack() { return maBColorModifierStack; }
+
+ // access to Drawinglayer configuration options
+ const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // the local processor for BasePrinitive2D-Implementation based primitives,
+ // called from the common process()-implementation
+ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+
+ public:
+ /// constructor/destructor
+ Win_PixelProcessor2D(
+ const geometry::ViewInformation2D& rViewInformation,
+ OutputDevice& rOutDev);
+ virtual ~Win_PixelProcessor2D();
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_WIN_PIXELPROCESSOR2D_HXX
+
+// eof
Propchange: openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor2d/win_pixelprocessor2d.hxx
------------------------------------------------------------------------------
svn:executable = *
Modified: openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx (original)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx Tue Feb 5 14:16:19 2013
@@ -25,7 +25,8 @@
#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
#include <drawinglayer/drawinglayerdllapi.h>
-#include <drawinglayer/processor3d/defaultprocessor3d.hxx>
+#include <drawinglayer/processor3d/baseprocessor3d.hxx>
+#include <basegfx/matrix/b3dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
Modified: openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/processor2dtools.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/processor2dtools.cxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/processor2dtools.cxx (original)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/processor2dtools.cxx Tue Feb 5 14:16:19 2013
@@ -25,6 +25,11 @@
#include <drawinglayer/processor2d/processor2dtools.hxx>
#include <drawinglayer/processor2d/vclpixelprocessor2d.hxx>
#include <drawinglayer/processor2d/vclmetafileprocessor2d.hxx>
+#include <vcl/outdev.hxx>
+
+#ifdef WNT
+#include <drawinglayer/processor2d/win_pixelprocessor2d.hxx>
+#endif
//////////////////////////////////////////////////////////////////////////////
@@ -40,6 +45,16 @@ namespace drawinglayer
OutputDevice& rTargetOutDev,
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
{
+#ifdef WNT
+ static bool bTestDirectRenderer(false);
+
+ if(bTestDirectRenderer)
+ {
+ // create Win-dependent PilxelProcessor
+ return new Win_PixelProcessor2D(rViewInformation2D, rTargetOutDev);
+ }
+#endif
+
// create Pixel Vcl-Processor
return new VclPixelProcessor2D(rViewInformation2D, rTargetOutDev);
}
Modified: openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx?rev=1442597&r1=1442596&r2=1442597&view=diff
==============================================================================
--- openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx (original)
+++ openoffice/branches/alg/sysdepgs/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx Tue Feb 5 14:16:19 2013
@@ -233,30 +233,30 @@ namespace drawinglayer
GDIMetaFile& o_rContentMetafile)
{
// Prepare VDev, MetaFile and connections
- OutputDevice* pLastOutputDevice = mpOutputDevice;
+ OutputDevice& rLastOutputDevice = getOutputDevice();
GDIMetaFile* pLastMetafile = mpMetaFile;
basegfx::B2DRange aPrimitiveRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D()));
// transform primitive range with current transformation (e.g shadow offset)
- aPrimitiveRange.transform(maCurrentTransformation);
+ aPrimitiveRange.transform(getCurrentTransformation());
const Rectangle aPrimitiveRectangle(
basegfx::fround(aPrimitiveRange.getMinX()), basegfx::fround(aPrimitiveRange.getMinY()),
basegfx::fround(aPrimitiveRange.getMaxX()), basegfx::fround(aPrimitiveRange.getMaxY()));
VirtualDevice aContentVDev;
- MapMode aNewMapMode(pLastOutputDevice->GetMapMode());
+ MapMode aNewMapMode(rLastOutputDevice.GetMapMode());
- mpOutputDevice = &aContentVDev;
+ pushOutputDevice(aContentVDev);
mpMetaFile = &o_rContentMetafile;
aContentVDev.EnableOutput(false);
- aContentVDev.SetMapMode(pLastOutputDevice->GetMapMode());
+ aContentVDev.SetMapMode(rLastOutputDevice.GetMapMode());
o_rContentMetafile.Record(&aContentVDev);
- aContentVDev.SetLineColor(pLastOutputDevice->GetLineColor());
- aContentVDev.SetFillColor(pLastOutputDevice->GetFillColor());
- aContentVDev.SetFont(pLastOutputDevice->GetFont());
- aContentVDev.SetDrawMode(pLastOutputDevice->GetDrawMode());
- aContentVDev.SetSettings(pLastOutputDevice->GetSettings());
- aContentVDev.SetRefPoint(pLastOutputDevice->GetRefPoint());
+ aContentVDev.SetLineColor(rLastOutputDevice.GetLineColor());
+ aContentVDev.SetFillColor(rLastOutputDevice.GetFillColor());
+ aContentVDev.SetFont(rLastOutputDevice.GetFont());
+ aContentVDev.SetDrawMode(rLastOutputDevice.GetDrawMode());
+ aContentVDev.SetSettings(rLastOutputDevice.GetSettings());
+ aContentVDev.SetRefPoint(rLastOutputDevice.GetRefPoint());
// dump to MetaFile
process(rContent);
@@ -267,7 +267,7 @@ namespace drawinglayer
aNewMapMode.SetOrigin(aPrimitiveRectangle.TopLeft());
o_rContentMetafile.SetPrefMapMode(aNewMapMode);
o_rContentMetafile.SetPrefSize(aPrimitiveRectangle.GetSize());
- mpOutputDevice = pLastOutputDevice;
+ popOutputDevice();
mpMetaFile = pLastMetafile;
return aPrimitiveRectangle;
@@ -287,8 +287,8 @@ namespace drawinglayer
else
{
// use color modifier to influence start/end color of gradient
- o_rVCLGradient.SetStartColor(Color(maBColorModifierStack.getModifiedColor(rFiGrAtt.getStartColor())));
- o_rVCLGradient.SetEndColor(Color(maBColorModifierStack.getModifiedColor(rFiGrAtt.getEndColor())));
+ o_rVCLGradient.SetStartColor(Color(getBColorModifierStack().getModifiedColor(rFiGrAtt.getStartColor())));
+ o_rVCLGradient.SetEndColor(Color(getBColorModifierStack().getModifiedColor(rFiGrAtt.getEndColor())));
}
o_rVCLGradient.SetAngle(static_cast< sal_uInt16 >(rFiGrAtt.getAngle() * (1.0 / F_PI1800)));
@@ -380,12 +380,12 @@ namespace drawinglayer
}
else if(pLineAttribute)
{
- aStrokeColor = maBColorModifierStack.getModifiedColor(pLineAttribute->getColor());
+ aStrokeColor = getBColorModifierStack().getModifiedColor(pLineAttribute->getColor());
}
// It IS needed to record the stroke color at all in the metafile,
// SvtGraphicStroke has NO entry for stroke color(!)
- mpOutputDevice->SetLineColor(Color(aStrokeColor));
+ getOutputDevice().SetLineColor(Color(aStrokeColor));
if(!rB2DPolygon.isClosed())
{
@@ -421,8 +421,8 @@ namespace drawinglayer
if(pLineAttribute)
{
- // pre-fill fLineWidth #119198# Need to apply maCurrentTransformation, too (!)
- const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(pLineAttribute->getWidth(), 0.0));
+ // pre-fill fLineWidth #119198# Need to apply getCurrentTransformation(), too (!)
+ const basegfx::B2DVector aDiscreteUnit(getCurrentTransformation() * basegfx::B2DVector(pLineAttribute->getWidth(), 0.0));
fLineWidth = aDiscreteUnit.getLength();
// pre-fill fMiterLength
@@ -492,9 +492,9 @@ namespace drawinglayer
// add the transformation to SvtGraphicStroke and to handle it there
basegfx::B2DPolygon aB2DPolygon(rB2DPolygon);
- aB2DPolygon.transform(maCurrentTransformation);
- aStartArrow.transform(maCurrentTransformation);
- aEndArrow.transform(maCurrentTransformation);
+ aB2DPolygon.transform(getCurrentTransformation());
+ aStartArrow.transform(getCurrentTransformation());
+ aEndArrow.transform(getCurrentTransformation());
pRetval = new SvtGraphicStroke(
Polygon(aB2DPolygon),
@@ -545,9 +545,9 @@ namespace drawinglayer
mpPDFExtOutDevData(dynamic_cast< vcl::PDFExtOutDevData* >(rOutDev.GetExtOutDevData()))
{
OSL_ENSURE(rOutDev.GetConnectMetaFile(), "VclMetafileProcessor2D: Used on OutDev which has no MetaFile Target (!)");
- // draw to logic coordinates, do not initialize maCurrentTransformation to viewTransformation
+ // draw to logic coordinates, do not initialize getCurrentTransformation() to viewTransformation
// but only to ObjectTransformation. Do not change MapMode of destination.
- maCurrentTransformation = rViewInformation.getObjectTransformation();
+ setCurrentTransformation(rViewInformation.getObjectTransformation());
}
VclMetafileProcessor2D::~VclMetafileProcessor2D()
@@ -887,7 +887,7 @@ namespace drawinglayer
pPDFControl->Location = aRectLogic;
Size aFontSize(pPDFControl->TextFont.GetSize());
- aFontSize = mpOutputDevice->LogicToLogic(aFontSize, MapMode(MAP_POINT), mpOutputDevice->GetMapMode());
+ aFontSize = getOutputDevice().LogicToLogic(aFontSize, MapMode(MAP_POINT), getOutputDevice().GetMapMode());
pPDFControl->TextFont.SetSize(aFontSize);
mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::Form);
@@ -915,7 +915,7 @@ namespace drawinglayer
// remember old graphics and create new
uno::Reference< awt::XView > xControlView(rXControl, uno::UNO_QUERY_THROW);
const uno::Reference< awt::XGraphics > xOriginalGraphics(xControlView->getGraphics());
- const uno::Reference< awt::XGraphics > xNewGraphics(mpOutputDevice->CreateUnoGraphics());
+ const uno::Reference< awt::XGraphics > xNewGraphics(getOutputDevice().CreateUnoGraphics());
if(xNewGraphics.is())
{
@@ -1070,14 +1070,14 @@ namespace drawinglayer
// const primitive2d::TextDecoratedPortionPrimitive2D* pTextDecoratedCandidate = dynamic_cast< const primitive2d::TextDecoratedPortionPrimitive2D* >(&rCandidate);
// Adapt evtl. used special DrawMode
- const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode());
+ const sal_uInt32 nOriginalDrawMode(getOutputDevice().GetDrawMode());
adaptTextToFillDrawMode();
// directdraw of text simple portion; use default processing
RenderTextSimpleOrDecoratedPortionPrimitive2D(rTextCandidate);
// restore DrawMode
- mpOutputDevice->SetDrawMode(nOriginalDrawMode);
+ getOutputDevice().SetDrawMode(nOriginalDrawMode);
// #i101169# if(pTextDecoratedCandidate)
{
@@ -1152,7 +1152,7 @@ namespace drawinglayer
{
// direct draw of hairline; use default processing
// support SvtGraphicStroke MetaCommentAction
- const basegfx::BColor aLineColor(maBColorModifierStack.getModifiedColor(rHairlinePrimitive.getBColor()));
+ const basegfx::BColor aLineColor(getBColorModifierStack().getModifiedColor(rHairlinePrimitive.getBColor()));
SvtGraphicStroke* pSvtGraphicStroke = 0;
// #121267# Not needed, does not give better quality compared with
@@ -1227,13 +1227,13 @@ namespace drawinglayer
&aHairLinePolyPolygon, 0, rStroke.getFullDotDashLen());
}
- const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLine.getColor()));
- mpOutputDevice->SetLineColor(Color(aHairlineColor));
- mpOutputDevice->SetFillColor();
- aHairLinePolyPolygon.transform(maCurrentTransformation);
+ const basegfx::BColor aHairlineColor(getBColorModifierStack().getModifiedColor(rLine.getColor()));
+ getOutputDevice().SetLineColor(Color(aHairlineColor));
+ getOutputDevice().SetFillColor();
+ aHairLinePolyPolygon.transform(getCurrentTransformation());
// #i113922# LineWidth needs to be transformed, too
- const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(rLine.getWidth(), 0.0));
+ const basegfx::B2DVector aDiscreteUnit(getCurrentTransformation() * basegfx::B2DVector(rLine.getWidth(), 0.0));
const double fDiscreteLineWidth(aDiscreteUnit.getLength());
LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fDiscreteLineWidth));
@@ -1311,12 +1311,12 @@ namespace drawinglayer
// that lines shall be black; thus change DRAWMODE_WHITEFILL to
// DRAWMODE_BLACKFILL during line geometry processing to have line geometry
// parts filled black.
- const sal_uLong nOldDrawMode(mpOutputDevice->GetDrawMode());
+ const sal_uLong nOldDrawMode(getOutputDevice().GetDrawMode());
const bool bDrawmodeChange(nOldDrawMode & DRAWMODE_WHITEFILL && mnSvtGraphicStrokeCount);
if(bDrawmodeChange)
{
- mpOutputDevice->SetDrawMode((nOldDrawMode & ~DRAWMODE_WHITEFILL) | DRAWMODE_BLACKFILL);
+ getOutputDevice().SetDrawMode((nOldDrawMode & ~DRAWMODE_WHITEFILL) | DRAWMODE_BLACKFILL);
}
// process sub-line geometry (evtl. filled PolyPolygons)
@@ -1324,7 +1324,7 @@ namespace drawinglayer
if(bDrawmodeChange)
{
- mpOutputDevice->SetDrawMode(nOldDrawMode);
+ getOutputDevice().SetDrawMode(nOldDrawMode);
}
// write LineGeometry end marker
@@ -1366,7 +1366,7 @@ namespace drawinglayer
// calculate transformation. Get real object size, all values in FillGraphicAttribute
// are relative to the unified object
- aLocalPolyPolygon.transform(maCurrentTransformation);
+ aLocalPolyPolygon.transform(getCurrentTransformation());
const basegfx::B2DVector aOutlineSize(aLocalPolyPolygon.getB2DRange().getRange());
// the scaling needs scale from pixel to logic coordinate system
@@ -1448,7 +1448,7 @@ namespace drawinglayer
}
SvtGraphicFill* pSvtGraphicFill = 0;
- aLocalPolyPolygon.transform(maCurrentTransformation);
+ aLocalPolyPolygon.transform(getCurrentTransformation());
if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
{
@@ -1514,7 +1514,7 @@ namespace drawinglayer
attribute::HATCHSTYLE_DOUBLE == rFillHatchAttribute.getStyle() ? HATCH_DOUBLE :
HATCH_TRIPLE);
- mpOutputDevice->DrawHatch(aToolsPolyPolygon,
+ getOutputDevice().DrawHatch(aToolsPolyPolygon,
Hatch(aHatchStyle,
Color(rFillHatchAttribute.getColor()),
basegfx::fround(rFillHatchAttribute.getDistance()),
@@ -1529,7 +1529,7 @@ namespace drawinglayer
basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
- maCurrentTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
+ getCurrentTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
if(!basegfx::fTools::equalZero(fRotate) || !basegfx::fTools::equalZero(fShearX))
{
@@ -1567,7 +1567,7 @@ namespace drawinglayer
// re-create a VCL-gradient from FillGradientPrimitive2D and the needed tools PolyPolygon
Gradient aVCLGradient;
impConvertFillGradientAttributeToVCLGradient(aVCLGradient, rGradientCandidate.getFillGradient(), false);
- aLocalPolyPolygon.transform(maCurrentTransformation);
+ aLocalPolyPolygon.transform(getCurrentTransformation());
// #i82145# ATM VCL printing of gradients using curved shapes does not work,
// i submitted the bug with the given ID to THB. When that task is fixed it is
@@ -1619,7 +1619,7 @@ namespace drawinglayer
// call VCL directly; encapsulate with SvtGraphicFill
impStartSvtGraphicFill(pSvtGraphicFill);
- mpOutputDevice->DrawGradient(aToolsPolyPolygon, aVCLGradient);
+ getOutputDevice().DrawGradient(aToolsPolyPolygon, aVCLGradient);
impEndSvtGraphicFill(pSvtGraphicFill);
}
@@ -1635,8 +1635,8 @@ namespace drawinglayer
while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
;
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPolygonCandidate.getBColor()));
- aLocalPolyPolygon.transform(maCurrentTransformation);
+ const basegfx::BColor aPolygonColor(getBColorModifierStack().getModifiedColor(rPolygonCandidate.getBColor()));
+ aLocalPolyPolygon.transform(getCurrentTransformation());
// XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
SvtGraphicFill* pSvtGraphicFill = 0;
@@ -1667,8 +1667,8 @@ namespace drawinglayer
}
// set line and fill color
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
- mpOutputDevice->SetLineColor();
+ getOutputDevice().SetFillColor(Color(aPolygonColor));
+ getOutputDevice().SetLineColor();
// call VCL directly; encapsulate with SvtGraphicFill
if(bSupportSvtGraphicFill)
@@ -1676,7 +1676,7 @@ namespace drawinglayer
impStartSvtGraphicFill(pSvtGraphicFill);
}
- mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
+ getOutputDevice().DrawPolyPolygon(aLocalPolyPolygon);
if(bSupportSvtGraphicFill)
{
@@ -1697,7 +1697,7 @@ namespace drawinglayer
if(aMask.count())
{
// prepare new mask polygon and rescue current one
- aMask.transform(maCurrentTransformation);
+ aMask.transform(getCurrentTransformation());
const basegfx::B2DPolyPolygon aLastClipPolyPolygon(maClipPolyPolygon);
if(maClipPolyPolygon.count())
@@ -1721,8 +1721,8 @@ namespace drawinglayer
// set VCL clip region; subdivide before conversion to tools polygon. Subdivision necessary (!)
// Removed subdivision and fixed in Region::ImplPolyPolyRegionToBandRegionFunc() in VCL where
// the ClipRegion is built from the Polygon. A AdaptiveSubdivide on the source polygon was missing there
- mpOutputDevice->Push(PUSH_CLIPREGION);
- mpOutputDevice->SetClipRegion(Region(maClipPolyPolygon));
+ getOutputDevice().Push(PUSH_CLIPREGION);
+ getOutputDevice().SetClipRegion(Region(maClipPolyPolygon));
// recursively paint content
// #121267# Only need to process sub-content when clip polygon is *not* empty.
@@ -1730,7 +1730,7 @@ namespace drawinglayer
process(rMaskCandidate.getChildren());
// restore VCL clip region
- mpOutputDevice->Pop();
+ getOutputDevice().Pop();
}
// restore to rescued clip polygon
@@ -1759,14 +1759,14 @@ namespace drawinglayer
if(!aInvisibleRange.isEmpty())
{
- aInvisibleRange.transform(maCurrentTransformation);
+ aInvisibleRange.transform(getCurrentTransformation());
const Rectangle aRectLogic(
(sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()),
(sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY()));
- mpOutputDevice->SetFillColor();
- mpOutputDevice->SetLineColor();
- mpOutputDevice->DrawRect(aRectLogic);
+ getOutputDevice().SetFillColor();
+ getOutputDevice().SetLineColor();
+ getOutputDevice().DrawRect(aRectLogic);
}
break;
@@ -1806,7 +1806,7 @@ namespace drawinglayer
if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
{
// single transparent PolyPolygon identified, use directly
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+ const basegfx::BColor aPolygonColor(getBColorModifierStack().getModifiedColor(pPoPoColor->getBColor()));
basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
@@ -1815,7 +1815,7 @@ namespace drawinglayer
;
// now transform
- aLocalPolyPolygon.transform(maCurrentTransformation);
+ aLocalPolyPolygon.transform(getCurrentTransformation());
// XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
SvtGraphicFill* pSvtGraphicFill = 0;
@@ -1847,8 +1847,8 @@ namespace drawinglayer
// set line and fill color
const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 100.0));
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
- mpOutputDevice->SetLineColor();
+ getOutputDevice().SetFillColor(Color(aPolygonColor));
+ getOutputDevice().SetLineColor();
// call VCL directly; encapsulate with SvtGraphicFill
if(bSupportSvtGraphicFill)
@@ -1856,7 +1856,7 @@ namespace drawinglayer
impStartSvtGraphicFill(pSvtGraphicFill);
}
- mpOutputDevice->DrawTransparent(
+ getOutputDevice().DrawTransparent(
PolyPolygon(aLocalPolyPolygon),
nTransPercentVcl);
@@ -1900,7 +1900,7 @@ namespace drawinglayer
aVCLGradient.SetSteps(2);
// render it to VCL
- mpOutputDevice->DrawTransparent(
+ getOutputDevice().DrawTransparent(
aContentMetafile, aPrimitiveRectangle.TopLeft(),
aPrimitiveRectangle.GetSize(), aVCLGradient);
}
@@ -1946,7 +1946,7 @@ namespace drawinglayer
impConvertFillGradientAttributeToVCLGradient(aVCLGradient, pFiGradient->getFillGradient(), true);
// render it to VCL
- mpOutputDevice->DrawTransparent(
+ getOutputDevice().DrawTransparent(
aContentMetafile, aPrimitiveRectangle.TopLeft(),
aPrimitiveRectangle.GetSize(), aVCLGradient);
}
@@ -1966,11 +1966,11 @@ namespace drawinglayer
// refine to tiling here.
basegfx::B2DRange aViewRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D()));
- aViewRange.transform(maCurrentTransformation);
+ aViewRange.transform(getCurrentTransformation());
const Rectangle aRectLogic(
(sal_Int32)floor(aViewRange.getMinX()), (sal_Int32)floor(aViewRange.getMinY()),
(sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY()));
- const Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
+ const Rectangle aRectPixel(getOutputDevice().LogicToPixel(aRectLogic));
Size aSizePixel(aRectPixel.GetSize());
const Point aEmptyPoint;
VirtualDevice aBufferDevice;
@@ -1989,16 +1989,16 @@ namespace drawinglayer
if(aBufferDevice.SetOutputSizePixel(aSizePixel))
{
// create and set MapModes for target devices
- MapMode aNewMapMode(mpOutputDevice->GetMapMode());
+ MapMode aNewMapMode(getOutputDevice().GetMapMode());
aNewMapMode.SetOrigin(Point(-aRectLogic.Left(), -aRectLogic.Top()));
aBufferDevice.SetMapMode(aNewMapMode);
// prepare view transformation for target renderers
// ATTENTION! Need to apply another scaling because of the potential DPI differences
- // between Printer and VDev (mpOutputDevice and aBufferDevice here).
+ // between Printer and VDev (getOutputDevice() and aBufferDevice here).
// To get the DPI, LogicToPixel from (1,1) from MAP_INCH needs to be used.
basegfx::B2DHomMatrix aViewTransform(aBufferDevice.GetViewTransformation());
- const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MAP_INCH));
+ const Size aDPIOld(getOutputDevice().LogicToPixel(Size(1, 1), MAP_INCH));
const Size aDPINew(aBufferDevice.LogicToPixel(Size(1, 1), MAP_INCH));
const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth());
const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight());
@@ -2046,7 +2046,7 @@ namespace drawinglayer
#endif
// paint
- mpOutputDevice->DrawBitmapEx(
+ getOutputDevice().DrawBitmapEx(
aRectLogic.TopLeft(),
aRectLogic.GetSize(),
BitmapEx(aBmContent, aBmAlpha));