| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkArithmeticMode.h" | 9 #include "SkArithmeticMode.h" |
| 10 #include "SkOffsetImageFilter.h" | 10 #include "SkOffsetImageFilter.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 canvas.drawRect(SkRect::MakeXYWH(0, 0, 8, 8), darkPaint); | 55 canvas.drawRect(SkRect::MakeXYWH(0, 0, 8, 8), darkPaint); |
| 56 canvas.drawRect(SkRect::MakeXYWH(8, 0, 8, 8), lightPaint); | 56 canvas.drawRect(SkRect::MakeXYWH(8, 0, 8, 8), lightPaint); |
| 57 canvas.drawRect(SkRect::MakeXYWH(0, 8, 8, 8), lightPaint); | 57 canvas.drawRect(SkRect::MakeXYWH(0, 8, 8, 8), lightPaint); |
| 58 canvas.drawRect(SkRect::MakeXYWH(8, 8, 8, 8), darkPaint); | 58 canvas.drawRect(SkRect::MakeXYWH(8, 8, 8, 8), darkPaint); |
| 59 canvas.restore(); | 59 canvas.restore(); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual SkISize onISize() SK_OVERRIDE { | 64 virtual SkISize onISize() SK_OVERRIDE { |
| 65 return make_isize(WIDTH, HEIGHT); | 65 return SkISize::Make(WIDTH, HEIGHT); |
| 66 } | 66 } |
| 67 | 67 |
| 68 static void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, cons
t SkPaint& paint, | 68 static void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, cons
t SkPaint& paint, |
| 69 int x, int y) { | 69 int x, int y) { |
| 70 canvas->save(); | 70 canvas->save(); |
| 71 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); | 71 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); |
| 72 canvas->clipRect(SkRect::MakeWH( | 72 canvas->clipRect(SkRect::MakeWH( |
| 73 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); | 73 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); |
| 74 canvas->drawBitmap(bitmap, 0, 0, &paint); | 74 canvas->drawBitmap(bitmap, 0, 0, &paint); |
| 75 canvas->restore(); | 75 canvas->restore(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 private: | 217 private: |
| 218 SkBitmap fBitmap, fCheckerboard; | 218 SkBitmap fBitmap, fCheckerboard; |
| 219 typedef GM INHERITED; | 219 typedef GM INHERITED; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 ////////////////////////////////////////////////////////////////////////////// | 222 ////////////////////////////////////////////////////////////////////////////// |
| 223 | 223 |
| 224 DEF_GM( return new XfermodeImageFilterGM; ); | 224 DEF_GM( return new XfermodeImageFilterGM; ); |
| 225 | 225 |
| 226 } | 226 } |
| OLD | NEW |