aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-18 19:20:52 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-18 19:20:52 +0000
commitc51f752554f1f84d8f49b8cc00537b7d4cdb355b (patch)
tree05ec1e092ff3ee12570db34156b8c49e1f54f317 /gm
parent407f8da4f48a581927d75381bdbb65f01203fe40 (diff)
Reverting chain of SkBicubicImageFilter changes (7275, 7276, 7280 & 7283)
git-svn-id: http://skia.googlecode.com/svn/trunk@7285 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r--gm/bicubicfilter.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/gm/bicubicfilter.cpp b/gm/bicubicfilter.cpp
deleted file mode 100644
index c3f80df118..0000000000
--- a/gm/bicubicfilter.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "gm.h"
-#include "SkColor.h"
-#include "SkBicubicImageFilter.h"
-
-namespace skiagm {
-
-class BicubicGM : public GM {
-public:
- BicubicGM() : fInitialized(false) {
- this->setBGColor(0x00000000);
- }
-
-protected:
- virtual SkString onShortName() {
- return SkString("bicubicfilter");
- }
-
- void make_checkerboard(int width, int height) {
- SkASSERT(width % 2 == 0);
- SkASSERT(height % 2 == 0);
- fCheckerboard.setConfig(SkBitmap::kARGB_8888_Config, width, height);
- fCheckerboard.allocPixels();
- SkAutoLockPixels lock(fCheckerboard);
- for (int y = 0; y < height; y += 2) {
- SkPMColor* s = fCheckerboard.getAddr32(0, y);
- for (int x = 0; x < width; x += 2) {
- *s++ = 0xFFFFFFFF;
- *s++ = 0xFF000000;
- }
- s = fCheckerboard.getAddr32(0, y + 1);
- for (int x = 0; x < width; x += 2) {
- *s++ = 0xFF000000;
- *s++ = 0xFFFFFFFF;
- }
- }
- }
-
- virtual SkISize onISize() {
- return make_isize(400, 300);
- }
-
- virtual void onDraw(SkCanvas* canvas) {
- if (!fInitialized) {
- make_checkerboard(4, 4);
- fInitialized = true;
- }
- SkScalar sk32 = SkIntToScalar(32);
- canvas->clear(0x00000000);
- SkPaint bilinearPaint, bicubicPaint;
- SkSize scale = SkSize::Make(sk32, sk32);
- canvas->save();
- canvas->scale(sk32, sk32);
- bilinearPaint.setFilterBitmap(true);
- canvas->drawBitmap(fCheckerboard, 0, 0, &bilinearPaint);
- canvas->restore();
- SkAutoTUnref<SkImageFilter> bicubic(SkBicubicImageFilter::CreateMitchell(scale));
- bicubicPaint.setImageFilter(bicubic);
- SkRect srcBounds;
- fCheckerboard.getBounds(&srcBounds);
- canvas->translate(SkIntToScalar(140), 0);
- canvas->saveLayer(&srcBounds, &bicubicPaint);
- canvas->drawBitmap(fCheckerboard, 0, 0);
- canvas->restore();
- }
-
-private:
- typedef GM INHERITED;
- SkBitmap fCheckerboard;
- bool fInitialized;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new BicubicGM; }
-static GMRegistry reg(MyFactory);
-
-}