Kaydet (Commit) 385bb454 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Caolán McNamara

Resolves: #i120604# unified and secured gradient tooling for primitives

(cherry picked from commit 05785d28)

Conflicts:
	basegfx/inc/basegfx/tools/gradienttools.hxx
	basegfx/source/tools/gradienttools.cxx
	cppcanvas/source/mtfrenderer/implrenderer.cxx
	drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
	drawinglayer/inc/drawinglayer/texture/texture.hxx
	drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
	drawinglayer/source/processor2d/vclhelpergradient.cxx

Change-Id: I21f94e7b4eede094171a83a009ae19213e77f22c

Unname unused argument to prevent warnings.

(cherry picked from commit f7d4af83)

Change-Id: I44381f1e417c39dfbd1d4051079bbd09f0c61848
üst 0de49e5d
......@@ -1030,20 +1030,20 @@ namespace cppcanvas
basegfx::B2DRange aBoundsRectangle (0, 0, 1, 1);
if (brush->type == 4) {
aGradientService = "LinearGradient";
basegfx::tools::createLinearODFGradientInfo( aGradInfo,
aGradInfo = basegfx::tools::createLinearODFGradientInfo(
aBoundsRectangle,
aStops.getLength(),
0,
0 );
0);
} else {
aGradientService = "EllipticalGradient";
basegfx::tools::createEllipticalODFGradientInfo( aGradInfo,
aGradInfo = basegfx::tools::createEllipticalODFGradientInfo(
aBoundsRectangle,
::basegfx::B2DVector( 0, 0 ),
aStops.getLength(),
0,
0 );
0);
}
uno::Reference< lang::XMultiServiceFactory > xFactory(
......
......@@ -676,14 +676,14 @@ namespace cppcanvas
switch( rGradient.GetStyle() )
{
case GradientStyle_LINEAR:
basegfx::tools::createLinearODFGradientInfo(aGradInfo,
aGradInfo = basegfx::tools::createLinearODFGradientInfo(
aBounds,
nSteps,
fBorder,
fRotation);
// map ODF to svg gradient orientation - x
// instead of y direction
aGradInfo.maTextureTransform = aGradInfo.maTextureTransform * aRot90;
aGradInfo.setTextureTransform(aGradInfo.getTextureTransform() * aRot90);
aGradientService = "LinearGradient";
break;
......@@ -702,27 +702,27 @@ namespace cppcanvas
// border value, hence the second (left
// most 1-...
const double fAxialBorder (1-2*(1-fBorder));
basegfx::tools::createAxialODFGradientInfo(aGradInfo,
aGradInfo = basegfx::tools::createAxialODFGradientInfo(
aBounds,
nSteps,
fAxialBorder,
fRotation);
// map ODF to svg gradient orientation - x
// instead of y direction
aGradInfo.maTextureTransform = aGradInfo.maTextureTransform * aRot90;
aGradInfo.setTextureTransform(aGradInfo.getTextureTransform() * aRot90);
// map ODF axial gradient to 3-stop linear
// gradient - shift left by 0.5
basegfx::B2DHomMatrix aShift;
aShift.translate(-0.5,0);
aGradInfo.maTextureTransform = aGradInfo.maTextureTransform * aShift;
aShift.translate(-0.5,0);
aGradInfo.setTextureTransform(aGradInfo.getTextureTransform() * aShift);
aGradientService = "LinearGradient";
break;
}
case GradientStyle_RADIAL:
basegfx::tools::createRadialODFGradientInfo(aGradInfo,
aGradInfo = basegfx::tools::createRadialODFGradientInfo(
aBounds,
aOffset,
nSteps,
......@@ -731,7 +731,7 @@ namespace cppcanvas
break;
case GradientStyle_ELLIPTICAL:
basegfx::tools::createEllipticalODFGradientInfo(aGradInfo,
aGradInfo = basegfx::tools::createEllipticalODFGradientInfo(
aBounds,
aOffset,
nSteps,
......@@ -741,7 +741,7 @@ namespace cppcanvas
break;
case GradientStyle_SQUARE:
basegfx::tools::createSquareODFGradientInfo(aGradInfo,
aGradInfo = basegfx::tools::createSquareODFGradientInfo(
aBounds,
aOffset,
nSteps,
......@@ -751,7 +751,7 @@ namespace cppcanvas
break;
case GradientStyle_RECT:
basegfx::tools::createRectangularODFGradientInfo(aGradInfo,
aGradInfo = basegfx::tools::createRectangularODFGradientInfo(
aBounds,
aOffset,
nSteps,
......@@ -767,7 +767,7 @@ namespace cppcanvas
}
::basegfx::unotools::affineMatrixFromHomMatrix( aTexture.AffineTransform,
aGradInfo.maTextureTransform );
aGradInfo.getTextureTransform() );
uno::Sequence<uno::Any> args(3);
beans::PropertyValue aProp;
......@@ -778,7 +778,7 @@ namespace cppcanvas
aProp.Value <<= aStops;
args[1] <<= aProp;
aProp.Name = "AspectRatio";
aProp.Value <<= aGradInfo.mfAspectRatio;
aProp.Value <<= aGradInfo.getAspectRatio();
args[2] <<= aProp;
aTexture.Gradient.set(
......
......@@ -631,10 +631,12 @@ namespace drawinglayer
}
else
{
static bool bSimple = false; // allow testing simple paint in debugger
impDrawGradientToOutDev(
*mpOutputDevice, aLocalPolyPolygon, rGradient.getStyle(), rGradient.getSteps(),
aStartColor, aEndColor, rGradient.getBorder(),
rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false);
rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), bSimple);
}
}
}
......
......@@ -24,6 +24,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/attribute/fillgradientattribute.hxx>
#include <drawinglayer/texture/texture.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
......@@ -62,15 +63,15 @@ namespace drawinglayer
/// local helpers
void generateMatricesAndColors(
std::vector< basegfx::B2DHomMatrix >& rMatrices,
std::vector< basegfx::BColor >& rColors) const;
std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
basegfx::BColor& rOutmostColor) const;
Primitive2DSequence createOverlappingFill(
const std::vector< basegfx::B2DHomMatrix >& rMatrices,
const std::vector< basegfx::BColor >& rColors,
const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
const basegfx::BColor& rOutmostColor,
const basegfx::B2DPolygon& rUnitPolygon) const;
Primitive2DSequence createNonOverlappingFill(
const std::vector< basegfx::B2DHomMatrix >& rMatrices,
const std::vector< basegfx::BColor >& rColors,
const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
const basegfx::BColor& rOutmostColor,
const basegfx::B2DPolygon& rUnitPolygon) const;
protected:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment