Move Arc sample to onOnceBeforeDraw.
Doing work in the constructor makes it difficult to debug other tests. Change-Id: I0aabd031ce7caf492cde6e7d32be7586c7f0b9d3 Reviewed-on: https://skia-review.googlesource.com/c/173767 Auto-Submit: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
parent
9cfefdb765
commit
ee4db8eb59
@ -84,19 +84,7 @@ public:
|
|||||||
sk_sp<MyDrawable> fAnimatingDrawable;
|
sk_sp<MyDrawable> fAnimatingDrawable;
|
||||||
sk_sp<SkDrawable> fRootDrawable;
|
sk_sp<SkDrawable> fRootDrawable;
|
||||||
|
|
||||||
ArcsView() {
|
ArcsView() { }
|
||||||
testparse();
|
|
||||||
fSweep = SkIntToScalar(100);
|
|
||||||
this->setBGColor(0xFFDDDDDD);
|
|
||||||
|
|
||||||
fRect.set(0, 0, SkIntToScalar(200), SkIntToScalar(200));
|
|
||||||
fRect.offset(SkIntToScalar(20), SkIntToScalar(20));
|
|
||||||
fAnimatingDrawable = sk_make_sp<MyDrawable>(fRect);
|
|
||||||
|
|
||||||
SkPictureRecorder recorder;
|
|
||||||
this->drawRoot(recorder.beginRecording(SkRect::MakeWH(800, 500)));
|
|
||||||
fRootDrawable = recorder.finishRecordingAsDrawable();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool onQuery(Sample::Event* evt) override {
|
bool onQuery(Sample::Event* evt) override {
|
||||||
@ -183,6 +171,20 @@ protected:
|
|||||||
DrawArcs(canvas);
|
DrawArcs(canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onOnceBeforeDraw() override {
|
||||||
|
testparse();
|
||||||
|
fSweep = SkIntToScalar(100);
|
||||||
|
this->setBGColor(0xFFDDDDDD);
|
||||||
|
|
||||||
|
fRect.set(0, 0, SkIntToScalar(200), SkIntToScalar(200));
|
||||||
|
fRect.offset(SkIntToScalar(20), SkIntToScalar(20));
|
||||||
|
fAnimatingDrawable = sk_make_sp<MyDrawable>(fRect);
|
||||||
|
|
||||||
|
SkPictureRecorder recorder;
|
||||||
|
this->drawRoot(recorder.beginRecording(SkRect::MakeWH(800, 500)));
|
||||||
|
fRootDrawable = recorder.finishRecordingAsDrawable();
|
||||||
|
}
|
||||||
|
|
||||||
void onDrawContent(SkCanvas* canvas) override {
|
void onDrawContent(SkCanvas* canvas) override {
|
||||||
canvas->drawDrawable(fRootDrawable.get());
|
canvas->drawDrawable(fRootDrawable.get());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user