OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2016 Google Inc. | 3 * Copyright 2016 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 canvas->save(); | 157 canvas->save(); |
158 canvas->scale(s, s); | 158 canvas->scale(s, s); |
159 for (auto q : kQualities) { | 159 for (auto q : kQualities) { |
160 SkPaint plainPaint; | 160 SkPaint plainPaint; |
161 plainPaint.setFilterQuality(q); | 161 plainPaint.setFilterQuality(q); |
162 canvas->drawImage(rectImg, 0, 0, &plainPaint); | 162 canvas->drawImage(rectImg, 0, 0, &plainPaint); |
163 canvas->translate(kWidth + kPad, 0); | 163 canvas->translate(kWidth + kPad, 0); |
164 | 164 |
165 SkPaint clampPaint; | 165 SkPaint clampPaint; |
166 clampPaint.setFilterQuality(q); | 166 clampPaint.setFilterQuality(q); |
167 clampPaint.setShader(rectImg->newShader(SkShader::kClamp_Til
eMode, | 167 clampPaint.setShader(rectImg->makeShader(SkShader::kClamp_Ti
leMode, |
168 SkShader::kClamp_Til
eMode))->unref(); | 168 SkShader::kClamp_Ti
leMode)); |
169 canvas->drawRect(SkRect::MakeWH(1.5f * kWidth, 1.5f * kHeigh
t), clampPaint); | 169 canvas->drawRect(SkRect::MakeWH(1.5f * kWidth, 1.5f * kHeigh
t), clampPaint); |
170 canvas->translate(kWidth * 1.5f + kPad, 0); | 170 canvas->translate(kWidth * 1.5f + kPad, 0); |
171 | 171 |
172 SkPaint repeatPaint; | 172 SkPaint repeatPaint; |
173 repeatPaint.setFilterQuality(q); | 173 repeatPaint.setFilterQuality(q); |
174 repeatPaint.setShader(rectImg->newShader(SkShader::kRepeat_T
ileMode, | 174 repeatPaint.setShader(rectImg->makeShader(SkShader::kRepeat_
TileMode, |
175 SkShader::kMirror_T
ileMode))->unref(); | 175 SkShader::kMirror_
TileMode)); |
176 canvas->drawRect(SkRect::MakeWH(1.5f * kWidth, 1.5f * kHeigh
t), repeatPaint); | 176 canvas->drawRect(SkRect::MakeWH(1.5f * kWidth, 1.5f * kHeigh
t), repeatPaint); |
177 canvas->translate(1.5f * kWidth + kPad, 0); | 177 canvas->translate(1.5f * kWidth + kPad, 0); |
178 } | 178 } |
179 canvas->restore(); | 179 canvas->restore(); |
180 canvas->translate(0, kPad + 1.5f * kHeight * s); | 180 canvas->translate(0, kPad + 1.5f * kHeight * s); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 private: | 184 private: |
185 typedef GM INHERITED; | 185 typedef GM INHERITED; |
186 }; | 186 }; |
187 | 187 |
188 DEF_GM(return new RectangleTexture;) | 188 DEF_GM(return new RectangleTexture;) |
189 } | 189 } |
190 | 190 |
191 #endif | 191 #endif |
OLD | NEW |