OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkBitmapSource.h" | 8 #include "SkBitmapSource.h" |
9 #include "SkTileImageFilter.h" | 9 #include "SkTileImageFilter.h" |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 NULL)); | 77 NULL)); |
78 p2.setImageFilter(tif2); | 78 p2.setImageFilter(tif2); |
79 | 79 |
80 canvas->translate(320, 320); | 80 canvas->translate(320, 320); |
81 canvas->saveLayer(&bound2, &p2); | 81 canvas->saveLayer(&bound2, &p2); |
82 canvas->setMatrix(SkMatrix::I()); | 82 canvas->setMatrix(SkMatrix::I()); |
83 | 83 |
84 SkRect bound3 = SkRect::MakeXYWH(320, 320, | 84 SkRect bound3 = SkRect::MakeXYWH(320, 320, |
85 SkIntToScalar(kBitmapSize), | 85 SkIntToScalar(kBitmapSize), |
86 SkIntToScalar(kBitmapSize)); | 86 SkIntToScalar(kBitmapSize)); |
87 canvas->drawBitmapRectToRect(fGreenBitmap, &bound2, bound3); | 87 canvas->drawBitmapRect(fGreenBitmap, &bound2, bound3, NULL, |
| 88 SkCanvas::kStrict_SrcRectConstraint); |
88 canvas->restore(); | 89 canvas->restore(); |
89 } | 90 } |
90 } | 91 } |
91 | 92 |
92 private: | 93 private: |
93 static const int kWidth = 512; | 94 static const int kWidth = 512; |
94 static const int kHeight = 512; | 95 static const int kHeight = 512; |
95 static const int kBitmapSize = 64; | 96 static const int kBitmapSize = 64; |
96 | 97 |
97 SkBitmap fRedBitmap; | 98 SkBitmap fRedBitmap; |
98 SkBitmap fGreenBitmap; | 99 SkBitmap fGreenBitmap; |
99 | 100 |
100 typedef GM INHERITED; | 101 typedef GM INHERITED; |
101 }; | 102 }; |
102 | 103 |
103 ////////////////////////////////////////////////////////////////////////////// | 104 ////////////////////////////////////////////////////////////////////////////// |
104 | 105 |
105 DEF_GM( return SkNEW(BigTileImageFilterGM); ) | 106 DEF_GM( return SkNEW(BigTileImageFilterGM); ) |
106 | 107 |
107 } | 108 } |
OLD | NEW |