aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-07-12 15:52:56 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-12 20:30:50 +0000
commit176c3b2e8892865d2b78a745fb359b3644d11d2b (patch)
tree0872ad23ffb3d5054bac5e80ad1bc2e5dca26bc5 /samplecode
parent98222ac41db83d060433fba0004acb580c54dfe4 (diff)
Move expensive initialization to onOnceBeforeDraw
This was being triggered at viewer startup, while initalizing the slide list (and then again when switching to the slide). Removing it declutters startup, particularly if you're trying to debug raster drawing code. Bug: skia: Change-Id: If21cdd10b0dbda74f4a845031ae3e33f7305a1d7 Reviewed-on: https://skia-review.googlesource.com/22742 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleFilterQuality.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/samplecode/SampleFilterQuality.cpp b/samplecode/SampleFilterQuality.cpp
index 43cd505721..abe1a9097d 100644
--- a/samplecode/SampleFilterQuality.cpp
+++ b/samplecode/SampleFilterQuality.cpp
@@ -147,7 +147,7 @@ class FilterQualityView : public SampleView {
bool fShowFatBits;
public:
- FilterQualityView() : fImage(make_image()), fTrans(2, 2), fShowFatBits(true) {
+ FilterQualityView() : fTrans(2, 2), fShowFatBits(true) {
fCell.set(256, 256);
fScale.set(1, SK_Scalar1 / 8, 1);
@@ -250,6 +250,10 @@ protected:
canvas->drawLine(r.centerX(), r.top(), r.centerX(), r.bottom(), p);
}
+ void onOnceBeforeDraw() override {
+ fImage = make_image();
+ }
+
void onDrawContent(SkCanvas* canvas) override {
fCell.set(this->height() / 2, this->height() / 2);