inherit from SampleView
git-svn-id: http://skia.googlecode.com/svn/trunk@1646 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleLineClipper.cpp b/samplecode/SampleLineClipper.cpp
index ac6b013..e606d87 100644
--- a/samplecode/SampleLineClipper.cpp
+++ b/samplecode/SampleLineClipper.cpp
@@ -146,7 +146,7 @@
H = 480/3
};
-class LineClipperView : public SkView {
+class LineClipperView : public SampleView {
SkMSec fNow;
int fCounter;
int fProcIndex;
@@ -185,10 +185,6 @@
return this->INHERITED::onQuery(evt);
}
- void drawBG(SkCanvas* canvas) {
- canvas->drawColor(SK_ColorWHITE);
- }
-
static void drawVLine(SkCanvas* canvas, SkScalar x, const SkPaint& paint) {
canvas->drawLine(x, -999, x, 999, paint);
}
@@ -197,9 +193,7 @@
canvas->drawLine(-999, y, 999, y, paint);
}
- virtual void onDraw(SkCanvas* canvas) {
- this->drawBG(canvas);
-
+ virtual void onDrawContent(SkCanvas* canvas) {
SkMSec now = SampleCode::GetAnimTime();
if (fNow != now) {
fNow = now;
@@ -229,6 +223,7 @@
paint1.setColor(SK_ColorRED);
paint1.setStyle(SkPaint::kStroke_Style);
gProcs[fProcIndex](fPts, fClip, canvas, paint, paint1);
+ this->inval(NULL);
}
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
@@ -245,7 +240,7 @@
}
private:
- typedef SkView INHERITED;
+ typedef SampleView INHERITED;
};
//////////////////////////////////////////////////////////////////////////////