OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 <memory> | 8 #include <memory> |
9 #include "SkColor.h" | 9 #include "SkColor.h" |
10 #include "SkLinearBitmapPipeline.h" | 10 #include "SkLinearBitmapPipeline.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 SkString name{"Orig"}; | 169 SkString name{"Orig"}; |
170 return name; | 170 return name; |
171 } | 171 } |
172 | 172 |
173 void onPreDraw(SkCanvas* c) override { | 173 void onPreDraw(SkCanvas* c) override { |
174 CommonBitmapFPBenchmark::onPreDraw(c); | 174 CommonBitmapFPBenchmark::onPreDraw(c); |
175 | 175 |
176 SkImage* image = SkImage::NewRasterCopy( | 176 SkImage* image = SkImage::NewRasterCopy( |
177 fInfo, fBitmap.get(), sizeof(SkPMColor) * fSrcSize.fWidth); | 177 fInfo, fBitmap.get(), sizeof(SkPMColor) * fSrcSize.fWidth); |
178 fImage.reset(image); | 178 fImage.reset(image); |
179 SkShader* shader = fImage->newShader(fXTile, fYTile); | 179 fPaint.setShader(fImage->makeShader(fXTile, fYTile)); |
180 if (fUseBilerp) { | 180 if (fUseBilerp) { |
181 fPaint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality); | 181 fPaint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality); |
182 } else { | 182 } else { |
183 fPaint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality); | 183 fPaint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality); |
184 } | 184 } |
185 fPaint.setShader(shader)->unref(); | |
186 } | 185 } |
187 | 186 |
188 void onPostDraw(SkCanvas*) override { | 187 void onPostDraw(SkCanvas*) override { |
189 | 188 |
190 } | 189 } |
191 | 190 |
192 void onDraw(int loops, SkCanvas*) override { | 191 void onDraw(int loops, SkCanvas*) override { |
193 int width = fSrcSize.fWidth; | 192 int width = fSrcSize.fWidth; |
194 int height = fSrcSize.fHeight; | 193 int height = fSrcSize.fHeight; |
195 | 194 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) | 287 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) |
289 | 288 |
290 DEF_BENCH(return new SkBitmapFPGeneral( | 289 DEF_BENCH(return new SkBitmapFPGeneral( |
291 srcSize, kLinear_SkColorProfileType, mR, true, | 290 srcSize, kLinear_SkColorProfileType, mR, true, |
292 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) | 291 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) |
293 | 292 |
294 DEF_BENCH(return new SkBitmapFPOrigShader( | 293 DEF_BENCH(return new SkBitmapFPOrigShader( |
295 srcSize, kLinear_SkColorProfileType, mR, true, | 294 srcSize, kLinear_SkColorProfileType, mR, true, |
296 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) | 295 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) |
297 | 296 |
OLD | NEW |