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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 // | 35 // |
36 static void test_bitmaprect(SkCanvas* canvas) { | 36 static void test_bitmaprect(SkCanvas* canvas) { |
37 SkBitmap bm; | 37 SkBitmap bm; |
38 make_bm(&bm); | 38 make_bm(&bm); |
39 | 39 |
40 canvas->drawBitmap(bm, 150, 45, NULL); | 40 canvas->drawBitmap(bm, 150, 45, NULL); |
41 | 41 |
42 SkScalar scale = 0.472560018f; | 42 SkScalar scale = 0.472560018f; |
43 canvas->save(); | 43 canvas->save(); |
44 canvas->scale(scale, scale); | 44 canvas->scale(scale, scale); |
45 canvas->drawBitmapRectToRect(bm, NULL, SkRect::MakeXYWH(100, 100, 128, 128),
NULL); | 45 canvas->drawBitmapRect(bm, SkRect::MakeXYWH(100, 100, 128, 128)); |
46 canvas->restore(); | 46 canvas->restore(); |
47 | 47 |
48 canvas->scale(-1, 1); | 48 canvas->scale(-1, 1); |
49 canvas->drawBitmap(bm, -310, 45, NULL); | 49 canvas->drawBitmap(bm, -310, 45, NULL); |
50 } | 50 } |
51 | 51 |
52 class BitmapRectTestGM : public skiagm::GM { | 52 class BitmapRectTestGM : public skiagm::GM { |
53 public: | 53 public: |
54 BitmapRectTestGM() { | 54 BitmapRectTestGM() { |
55 | 55 |
(...skipping 12 matching lines...) Expand all Loading... |
68 test_bitmaprect(canvas); | 68 test_bitmaprect(canvas); |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
72 typedef skiagm::GM INHERITED; | 72 typedef skiagm::GM INHERITED; |
73 }; | 73 }; |
74 | 74 |
75 ////////////////////////////////////////////////////////////////////////////// | 75 ////////////////////////////////////////////////////////////////////////////// |
76 | 76 |
77 DEF_GM( return new BitmapRectTestGM; ) | 77 DEF_GM( return new BitmapRectTestGM; ) |
OLD | NEW |