| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkMorphologyImageFilter.h" | 9 #include "SkMorphologyImageFilter.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 paint.setAntiAlias(true); | 33 paint.setAntiAlias(true); |
| 34 const char* str1 = "ABC"; | 34 const char* str1 = "ABC"; |
| 35 const char* str2 = "XYZ"; | 35 const char* str2 = "XYZ"; |
| 36 paint.setColor(0xFFFFFFFF); | 36 paint.setColor(0xFFFFFFFF); |
| 37 paint.setTextSize(64); | 37 paint.setTextSize(64); |
| 38 canvas.drawText(str1, strlen(str1), 10, 55, paint); | 38 canvas.drawText(str1, strlen(str1), 10, 55, paint); |
| 39 canvas.drawText(str2, strlen(str2), 10, 110, paint); | 39 canvas.drawText(str2, strlen(str2), 10, 110, paint); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual SkISize onISize() { | 42 virtual SkISize onISize() { |
| 43 return make_isize(WIDTH, HEIGHT); | 43 return SkISize::Make(WIDTH, HEIGHT); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void drawClippedBitmap(SkCanvas* canvas, const SkPaint& paint, int x, int y)
{ | 46 void drawClippedBitmap(SkCanvas* canvas, const SkPaint& paint, int x, int y)
{ |
| 47 canvas->save(); | 47 canvas->save(); |
| 48 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); | 48 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); |
| 49 canvas->clipRect(SkRect::MakeWH( | 49 canvas->clipRect(SkRect::MakeWH( |
| 50 SkIntToScalar(fBitmap.width()), SkIntToScalar(fBitmap.height()))); | 50 SkIntToScalar(fBitmap.width()), SkIntToScalar(fBitmap.height()))); |
| 51 canvas->drawBitmap(fBitmap, 0, 0, &paint); | 51 canvas->drawBitmap(fBitmap, 0, 0, &paint); |
| 52 canvas->restore(); | 52 canvas->restore(); |
| 53 } | 53 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 SkBitmap fBitmap; | 96 SkBitmap fBitmap; |
| 97 bool fOnce; | 97 bool fOnce; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 ////////////////////////////////////////////////////////////////////////////// | 100 ////////////////////////////////////////////////////////////////////////////// |
| 101 | 101 |
| 102 static GM* MyFactory(void*) { return new MorphologyGM; } | 102 static GM* MyFactory(void*) { return new MorphologyGM; } |
| 103 static GMRegistry reg(MyFactory); | 103 static GMRegistry reg(MyFactory); |
| 104 | 104 |
| 105 } | 105 } |
| OLD | NEW |