| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 | 9 |
| 10 namespace skiagm { | 10 namespace skiagm { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 FilterGM() : fOnce(false) { | 95 FilterGM() : fOnce(false) { |
| 96 this->setBGColor(0xFFDDDDDD); | 96 this->setBGColor(0xFFDDDDDD); |
| 97 } | 97 } |
| 98 | 98 |
| 99 protected: | 99 protected: |
| 100 virtual SkString onShortName() { | 100 virtual SkString onShortName() { |
| 101 return SkString("bitmapfilters"); | 101 return SkString("bitmapfilters"); |
| 102 } | 102 } |
| 103 | 103 |
| 104 virtual SkISize onISize() { | 104 virtual SkISize onISize() { |
| 105 return make_isize(540, 330); | 105 return SkISize::Make(540, 330); |
| 106 } | 106 } |
| 107 | 107 |
| 108 virtual void onDraw(SkCanvas* canvas) { | 108 virtual void onDraw(SkCanvas* canvas) { |
| 109 this->init(); | 109 this->init(); |
| 110 | 110 |
| 111 SkScalar x = SkIntToScalar(10); | 111 SkScalar x = SkIntToScalar(10); |
| 112 SkScalar y = SkIntToScalar(10); | 112 SkScalar y = SkIntToScalar(10); |
| 113 | 113 |
| 114 canvas->translate(x, y); | 114 canvas->translate(x, y); |
| 115 y = draw_row(canvas, fBM8); | 115 y = draw_row(canvas, fBM8); |
| 116 canvas->translate(0, y); | 116 canvas->translate(0, y); |
| 117 y = draw_row(canvas, fBM4444); | 117 y = draw_row(canvas, fBM4444); |
| 118 canvas->translate(0, y); | 118 canvas->translate(0, y); |
| 119 y = draw_row(canvas, fBM16); | 119 y = draw_row(canvas, fBM16); |
| 120 canvas->translate(0, y); | 120 canvas->translate(0, y); |
| 121 draw_row(canvas, fBM32); | 121 draw_row(canvas, fBM32); |
| 122 } | 122 } |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 typedef GM INHERITED; | 125 typedef GM INHERITED; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 ////////////////////////////////////////////////////////////////////////////// | 128 ////////////////////////////////////////////////////////////////////////////// |
| 129 | 129 |
| 130 static GM* MyFactory(void*) { return new FilterGM; } | 130 static GM* MyFactory(void*) { return new FilterGM; } |
| 131 static GMRegistry reg(MyFactory); | 131 static GMRegistry reg(MyFactory); |
| 132 | 132 |
| 133 } | 133 } |
| OLD | NEW |