summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorHerbert Duerr [hdu] <herbert.duerr@oracle.com>2010-11-30 13:45:26 +0100
committerHerbert Duerr [hdu] <herbert.duerr@oracle.com>2010-11-30 13:45:26 +0100
commit608fc9264df96ec7f17bd39ca1c35639a23dee4d (patch)
tree0ee3118a9287a9a203526182c18cbbc8109ba7b8 /canvas
parent0e761aa2e71ac701e746ccac94e67ee25d2c6bd8 (diff)
#i96685# removed not-yet active code to help comment+deadcode removing devs
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx67
1 files changed, 9 insertions, 58 deletions
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 52ab4e2d8f0a..b1d1f331781b 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -211,6 +211,8 @@ namespace vclcanvas
if( (rColors.size() % 2) != (nStepCount % 2) )
++nStepCount;
+ rOutDev.SetLineColor();
+
basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
// only iterate nStepCount-1 steps, as the last strip is
@@ -366,60 +368,10 @@ namespace vclcanvas
// color).
++nStepCount;
- basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
-
rOutDev.SetLineColor();
-#if 0 // draw gradients using overlapping b2dpolygon painting, TODO: use gradient methods directly
- if( !bFillNonOverlapping && rOutDev.supportsOperation( OutDevSupport_B2DDraw ) )
- {
- ::basegfx::B2DPolygon aB2DTempPoly = aInnerPoly;
-
- // fill background
- rOutDev.SetFillColor( rColors.front() );
- rOutDev.DrawRect( rBounds );
-
- // render polygon
- // ==============
- for( unsigned int i=1,p; i<nStepCount; ++i )
- {
- const double fT( i/double(nStepCount) );
-
- std::ptrdiff_t nIndex;
- double fAlpha;
- boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(fT);
-
- // lerp color
- rOutDev.SetFillColor(
- Color( (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
- (UINT8)(basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
-
- // scale and render polygon, by interpolating between
- // outer and inner polygon.
-
- for( p=0; p<nNumPoints; ++p )
- {
- const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
- const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
-
- aB2DTempPoly.setB2DPoint( p, ::basegfx::B2DPoint(
- fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX(),
- fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
- }
-
- // close polygon explicitely
- //aTempPoly[(USHORT)p] = aTempPoly[0];
+ basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
- // TODO(P1): compare with vcl/source/gdi/outdev4.cxx,
- // OutputDevice::ImplDrawComplexGradient(), there's a note
- // that on some VDev's, rendering disjunct poly-polygons
- // is faster!
- rOutDev.DrawPolygon( aB2DTempPoly );
- }
- } else
-#endif
- // draw gradients using overlapping tools::polygon painting
if( !bFillNonOverlapping )
{
// fill background
@@ -428,6 +380,7 @@ namespace vclcanvas
// render polygon
// ==============
+
for( unsigned int i=1,p; i<nStepCount; ++i )
{
const double fT( i/double(nStepCount) );
@@ -465,7 +418,7 @@ namespace vclcanvas
rOutDev.DrawPolygon( aTempPoly );
}
}
- else // draw gradients using non-overlapping tools::polygon painting
+ else
{
// render polygon
// ==============
@@ -668,8 +621,8 @@ namespace vclcanvas
p2ndOutDev->Pop();
}
}
-#if 1 // use complex clipping directly if available
- else if( rOutDev.supportsOperation( OutDevSupport_B2DClip ) )
+ else
+#if defined(QUARTZ) // TODO: other ports should avoid the XOR-trick too (implementation vs. interface!)
{
const Region aPolyClipRegion( rPoly );
@@ -699,9 +652,7 @@ namespace vclcanvas
p2ndOutDev->Pop();
}
}
-#endif // using complex clipping directly
-#if 1 // fall back to complex clipping using the XOR-trick
- else // TODO: remove when no longer needed
+#else // TODO: remove once doing the XOR-trick in the canvas-layer becomes redundant
{
// output gradient the hard way: XORing out the polygon
rOutDev.Push( PUSH_RASTEROP );
@@ -751,7 +702,7 @@ namespace vclcanvas
p2ndOutDev->Pop();
}
}
-#endif // XOR-trick for complex clipping
+#endif // complex-clipping vs. XOR-trick
#if 0 //defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
{