diff options
| author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-11 05:58:58 +0000 |
|---|---|---|
| committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-11 05:58:58 +0000 |
| commit | 0faac1e8579088a39f38d02ff675f14d7deb608d (patch) | |
| tree | 4e4cdee1aa1af6b2012bc0aa7ab9ccdcd097dc56 /samplecode/SampleDitherBitmap.cpp | |
| parent | c1c5b15e41eaae5edeb032d994a619ea05c3d0a5 (diff) | |
remove some dead code in pipes
inherit from SampleView for more samples
add L key to toggle using SkGPipe
git-svn-id: http://skia.googlecode.com/svn/trunk@1296 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleDitherBitmap.cpp')
| -rw-r--r-- | samplecode/SampleDitherBitmap.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp index 1000fdfaa0..91199c2ec9 100644 --- a/samplecode/SampleDitherBitmap.cpp +++ b/samplecode/SampleDitherBitmap.cpp @@ -70,7 +70,7 @@ static SkBitmap make_bitmap() { return bm; } -class DitherBitmapView : public SkView { +class DitherBitmapView : public SampleView { SkBitmap fBM8; SkBitmap fBM32; public: @@ -78,6 +78,8 @@ public: test_pathregion(); fBM8 = make_bitmap(); fBM8.copyTo(&fBM32, SkBitmap::kARGB_8888_Config); + + this->setBGColor(0xFFDDDDDD); } protected: @@ -90,10 +92,6 @@ protected: return this->INHERITED::onQuery(evt); } - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); - } - static void setBitmapOpaque(SkBitmap* bm, bool isOpaque) { SkAutoLockPixels alp(*bm); // needed for ctable bm->setIsOpaque(isOpaque); @@ -121,9 +119,7 @@ protected: canvas->drawBitmap(bitmap, x, SkIntToScalar(bm.height() + 10), &paint); } - virtual void onDraw(SkCanvas* canvas) { - drawBG(canvas); - + virtual void onDrawContent(SkCanvas* canvas) { canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); draw2(canvas, fBM8); @@ -135,7 +131,7 @@ protected: } private: - typedef SkView INHERITED; + typedef SampleView INHERITED; }; ////////////////////////////////////////////////////////////////////////////// |
