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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void onPostDraw(SkCanvas*) override { | 188 void onPostDraw(SkCanvas*) override { |
189 | 189 |
190 } | 190 } |
191 | 191 |
192 void onDraw(int loops, SkCanvas*) override { | 192 void onDraw(int loops, SkCanvas*) override { |
193 int width = fSrcSize.fWidth; | 193 int width = fSrcSize.fWidth; |
194 int height = fSrcSize.fHeight; | 194 int height = fSrcSize.fHeight; |
195 | 195 |
196 SkAutoTMalloc<SkPMColor> buffer4b(width*height); | 196 SkAutoTMalloc<SkPMColor> buffer4b(width*height); |
197 | 197 |
198 uint32_t storage[200]; | 198 uint32_t storage[300]; |
199 const SkShader::ContextRec rec(fPaint, fM, nullptr, | 199 const SkShader::ContextRec rec(fPaint, fM, nullptr, |
200 SkShader::ContextRec::kPMColor_DstType); | 200 SkShader::ContextRec::kPMColor_DstType); |
201 SkASSERT(fPaint.getShader()->contextSize(rec) <= sizeof(storage)); | 201 SkASSERT(fPaint.getShader()->contextSize(rec) <= sizeof(storage)); |
202 SkShader::Context* ctx = fPaint.getShader()->createContext(rec, storage)
; | 202 SkShader::Context* ctx = fPaint.getShader()->createContext(rec, storage)
; |
203 | 203 |
204 int count = 100; | 204 int count = 100; |
205 | 205 |
206 for (int n = 0; n < 1000*loops; n++) { | 206 for (int n = 0; n < 1000*loops; n++) { |
207 ctx->shadeSpan(3, 6, buffer4b, count); | 207 ctx->shadeSpan(3, 6, buffer4b, count); |
208 } | 208 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) | 288 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) |
289 | 289 |
290 DEF_BENCH(return new SkBitmapFPGeneral( | 290 DEF_BENCH(return new SkBitmapFPGeneral( |
291 srcSize, kLinear_SkColorProfileType, mR, true, | 291 srcSize, kLinear_SkColorProfileType, mR, true, |
292 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) | 292 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) |
293 | 293 |
294 DEF_BENCH(return new SkBitmapFPOrigShader( | 294 DEF_BENCH(return new SkBitmapFPOrigShader( |
295 srcSize, kLinear_SkColorProfileType, mR, true, | 295 srcSize, kLinear_SkColorProfileType, mR, true, |
296 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) | 296 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);) |
297 | 297 |
OLD | NEW |