diff options
-rw-r--r-- | gm/ninepatchstretch.cpp | 26 | ||||
-rw-r--r-- | samplecode/SampleApp.cpp | 13 | ||||
-rw-r--r-- | samplecode/SampleCode.h | 2 |
3 files changed, 5 insertions, 36 deletions
diff --git a/gm/ninepatchstretch.cpp b/gm/ninepatchstretch.cpp index bc6f13da25..94b2d59f28 100644 --- a/gm/ninepatchstretch.cpp +++ b/gm/ninepatchstretch.cpp @@ -7,30 +7,14 @@ #include "gm.h" -#if SK_SUPPORT_GPU -#include "SkGpuDevice.h" -#else -class GrContext; -#endif - -static void make_bitmap(SkBitmap* bitmap, GrContext* ctx, SkIRect* center) { - SkBaseDevice* dev; - +static void make_bitmap(SkBitmap* bitmap, SkIRect* center) { const int kFixed = 28; const int kStretchy = 8; const int kSize = 2*kFixed + kStretchy; -#if SK_SUPPORT_GPU - if (ctx) { - dev = new SkGpuDevice(ctx, SkBitmap::kARGB_8888_Config, kSize, kSize); - *bitmap = dev->accessBitmap(false); - } else -#endif - { - bitmap->setConfig(SkBitmap::kARGB_8888_Config, kSize, kSize); - bitmap->allocPixels(); - dev = new SkBitmapDevice(*bitmap); - } + bitmap->setConfig(SkBitmap::kARGB_8888_Config, kSize, kSize); + bitmap->allocPixels(); + SkBaseDevice* dev = new SkBitmapDevice(*bitmap); SkCanvas canvas(dev); dev->unref(); @@ -75,7 +59,7 @@ protected: virtual void onDraw(SkCanvas* canvas) { SkBitmap bm; SkIRect center; - make_bitmap(&bm, NULL /*SampleCode::GetGr()*/, ¢er); + make_bitmap(&bm, ¢er); // amount of bm that should not be stretched (unless we have to) const SkScalar fixed = SkIntToScalar(bm.width() - center.width()); diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index d5fe18217f..127646d0d7 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -642,19 +642,6 @@ SkScalar SampleCode::GetAnimSinScalar(SkScalar amplitude, return SkScalarMul(amplitude, SkDoubleToScalar(sin(t))) + amplitude; } -GrContext* SampleCode::GetGr() { - return gSampleWindow ? gSampleWindow->getGrContext() : NULL; -} - -// some GMs rely on having a skiagm::GetGr function defined -namespace skiagm { - // FIXME: this should be moved into a header - GrContext* GetGr(); - GrContext* GetGr() { return SampleCode::GetGr(); } -} - -////////////////////////////////////////////////////////////////////////////// - enum TilingMode { kNo_Tiling, kAbs_128x128_Tiling, diff --git a/samplecode/SampleCode.h b/samplecode/SampleCode.h index afca4d2de8..7c0452a90a 100644 --- a/samplecode/SampleCode.h +++ b/samplecode/SampleCode.h @@ -39,8 +39,6 @@ public: static SkScalar GetAnimSinScalar(SkScalar amplitude, SkScalar periodInSec, SkScalar phaseInSec = 0); - - static GrContext* GetGr(); }; ////////////////////////////////////////////////////////////////////////////// |