convert GradientType to scoped enum

Change-Id: Icef1d8d38481022104a957ac9deac1c03dc2d6fb
Reviewed-on: https://gerrit.libreoffice.org/22632
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-02-23 10:03:27 +02:00
committed by Noel Grandin
parent 86a852f0a6
commit b2bb094f6b
6 changed files with 19 additions and 19 deletions

View File

@@ -709,7 +709,7 @@ namespace cairocanvas
switch( aValues.meType )
{
case ::canvas::ParametricPolyPolygon::GRADIENT_LINEAR:
case ::canvas::ParametricPolyPolygon::GradientType::Linear:
x0 = 0;
y0 = 0;
x1 = 1;
@@ -718,7 +718,7 @@ namespace cairocanvas
addColorStops( pPattern, aValues.maColors, aValues.maStops );
break;
case ::canvas::ParametricPolyPolygon::GRADIENT_ELLIPTICAL:
case ::canvas::ParametricPolyPolygon::GradientType::Elliptical:
cx = 0;
cy = 0;
r0 = 0;
@@ -828,7 +828,7 @@ namespace cairocanvas
cairo_matrix_init( &aTextureMatrix,
aTransform.m00, aTransform.m10, aTransform.m01,
aTransform.m11, aTransform.m02, aTransform.m12);
if( pPolyImpl->getValues().meType == canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR )
if( pPolyImpl->getValues().meType == canvas::ParametricPolyPolygon::GradientType::Rectangular )
{
// no general path gradient yet in cairo; emulate then
cairo_save( pCairo );

View File

@@ -430,7 +430,7 @@ namespace dxcanvas
{
switch( rValues.meType )
{
case ::canvas::ParametricPolyPolygon::GRADIENT_LINEAR:
case ::canvas::ParametricPolyPolygon::GradientType::Linear:
fillLinearGradient( rGraphics,
rValues,
rColors,
@@ -439,9 +439,9 @@ namespace dxcanvas
texture );
break;
case ::canvas::ParametricPolyPolygon::GRADIENT_ELLIPTICAL:
case ::canvas::ParametricPolyPolygon::GradientType::Elliptical:
// FALLTHROUGH intended
case ::canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR:
case ::canvas::ParametricPolyPolygon::GradientType::Rectangular:
fillPolygonalGradient( rValues,
rColors,
rStops,

View File

@@ -197,19 +197,19 @@ namespace oglcanvas
switch( rValues.meType )
{
case ::canvas::ParametricPolyPolygon::GRADIENT_LINEAR:
case ::canvas::ParametricPolyPolygon::GradientType::Linear:
rHelper.getDeviceHelper()->useLinearGradientShader(pColors,
rValues.maStops,
aTextureTransform);
break;
case ::canvas::ParametricPolyPolygon::GRADIENT_ELLIPTICAL:
case ::canvas::ParametricPolyPolygon::GradientType::Elliptical:
rHelper.getDeviceHelper()->useRadialGradientShader(pColors,
rValues.maStops,
aTextureTransform);
break;
case ::canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR:
case ::canvas::ParametricPolyPolygon::GradientType::Rectangular:
rHelper.getDeviceHelper()->useRectangularGradientShader(pColors,
rValues.maStops,
aTextureTransform);

View File

@@ -126,7 +126,7 @@ namespace canvas
{
// TODO(P2): hold gradient brush statically, and only setup
// the colors
return new ParametricPolyPolygon( rDevice, GRADIENT_LINEAR, colors, stops );
return new ParametricPolyPolygon( rDevice, GradientType::Linear, colors, stops );
}
ParametricPolyPolygon* ParametricPolyPolygon::createEllipticalGradient(
@@ -141,7 +141,7 @@ namespace canvas
rDevice,
::basegfx::tools::createPolygonFromCircle(
::basegfx::B2DPoint(0,0), 1 ),
GRADIENT_ELLIPTICAL,
GradientType::Elliptical,
colors, stops, fAspectRatio );
}
@@ -156,7 +156,7 @@ namespace canvas
rDevice,
::basegfx::tools::createPolygonFromRect(
::basegfx::B2DRectangle( -1, -1, 1, 1 ) ),
GRADIENT_RECTANGULAR,
GradientType::Rectangular,
colors, stops, fAspectRatio );
}

View File

@@ -494,7 +494,7 @@ namespace vclcanvas
{
switch( rValues.meType )
{
case ::canvas::ParametricPolyPolygon::GRADIENT_LINEAR:
case ::canvas::ParametricPolyPolygon::GradientType::Linear:
fillLinearGradient( rOutDev,
rTextureTransform,
rBounds,
@@ -503,9 +503,9 @@ namespace vclcanvas
rColors );
break;
case ::canvas::ParametricPolyPolygon::GRADIENT_ELLIPTICAL:
case ::canvas::ParametricPolyPolygon::GradientType::Elliptical:
// FALLTHROUGH intended
case ::canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR:
case ::canvas::ParametricPolyPolygon::GradientType::Rectangular:
fillPolygonalGradient( rOutDev,
rTextureTransform,
rBounds,

View File

@@ -47,11 +47,11 @@ namespace canvas
public ParametricPolyPolygon_Base
{
public:
enum GradientType
enum class GradientType
{
GRADIENT_LINEAR,
GRADIENT_ELLIPTICAL,
GRADIENT_RECTANGULAR
Linear,
Elliptical,
Rectangular
};
/** Structure of defining values for the ParametricPolyPolygon