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 "SkImageSource.h" | 8 #include "SkImageSource.h" |
9 #include "SkSurface.h" | 9 #include "SkSurface.h" |
10 #include "SkTileImageFilter.h" | 10 #include "SkTileImageFilter.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 SkRect bound3 = SkRect::MakeXYWH(320, 320, | 87 SkRect bound3 = SkRect::MakeXYWH(320, 320, |
88 SkIntToScalar(kBitmapSize), | 88 SkIntToScalar(kBitmapSize), |
89 SkIntToScalar(kBitmapSize)); | 89 SkIntToScalar(kBitmapSize)); |
90 canvas->drawImageRect(fGreenImage.get(), bound2, bound3, nullptr, | 90 canvas->drawImageRect(fGreenImage.get(), bound2, bound3, nullptr, |
91 SkCanvas::kStrict_SrcRectConstraint); | 91 SkCanvas::kStrict_SrcRectConstraint); |
92 canvas->restore(); | 92 canvas->restore(); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 private: | 96 private: |
97 static const int kWidth = 512; | 97 static constexpr int kWidth = 512; |
98 static const int kHeight = 512; | 98 static constexpr int kHeight = 512; |
99 static const int kBitmapSize = 64; | 99 static constexpr int kBitmapSize = 64; |
100 | 100 |
101 sk_sp<SkImage> fRedImage; | 101 sk_sp<SkImage> fRedImage; |
102 sk_sp<SkImage> fGreenImage; | 102 sk_sp<SkImage> fGreenImage; |
103 | 103 |
104 typedef GM INHERITED; | 104 typedef GM INHERITED; |
105 }; | 105 }; |
106 | 106 |
107 ////////////////////////////////////////////////////////////////////////////// | 107 ////////////////////////////////////////////////////////////////////////////// |
108 | 108 |
109 DEF_GM(return new BigTileImageFilterGM;) | 109 DEF_GM(return new BigTileImageFilterGM;) |
110 } | 110 } |
OLD | NEW |