diff options
Diffstat (limited to 'samplecode/SampleBlur.cpp')
-rw-r--r-- | samplecode/SampleBlur.cpp | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/samplecode/SampleBlur.cpp b/samplecode/SampleBlur.cpp index a2f90a7746..507c57e29d 100644 --- a/samplecode/SampleBlur.cpp +++ b/samplecode/SampleBlur.cpp @@ -14,45 +14,10 @@ #include "SkUtils.h" #include "SkView.h" -static SkBitmap make_bitmap() { - SkPMColor c[256]; - for (int i = 0; i < 256; i++) { - c[i] = SkPackARGB32(255 - i, 0, 0, 0); - } - - SkBitmap bm; - bm.allocPixels(SkImageInfo::Make(256, 256, kIndex_8_SkColorType, - kPremul_SkAlphaType), - SkColorTable::Make(c, 256)); - - const float cx = bm.width() * 0.5f; - const float cy = bm.height() * 0.5f; - for (int y = 0; y < bm.height(); y++) { - float dy = y - cy; - dy *= dy; - uint8_t* p = bm.getAddr8(0, y); - for (int x = 0; x < 256; x++) { - float dx = x - cx; - dx *= dx; - float d = (dx + dy) / (cx/2); - int id = (int)d; - if (id > 255) { - id = 255; - } - p[x] = id; - } - } - return bm; -} - class BlurView : public SampleView { SkBitmap fBM; public: - BlurView() { - if (false) { // avoid bit rot, suppress warning - fBM = make_bitmap(); - } - } + BlurView() {} protected: // overrides from SkEventSink |