| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkColor.h" | 9 #include "SkColor.h" |
| 10 #include "SkMatrixImageFilter.h" | 10 #include "SkMatrixImageFilter.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 SkAutoTUnref<SkImageFilter> imageFilter( | 27 SkAutoTUnref<SkImageFilter> imageFilter( |
| 28 SkMatrixImageFilter::Create(matrix, filterLevel)); | 28 SkMatrixImageFilter::Create(matrix, filterLevel)); |
| 29 SkPaint paint; | 29 SkPaint paint; |
| 30 paint.setImageFilter(imageFilter.get()); | 30 paint.setImageFilter(imageFilter.get()); |
| 31 canvas->saveLayer(&rect, &paint); | 31 canvas->saveLayer(&rect, &paint); |
| 32 canvas->drawBitmap(bitmap, 0, 0); | 32 canvas->drawBitmap(bitmap, 0, 0); |
| 33 canvas->restore(); | 33 canvas->restore(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual SkISize onISize() { | 36 virtual SkISize onISize() { |
| 37 return make_isize(420, 100); | 37 return SkISize::Make(420, 100); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void make_checkerboard(SkBitmap* bitmap) { | 40 void make_checkerboard(SkBitmap* bitmap) { |
| 41 bitmap->allocN32Pixels(64, 64); | 41 bitmap->allocN32Pixels(64, 64); |
| 42 SkCanvas canvas(*bitmap); | 42 SkCanvas canvas(*bitmap); |
| 43 SkPaint darkPaint; | 43 SkPaint darkPaint; |
| 44 darkPaint.setColor(0xFF404040); | 44 darkPaint.setColor(0xFF404040); |
| 45 SkPaint lightPaint; | 45 SkPaint lightPaint; |
| 46 lightPaint.setColor(0xFFA0A0A0); | 46 lightPaint.setColor(0xFFA0A0A0); |
| 47 for (int y = 0; y < 64; y += 32) { | 47 for (int y = 0; y < 64; y += 32) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 private: | 86 private: |
| 87 typedef GM INHERITED; | 87 typedef GM INHERITED; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 ////////////////////////////////////////////////////////////////////////////// | 90 ////////////////////////////////////////////////////////////////////////////// |
| 91 | 91 |
| 92 static GM* MyFactory(void*) { return new MatrixImageFilterGM; } | 92 static GM* MyFactory(void*) { return new MatrixImageFilterGM; } |
| 93 static GMRegistry reg(MyFactory); | 93 static GMRegistry reg(MyFactory); |
| 94 | 94 |
| 95 } | 95 } |
| OLD | NEW |