diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-22 14:10:48 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-22 14:10:48 +0000 |
commit | f21833999d90ad9c8c584cff3238797b39cfc00b (patch) | |
tree | a9d07155d6567708fff2796d46fae62534e7e1ff /samplecode/SampleTextOnPath.cpp | |
parent | 2eb595292b9624371d1698ae9da7accb4c09c26c (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/SampleTextOnPath.cpp')
-rw-r--r-- | samplecode/SampleTextOnPath.cpp | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/samplecode/SampleTextOnPath.cpp b/samplecode/SampleTextOnPath.cpp index 6657d5e71d..96e8c9a9f7 100644 --- a/samplecode/SampleTextOnPath.cpp +++ b/samplecode/SampleTextOnPath.cpp @@ -201,7 +201,7 @@ static void test_textpathmatrix(SkCanvas* canvas) { canvas->drawTextOnPath(text, len, path, &matrix, paint); } -class TextOnPathView : public SkView { +class TextOnPathView : public SampleView { public: SkPath fPath; SkScalar fHOffset; @@ -226,36 +226,7 @@ protected: return this->INHERITED::onQuery(evt); } - void drawBG(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); -#if 0 - SkRect r; - SkPaint p; - SkRandom rand; - p.setAntiAlias(true); - - for (int i = 0; i < 100; i++) { - SkScalar x = rand.nextUScalar1() * 300 + SkIntToScalar(50); - SkScalar y = rand.nextUScalar1() * 200 + SkIntToScalar(50); - SkScalar w = rand.nextUScalar1() * 10; - SkScalar h = rand.nextUScalar1() * 10; - r.set(x, y, x + w, y + h); - canvas->drawRect(r, p); - } - - test_textBounds(canvas); -// return; - - SkBitmap bm; - if (SkImageDecoder::DecodeFile("/loading_tile.png", - &bm, SkBitmap::kRGB_565_Config, true)) - canvas->drawBitmap(bm, 0, 0); -#endif - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - + virtual void onDrawContent(SkCanvas* canvas) { SkPaint paint; paint.setAntiAlias(true); @@ -300,7 +271,7 @@ protected: private: int fHints; - typedef SkView INHERITED; + typedef SampleView INHERITED; }; ////////////////////////////////////////////////////////////////////////////// |