Index: src/animator/SkAnimator.cpp |
diff --git a/src/animator/SkAnimator.cpp b/src/animator/SkAnimator.cpp |
index 97f55af01af3b1509a18d317c2c15b969d4aa1a1..ee75ab14affa8fc49f49df9e0ba6a200054338d6 100644 |
--- a/src/animator/SkAnimator.cpp |
+++ b/src/animator/SkAnimator.cpp |
@@ -42,7 +42,7 @@ _static const char gMathPrimerText[] = |
#define gMathPrimer gMathPrimerText |
-SkAnimator::SkAnimator() : fMaker(NULL) { |
+SkAnimator::SkAnimator() : fMaker(nullptr) { |
initialize(); |
} |
@@ -144,7 +144,7 @@ bool SkAnimator::doUserEvent(const SkEvent& evt) { |
} |
SkAnimator::DifferenceType SkAnimator::draw(SkCanvas* canvas, SkPaint* paint, SkMSec time) { |
- if (paint == NULL) |
+ if (paint == nullptr) |
return draw(canvas, time); |
fMaker->fScreenplay.time = time; |
fMaker->fCanvas = canvas; |
@@ -179,7 +179,7 @@ bool SkAnimator::findClickEvent(SkScalar x, SkScalar y) { |
const SkAnimator* SkAnimator::getAnimator(const SkDisplayable* displayable) const { |
if (displayable->getType() != SkType_Movie) |
- return NULL; |
+ return nullptr; |
const SkDisplayMovie* movie = (const SkDisplayMovie*) displayable; |
return movie->getAnimator(); |
} |
@@ -187,13 +187,13 @@ const SkAnimator* SkAnimator::getAnimator(const SkDisplayable* displayable) cons |
const SkDisplayable* SkAnimator::getElement(const char* id) { |
SkDisplayable* element; |
if (fMaker->find(id, &element) == false) |
- return NULL; |
+ return nullptr; |
return (const SkDisplayable*) element; |
} |
SkElementType SkAnimator::getElementType(const SkDisplayable* ae) { |
SkDisplayable* element = (SkDisplayable*) ae; |
- const SkMemberInfo* info = SkDisplayType::GetMembers(fMaker, element->getType(), NULL); |
+ const SkMemberInfo* info = SkDisplayType::GetMembers(fMaker, element->getType(), nullptr); |
return (SkElementType) SkDisplayType::Find(fMaker, info); |
} |
@@ -240,10 +240,10 @@ int32_t SkAnimator::getArrayInt(const SkDisplayable* ae, |
int32_t SkAnimator::getArrayInt(const char* id, const char* fieldID, int index) { |
const SkDisplayable* element = getElement(id); |
- if (element == NULL) |
+ if (element == nullptr) |
return SK_NaN32; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return SK_NaN32; |
return getArrayInt(element, field, index); |
} |
@@ -257,10 +257,10 @@ SkScalar SkAnimator::getArrayScalar(const SkDisplayable* ae, |
SkScalar SkAnimator::getArrayScalar(const char* id, const char* fieldID, int index) { |
const SkDisplayable* element = getElement(id); |
- if (element == NULL) |
+ if (element == nullptr) |
return SK_ScalarNaN; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return SK_ScalarNaN; |
return getArrayScalar(element, field, index); |
} |
@@ -269,16 +269,16 @@ const char* SkAnimator::getArrayString(const SkDisplayable* ae, |
const SkMemberInfo* ai, int index) { |
SkOperand operand; |
bool result = getArrayCommon(ae, ai, index, &operand); |
- return result ? operand.fString->c_str() : NULL; |
+ return result ? operand.fString->c_str() : nullptr; |
} |
const char* SkAnimator::getArrayString(const char* id, const char* fieldID, int index) { |
const SkDisplayable* element = getElement(id); |
- if (element == NULL) |
- return NULL; |
+ if (element == nullptr) |
+ return nullptr; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
- return NULL; |
+ if (field == nullptr) |
+ return nullptr; |
return getArrayString(element, field, index); |
} |
@@ -326,10 +326,10 @@ int32_t SkAnimator::getInt(const SkDisplayable* element, const SkMemberInfo* inf |
int32_t SkAnimator::getInt(const char* id, const char* fieldID) { |
const SkDisplayable* element = getElement(id); |
- if (element == NULL) |
+ if (element == nullptr) |
return SK_NaN32; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return SK_NaN32; |
return getInt(element, field); |
} |
@@ -352,10 +352,10 @@ SkScalar SkAnimator::getScalar(const SkDisplayable* element, const SkMemberInfo* |
SkScalar SkAnimator::getScalar(const char* id, const char* fieldID) { |
const SkDisplayable* element = getElement(id); |
- if (element == NULL) |
+ if (element == nullptr) |
return SK_ScalarNaN; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return SK_ScalarNaN; |
return getScalar(element, field); |
} |
@@ -371,11 +371,11 @@ const char* SkAnimator::getString(const SkDisplayable* ae, |
const char* SkAnimator::getString(const char* id, const char* fieldID) { |
const SkDisplayable* element = getElement(id); |
- if (element == NULL) |
- return NULL; |
+ if (element == nullptr) |
+ return nullptr; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
- return NULL; |
+ if (field == nullptr) |
+ return nullptr; |
return getString(element, field); |
} |
@@ -385,7 +385,7 @@ const char* SkAnimator::getURIBase() { |
void SkAnimator::initialize() { |
delete fMaker; |
- fMaker = new SkAnimateMaker(this, NULL, NULL); |
+ fMaker = new SkAnimateMaker(this, nullptr, nullptr); |
decodeMemory(gMathPrimer, sizeof(gMathPrimer)-1); |
#ifdef SK_BUILD_FOR_ANDROID |
InitializeSkExtraPathEffects(this); |
@@ -402,7 +402,7 @@ bool SkAnimator::isTrackingEvents() { |
bool SkAnimator::onEvent(const SkEvent& evt) { |
#ifdef SK_DEBUG |
SkAnimator* root = fMaker->getRoot(); |
- if (root == NULL) |
+ if (root == nullptr) |
root = this; |
if (root->isTrackingEvents()) |
root->eventDone(evt); |
@@ -424,7 +424,7 @@ bool SkAnimator::onEvent(const SkEvent& evt) { |
} |
{ |
const char* id = evt.findString("id"); |
- if (id == NULL) |
+ if (id == nullptr) |
return false; |
SkDisplayable** firstMovie = fMaker->fMovies.begin(); |
SkDisplayable** endMovie = fMaker->fMovies.end(); |
@@ -555,11 +555,11 @@ bool SkAnimator::setArray(SkDisplayable* element, const SkMemberInfo* info, SkTy |
bool SkAnimator::setArray(const char* id, const char* fieldID, SkTypedArray array) { |
SkDisplayable* element = (SkDisplayable*) getElement(id); |
- //should I go ahead and change all 'NULL's to 'NULL'? |
- if (element == NULL) |
+ //should I go ahead and change all 'nullptr's to 'nullptr'? |
+ if (element == nullptr) |
return false; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return false; |
return setArray(element, field, array); |
} |
@@ -581,10 +581,10 @@ bool SkAnimator::setInt(SkDisplayable* element, const SkMemberInfo* info, int32_ |
bool SkAnimator::setInt(const char* id, const char* fieldID, int32_t s32) { |
SkDisplayable* element = (SkDisplayable*) getElement(id); |
- if (element == NULL) |
+ if (element == nullptr) |
return false; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return false; |
return setInt(element, field, s32); |
} |
@@ -606,10 +606,10 @@ bool SkAnimator::setScalar(SkDisplayable* element, const SkMemberInfo* info, SkS |
bool SkAnimator::setScalar(const char* id, const char* fieldID, SkScalar scalar) { |
SkDisplayable* element = (SkDisplayable*) getElement(id); |
- if (element == NULL) |
+ if (element == nullptr) |
return false; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return false; |
return setScalar(element, field, scalar); |
} |
@@ -617,16 +617,16 @@ bool SkAnimator::setScalar(const char* id, const char* fieldID, SkScalar scalar) |
bool SkAnimator::setString(SkDisplayable* element, |
const SkMemberInfo* info, const char* str) { |
// !!! until this is fixed, can't call script with global references from here |
- info->setValue(*fMaker, NULL, 0, info->fCount, element, info->getType(), str, strlen(str)); |
+ info->setValue(*fMaker, nullptr, 0, info->fCount, element, info->getType(), str, strlen(str)); |
return true; |
} |
bool SkAnimator::setString(const char* id, const char* fieldID, const char* str) { |
SkDisplayable* element = (SkDisplayable*) getElement(id); |
- if (element == NULL) |
+ if (element == nullptr) |
return false; |
const SkMemberInfo* field = getField(element, fieldID); |
- if (field == NULL) |
+ if (field == nullptr) |
return false; |
return setString(element, field, str); |
} |