in SkDrawPaint::add(); check the pointer when it's used to avoid
dereferencing NULL.
Add title to Animator sample slide.
git-svn-id: http://skia.googlecode.com/svn/trunk@1825
2bbb7eff-a529-9590-31e7-
b0007b416f81
protected:
// overrides
virtual void onDraw(SkCanvas*);
+ virtual bool onQuery(SkEvent* evt);
private:
SkString fBaseURI;
}
}
+bool SkAnimatorView::onQuery(SkEvent* evt) {
+ if (SampleCode::TitleQ(*evt)) {
+ SampleCode::TitleR(evt, "Animator");
+ return true;
+ }
+ return this->INHERITED::onQuery(evt);
+}
+
//////////////////////////////////////////////////////////////////////////////
static SkView* MyFactory() {
delete typeface;
}
-bool SkDrawPaint::add(SkAnimateMaker& maker, SkDisplayable* child) {
+bool SkDrawPaint::add(SkAnimateMaker* maker, SkDisplayable* child) {
SkASSERT(child && child->isPaintPart());
SkPaintPart* part = (SkPaintPart*) child;
- if (part->add())
- maker.setErrorCode(SkDisplayXMLParserError::kErrorAddingToPaint);
+ if (part->add() && maker)
+ maker->setErrorCode(SkDisplayXMLParserError::kErrorAddingToPaint);
return true;
}
DECLARE_DRAW_MEMBER_INFO(Paint);
SkDrawPaint();
virtual ~SkDrawPaint();
- virtual bool add(SkAnimateMaker& , SkDisplayable* child);
+ virtual bool add(SkAnimateMaker* , SkDisplayable* child);
virtual SkDisplayable* deepCopy(SkAnimateMaker* );
virtual bool draw(SkAnimateMaker& );
#ifdef SK_DUMP_ENABLED
fPaint->fOwnsPathEffect = true;
return false;
}
- fPaint->add(*(SkAnimateMaker*) NULL, this);
+ fPaint->add(NULL, this);
return false;
}