aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleVertices.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-22 14:10:48 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-22 14:10:48 +0000
commitf21833999d90ad9c8c584cff3238797b39cfc00b (patch)
treea9d07155d6567708fff2796d46fae62534e7e1ff /samplecode/SampleVertices.cpp
parent2eb595292b9624371d1698ae9da7accb4c09c26c (diff)
migrate some samples over to SampleView, for FPS measurements
git-svn-id: http://skia.googlecode.com/svn/trunk@1166 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleVertices.cpp')
-rw-r--r--samplecode/SampleVertices.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp
index 7f5aa9665b..f260e1af25 100644
--- a/samplecode/SampleVertices.cpp
+++ b/samplecode/SampleVertices.cpp
@@ -35,7 +35,7 @@ static SkShader* make_shader1(const SkIPoint& size) {
SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode, NULL);
}
-class VerticesView : public SkView {
+class VerticesView : public SampleView {
SkShader* fShader0;
SkShader* fShader1;
@@ -51,6 +51,8 @@ public:
make_tris(&fRecs[2]);
fScale = SK_Scalar1;
+
+ this->setBGColor(SK_ColorGRAY);
}
virtual ~VerticesView() {
@@ -70,15 +72,9 @@ protected:
return this->INHERITED::onQuery(evt);
}
- void drawBG(SkCanvas* canvas) {
- canvas->drawColor(SK_ColorGRAY);
- }
-
SkScalar fScale;
- virtual void onDraw(SkCanvas* canvas) {
- this->drawBG(canvas);
-
+ virtual void onDrawContent(SkCanvas* canvas) {
SkPaint paint;
paint.setDither(true);
paint.setFilterBitmap(true);
@@ -214,7 +210,7 @@ private:
Rec fRecs[3];
- typedef SkView INHERITED;
+ typedef SampleView INHERITED;
};
//////////////////////////////////////////////////////////////////////////////