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/SampleEncode.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/SampleEncode.cpp')
-rw-r--r-- | samplecode/SampleEncode.cpp | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/samplecode/SampleEncode.cpp b/samplecode/SampleEncode.cpp index b09b2ebef6..f4ea1950aa 100644 --- a/samplecode/SampleEncode.cpp +++ b/samplecode/SampleEncode.cpp @@ -106,7 +106,7 @@ static void make_name(SkString* name, int config, int ext) { #include <sys/stat.h> -class EncodeView : public SkView { +class EncodeView : public SampleView { public: SkBitmap* fBitmaps; size_t fBitmapCount; @@ -140,6 +140,7 @@ public: fBitmaps = NULL; fBitmapCount = 0; #endif + this->setBGColor(0xFFDDDDDD); } virtual ~EncodeView() { @@ -156,38 +157,12 @@ protected: return this->INHERITED::onQuery(evt); } - void drawBG(SkCanvas* canvas) { - canvas->drawColor(0xFFDDDDDD); -// canvas->drawColor(SK_ColorWHITE); - } - - virtual void onDraw(SkCanvas* canvas) { - this->drawBG(canvas); - + virtual void onDrawContent(SkCanvas* canvas) { if (fBitmapCount == 0) { return; } SkPaint paint; - if (false) { -// SkColor colors[] = { 0xFE000000, SK_ColorWHITE }; - SkColor colors[] = { SK_ColorRED, SK_ColorBLUE }; - SkShader* shader = SkGradientShader::CreateSweep(SkIntToScalar(50), SkIntToScalar(50), - colors, NULL, 2); - paint.setShader(shader)->unref(); - - SkRect r; - r.set(0, 0, SkIntToScalar(100), SkIntToScalar(100)); - canvas->drawRect(r, paint); - - canvas->translate(SkIntToScalar(200), SkIntToScalar(200)); - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(SkIntToScalar(10)); - canvas->drawOval(r, paint); - return; - } - paint.setAntiAlias(true); paint.setTextAlign(SkPaint::kCenter_Align); @@ -238,12 +213,8 @@ protected: return this->INHERITED::onFindClickHandler(x, y); } - virtual bool onClick(Click* click) { - return this->INHERITED::onClick(click); - } - private: - typedef SkView INHERITED; + typedef SampleView INHERITED; }; ////////////////////////////////////////////////////////////////////////////// |