fReg = GMRegistry::Head();
}
+ void reset() {
+ fReg = GMRegistry::Head();
+ }
+
GM* next() {
if (fReg) {
GMRegistry::Factory fact = fReg->factory();
public:
GMView() {
fGM = fIter.next();
+ this->postNextGM();
}
protected:
return this->INHERITED::onQuery(evt);
}
+ virtual bool onEvent(const SkEvent& evt) {
+ if (evt.isType("next-gm")) {
+ delete fGM;
+ if (!(fGM = fIter.next())) {
+ fIter.reset();
+ fGM = fIter.next();
+ }
+ this->inval(NULL);
+ this->postNextGM();
+ return true;
+ }
+ return this->INHERITED::onEvent(evt);
+ }
+
void drawBG(SkCanvas* canvas) {
canvas->drawColor(0xFFDDDDDD);
}
}
private:
+ void postNextGM() {
+ (new SkEvent("next-gm"))->post(this->getSinkID(), 1500);
+ }
+
typedef SkView INHERITED;
};
SkDeviceFactory* SkCanvas::setDeviceFactory(SkDeviceFactory* factory) {
SkDELETE(fDeviceFactory);
fDeviceFactory = factory;
+ return factory;
}
//////////////////////////////////////////////////////////////////////////////