CASE_DEBUG_RETURN_NIL(Join);
CASE_NEW(Line);
CASE_NEW(LineTo);
- CASE_NEW(LinearGradient);
+ CASE_NEW(DrawLinearGradient);
CASE_DRAW_NEW(MaskFilter);
CASE_DEBUG_RETURN_NIL(MaskFilterBlurStyle);
// maskfilterlight
CASE_NEW(RLineTo);
CASE_NEW(RMoveTo);
CASE_NEW(RQuadTo);
- CASE_NEW(RadialGradient);
+ CASE_NEW(DrawRadialGradient);
CASE_DISPLAY_NEW(Random);
CASE_DRAW_NEW(Rect);
CASE_NEW(RectToRect);
CASE_GET_INFO(FromPath);
// frompathmode
// full
- CASE_GET_INFO(Gradient);
+ CASE_GET_INFO(DrawGradient);
CASE_GET_INFO(Group);
CASE_GET_INFO(HitClear);
CASE_GET_INFO(HitTest);
// join
CASE_GET_INFO(Line);
CASE_GET_INFO(LineTo);
- CASE_GET_INFO(LinearGradient);
+ CASE_GET_INFO(DrawLinearGradient);
// maskfilter
// maskfilterblurstyle
// maskfilterlight
CASE_GET_INFO(RLineTo);
CASE_GET_INFO(RMoveTo);
CASE_GET_INFO(RQuadTo);
- CASE_GET_INFO(RadialGradient);
+ CASE_GET_INFO(DrawRadialGradient);
CASE_GET_DISPLAY_INFO(Random);
CASE_GET_DRAW_INFO(Rect);
CASE_GET_INFO(RectToRect);
// join
{ "line", SkType_Line INIT_BOOL_FIELDS },
{ "lineTo", SkType_LineTo INIT_BOOL_FIELDS },
- { "linearGradient", SkType_LinearGradient INIT_BOOL_FIELDS },
+ { "linearGradient", SkType_DrawLinearGradient INIT_BOOL_FIELDS },
{ "maskFilter", SkType_MaskFilter INIT_BOOL_FIELDS },
// maskfilterblurstyle
// maskfilterlight
{ "rLineTo", SkType_RLineTo INIT_BOOL_FIELDS },
{ "rMoveTo", SkType_RMoveTo INIT_BOOL_FIELDS },
{ "rQuadTo", SkType_RQuadTo INIT_BOOL_FIELDS },
- { "radialGradient", SkType_RadialGradient INIT_BOOL_FIELDS },
+ { "radialGradient", SkType_DrawRadialGradient INIT_BOOL_FIELDS },
DISPLAY_NAME("random", SkType_Random),
{ "rect", SkType_Rect INIT_BOOL_FIELDS },
{ "rectToRect", SkType_RectToRect INIT_BOOL_FIELDS },
case SkType_Input:
case SkType_Line:
case SkType_LineTo:
- case SkType_LinearGradient:
+ case SkType_DrawLinearGradient:
case SkType_Matrix:
case SkType_Move:
case SkType_MoveTo:
case SkType_RLineTo:
case SkType_RMoveTo:
case SkType_RQuadTo:
- case SkType_RadialGradient:
+ case SkType_DrawRadialGradient:
case SkType_Random:
case SkType_Rect:
case SkType_RectToRect:
SkType_FromPath,
SkType_FromPathMode,
SkType_Full,
- SkType_Gradient,
+ SkType_DrawGradient,
SkType_Group,
SkType_HitClear,
SkType_HitTest,
SkType_Join,
SkType_Line, // simple line primitive
SkType_LineTo, // used as part of path construction
- SkType_LinearGradient,
+ SkType_DrawLinearGradient,
SkType_MaskFilter,
SkType_MaskFilterBlurStyle,
SkType_MaskFilterLight,
SkType_RLineTo,
SkType_RMoveTo,
SkType_RQuadTo,
- SkType_RadialGradient,
+ SkType_DrawRadialGradient,
SkType_Random,
SkType_Rect,
SkType_RectToRect,
bool SkDrawColor::setParent(SkDisplayable* parent) {
SkASSERT(parent != NULL);
- if (parent->getType() == SkType_LinearGradient || parent->getType() == SkType_RadialGradient)
+ if (parent->getType() == SkType_DrawLinearGradient || parent->getType() == SkType_DrawRadialGradient)
return false;
if (parent->isPaint() == false)
return true;
SkScalar fValue;
SkBool fDirty;
private:
- friend class SkGradient;
+ friend class SkDrawGradient;
typedef SkPaintPart INHERITED;
};
#endif
}
-class SkGradientUnitMapper : public SkUnitMapper {
+class SkDrawGradientUnitMapper : public SkUnitMapper {
public:
- SkGradientUnitMapper(SkAnimateMaker* maker, const char* script) : fMaker(maker), fScript(script) {
+ SkDrawGradientUnitMapper(SkAnimateMaker* maker, const char* script) : fMaker(maker), fScript(script) {
}
SK_DECLARE_UNFLATTENABLE_OBJECT()
#if SK_USE_CONDENSED_INFO == 0
-const SkMemberInfo SkGradient::fInfo[] = {
+const SkMemberInfo SkDrawGradient::fInfo[] = {
SK_MEMBER_INHERITED,
SK_MEMBER_ARRAY(offsets, Float),
SK_MEMBER(unitMapper, String)
#endif
-DEFINE_GET_MEMBER(SkGradient);
+DEFINE_GET_MEMBER(SkDrawGradient);
-SkGradient::SkGradient() : fUnitMapper(NULL) {
+SkDrawGradient::SkDrawGradient() : fUnitMapper(NULL) {
}
-SkGradient::~SkGradient() {
+SkDrawGradient::~SkDrawGradient() {
for (int index = 0; index < fDrawColors.count(); index++)
delete fDrawColors[index];
delete fUnitMapper;
}
-bool SkGradient::add(SkAnimateMaker& , SkDisplayable* child) {
+bool SkDrawGradient::add(SkAnimateMaker& , SkDisplayable* child) {
SkASSERT(child);
if (child->isColor()) {
SkDrawColor* color = (SkDrawColor*) child;
return false;
}
-int SkGradient::addPrelude() {
+int SkDrawGradient::addPrelude() {
int count = fDrawColors.count();
fColors.setCount(count);
for (int index = 0; index < count; index++)
}
#ifdef SK_DUMP_ENABLED
-void SkGradient::dumpRest(SkAnimateMaker* maker) {
+void SkDrawGradient::dumpRest(SkAnimateMaker* maker) {
dumpAttrs(maker);
//can a gradient have no colors?
bool closedYet = false;
}
#endif
-void SkGradient::onEndElement(SkAnimateMaker& maker) {
+void SkDrawGradient::onEndElement(SkAnimateMaker& maker) {
if (offsets.count() != 0) {
if (offsets.count() != fDrawColors.count()) {
maker.setErrorCode(SkDisplayXMLParserError::kGradientOffsetsDontMatchColors);
}
}
if (unitMapper.size() > 0)
- fUnitMapper = new SkGradientUnitMapper(&maker, unitMapper.c_str());
+ fUnitMapper = new SkDrawGradientUnitMapper(&maker, unitMapper.c_str());
INHERITED::onEndElement(maker);
}
#if SK_USE_CONDENSED_INFO == 0
-const SkMemberInfo SkLinearGradient::fInfo[] = {
+const SkMemberInfo SkDrawLinearGradient::fInfo[] = {
SK_MEMBER_INHERITED,
SK_MEMBER_ARRAY(points, Float),
};
#endif
-DEFINE_GET_MEMBER(SkLinearGradient);
+DEFINE_GET_MEMBER(SkDrawLinearGradient);
-SkLinearGradient::SkLinearGradient() {
+SkDrawLinearGradient::SkDrawLinearGradient() {
}
-void SkLinearGradient::onEndElement(SkAnimateMaker& maker)
+void SkDrawLinearGradient::onEndElement(SkAnimateMaker& maker)
{
if (points.count() != 4)
maker.setErrorCode(SkDisplayXMLParserError::kGradientPointsLengthMustBeFour);
}
#ifdef SK_DUMP_ENABLED
-void SkLinearGradient::dump(SkAnimateMaker* maker) {
+void SkDrawLinearGradient::dump(SkAnimateMaker* maker) {
dumpBase(maker);
dumpRest(maker);
}
#endif
-SkShader* SkLinearGradient::getShader() {
+SkShader* SkDrawLinearGradient::getShader() {
if (addPrelude() == 0 || points.count() != 4)
return NULL;
SkShader* shader = SkGradientShader::CreateLinear((SkPoint*)points.begin(),
#if SK_USE_CONDENSED_INFO == 0
-const SkMemberInfo SkRadialGradient::fInfo[] = {
+const SkMemberInfo SkDrawRadialGradient::fInfo[] = {
SK_MEMBER_INHERITED,
SK_MEMBER(center, Point),
SK_MEMBER(radius, Float)
#endif
-DEFINE_GET_MEMBER(SkRadialGradient);
+DEFINE_GET_MEMBER(SkDrawRadialGradient);
-SkRadialGradient::SkRadialGradient() : radius(0) {
+SkDrawRadialGradient::SkDrawRadialGradient() : radius(0) {
center.set(0, 0);
}
#ifdef SK_DUMP_ENABLED
-void SkRadialGradient::dump(SkAnimateMaker* maker) {
+void SkDrawRadialGradient::dump(SkAnimateMaker* maker) {
dumpBase(maker);
dumpRest(maker);
}
#endif
-SkShader* SkRadialGradient::getShader() {
+SkShader* SkDrawRadialGradient::getShader() {
if (addPrelude() == 0)
return NULL;
SkShader* shader = SkGradientShader::CreateRadial(center,
class SkUnitMapper;
-class SkGradient : public SkDrawShader {
- DECLARE_PRIVATE_MEMBER_INFO(Gradient);
- SkGradient();
- virtual ~SkGradient();
+class SkDrawGradient : public SkDrawShader {
+ DECLARE_PRIVATE_MEMBER_INFO(DrawGradient);
+ SkDrawGradient();
+ virtual ~SkDrawGradient();
virtual bool add(SkAnimateMaker& , SkDisplayable* child);
#ifdef SK_DUMP_ENABLED
virtual void dumpRest(SkAnimateMaker*);
typedef SkDrawShader INHERITED;
};
-class SkLinearGradient : public SkGradient {
- DECLARE_MEMBER_INFO(LinearGradient);
- SkLinearGradient();
+class SkDrawLinearGradient : public SkDrawGradient {
+ DECLARE_MEMBER_INFO(DrawLinearGradient);
+ SkDrawLinearGradient();
virtual void onEndElement(SkAnimateMaker& );
#ifdef SK_DUMP_ENABLED
virtual void dump(SkAnimateMaker*);
protected:
SkTDScalarArray points;
private:
- typedef SkGradient INHERITED;
+ typedef SkDrawGradient INHERITED;
};
-class SkRadialGradient : public SkGradient {
- DECLARE_MEMBER_INFO(RadialGradient);
- SkRadialGradient();
+class SkDrawRadialGradient : public SkDrawGradient {
+ DECLARE_MEMBER_INFO(DrawRadialGradient);
+ SkDrawRadialGradient();
#ifdef SK_DUMP_ENABLED
virtual void dump(SkAnimateMaker*);
#endif
SkPoint center;
SkScalar radius;
private:
- typedef SkGradient INHERITED;
+ typedef SkDrawGradient INHERITED;
};
#endif // SkDrawGradient_DEFINED