Mac build fix after gradient restructure/renaming.
authorrileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 26 Jul 2012 21:25:09 +0000 (21:25 +0000)
committerrileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 26 Jul 2012 21:25:09 +0000 (21:25 +0000)
Review URL: https://codereview.appspot.com/6441057

git-svn-id: http://skia.googlecode.com/svn/trunk@4797 2bbb7eff-a529-9590-31e7-b0007b416f81

src/animator/SkDisplayType.cpp
src/animator/SkDisplayType.h
src/animator/SkDrawColor.cpp
src/animator/SkDrawColor.h
src/animator/SkDrawGradient.cpp
src/animator/SkDrawGradient.h

index 4dfa62f53177f9170a59f659da022c29addb499e..8c895849e97864678a9846d87817c55c46e13ba7 100644 (file)
@@ -140,7 +140,7 @@ SkDisplayable* SkDisplayType::CreateInstance(SkAnimateMaker* maker, SkDisplayTyp
         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
@@ -167,7 +167,7 @@ SkDisplayable* SkDisplayType::CreateInstance(SkAnimateMaker* maker, SkDisplayTyp
         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);
@@ -284,7 +284,7 @@ const SkMemberInfo* SkDisplayType::GetMembers(SkAnimateMaker* maker,
         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);
@@ -295,7 +295,7 @@ const SkMemberInfo* SkDisplayType::GetMembers(SkAnimateMaker* maker,
         // join
         CASE_GET_INFO(Line);
         CASE_GET_INFO(LineTo);
-        CASE_GET_INFO(LinearGradient);
+        CASE_GET_INFO(DrawLinearGradient);
         // maskfilter
         // maskfilterblurstyle
         // maskfilterlight
@@ -322,7 +322,7 @@ const SkMemberInfo* SkDisplayType::GetMembers(SkAnimateMaker* maker,
         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);
@@ -462,7 +462,7 @@ const TypeNames gTypeNames[] = {
     // 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
@@ -489,7 +489,7 @@ const TypeNames gTypeNames[] = {
     { "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 },
@@ -640,7 +640,7 @@ bool SkDisplayType::IsDisplayable(SkAnimateMaker* , SkDisplayTypes type) {
         case SkType_Input:
         case SkType_Line:
         case SkType_LineTo:
-        case SkType_LinearGradient:
+        case SkType_DrawLinearGradient:
         case SkType_Matrix:
         case SkType_Move:
         case SkType_MoveTo:
@@ -657,7 +657,7 @@ bool SkDisplayType::IsDisplayable(SkAnimateMaker* , SkDisplayTypes type) {
         case SkType_RLineTo:
         case SkType_RMoveTo:
         case SkType_RQuadTo:
-        case SkType_RadialGradient:
+        case SkType_DrawRadialGradient:
         case SkType_Random:
         case SkType_Rect:
         case SkType_RectToRect:
index dcbf5d406c7179778fb3928d3b98c50b891ec27b..9e95ec9e7f32f13f6ed22ed4985b3002476e0d13 100644 (file)
@@ -84,7 +84,7 @@ enum SkDisplayTypes {
     SkType_FromPath,
     SkType_FromPathMode,
     SkType_Full,
-    SkType_Gradient,
+    SkType_DrawGradient,
     SkType_Group,
     SkType_HitClear,
     SkType_HitTest,
@@ -95,7 +95,7 @@ enum SkDisplayTypes {
     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,
@@ -122,7 +122,7 @@ enum SkDisplayTypes {
     SkType_RLineTo,
     SkType_RMoveTo,
     SkType_RQuadTo,
-    SkType_RadialGradient,
+    SkType_DrawRadialGradient,
     SkType_Random,
     SkType_Rect,
     SkType_RectToRect,
index 811a5d6cf313848c95bb07a3ddd122e4f02b703b..9abc8d06edee06fa48a4f7fbf7dbb9374fe55629 100644 (file)
@@ -212,7 +212,7 @@ void SkDrawColor::onEndElement(SkAnimateMaker& maker){
 
 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;
index 29c73c355cc445e0cb03126a58ad2b72821f9b5e..281af0fb51d68a82b3a44291c9b77147f833571c 100644 (file)
@@ -35,7 +35,7 @@ protected:
     SkScalar fValue;
     SkBool fDirty;
 private:
-    friend class SkGradient;
+    friend class SkDrawGradient;
     typedef SkPaintPart INHERITED;
 };
 
index 4f7fbb6be8efb577d0c228f75c3d0e970039f7d8..9e29074e79b3939bea99f568f95be6b78be06ab6 100644 (file)
@@ -30,9 +30,9 @@ static U16CPU SkScalarToUnit(SkScalar x) {
 #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()
@@ -65,7 +65,7 @@ protected:
 
 #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)
@@ -73,18 +73,18 @@ const SkMemberInfo SkGradient::fInfo[] = {
 
 #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;
@@ -94,7 +94,7 @@ bool SkGradient::add(SkAnimateMaker& , SkDisplayable* child) {
     return false;
 }
 
-int SkGradient::addPrelude() {
+int SkDrawGradient::addPrelude() {
     int count = fDrawColors.count();
     fColors.setCount(count);
     for (int index = 0; index < count; index++) 
@@ -103,7 +103,7 @@ int SkGradient::addPrelude() {
 }
 
 #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;
@@ -121,7 +121,7 @@ void SkGradient::dumpRest(SkAnimateMaker* maker) {
 }
 #endif
 
-void SkGradient::onEndElement(SkAnimateMaker& maker) {
+void SkDrawGradient::onEndElement(SkAnimateMaker& maker) {
     if (offsets.count() != 0) {
         if (offsets.count() != fDrawColors.count()) {
             maker.setErrorCode(SkDisplayXMLParserError::kGradientOffsetsDontMatchColors);
@@ -147,25 +147,25 @@ void SkGradient::onEndElement(SkAnimateMaker& maker) {
         }
     }
     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);
@@ -173,13 +173,13 @@ void SkLinearGradient::onEndElement(SkAnimateMaker& maker)
 }
 
 #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(),
@@ -193,7 +193,7 @@ SkShader* SkLinearGradient::getShader() {
 
 #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)
@@ -201,20 +201,20 @@ const SkMemberInfo SkRadialGradient::fInfo[] = {
 
 #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,
index 251e9756719bdedd5747ee632fbfe3dec76447e8..09eb405e6b6f1884916089a14d11bae31beedb61 100644 (file)
 
 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*);
@@ -36,9 +36,9 @@ private:
     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*);
@@ -47,12 +47,12 @@ class SkLinearGradient : public SkGradient {
 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    
@@ -61,7 +61,7 @@ protected:
     SkPoint center;
     SkScalar radius;
 private:
-    typedef SkGradient INHERITED;
+    typedef SkDrawGradient INHERITED;
 };
 
 #endif // SkDrawGradient_DEFINED