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 <tuple> | 8 #include <tuple> |
9 | 9 |
10 #include "Benchmark.h" | 10 #include "Benchmark.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 fDst.reset(fCount); | 108 fDst.reset(fCount); |
109 | 109 |
110 } | 110 } |
111 | 111 |
112 protected: | 112 protected: |
113 bool isSuitableFor(Backend backend) override { | 113 bool isSuitableFor(Backend backend) override { |
114 return backend == kNonRendering_Backend && Blender::WorksOnCpu(); | 114 return backend == kNonRendering_Backend && Blender::WorksOnCpu(); |
115 } | 115 } |
116 const char* onGetName() override { return fName.c_str(); } | 116 const char* onGetName() override { return fName.c_str(); } |
117 void onDraw(int loops, SkCanvas*) override { | 117 void onDraw(int loops, SkCanvas*) override { |
118 SkASSERT(fPixmap.colorType() == kRGBA_8888_SkColorType); | 118 SkASSERT(fPixmap.colorType() == kN32_SkColorType); |
119 | 119 |
120 const int width = fPixmap.rowBytesAsPixels(); | 120 const int width = fPixmap.rowBytesAsPixels(); |
121 | 121 |
122 for (int i = 0; i < loops * INNER_LOOPS; ++i) { | 122 for (int i = 0; i < loops * INNER_LOOPS; ++i) { |
123 const uint32_t* src = fPixmap.addr32(); | 123 const uint32_t* src = fPixmap.addr32(); |
124 for (int y = 0; y < fPixmap.height(); y++) { | 124 for (int y = 0; y < fPixmap.height(); y++) { |
125 Blender::BlendN(fDst.get(), width, src); | 125 Blender::BlendN(fDst.get(), width, src); |
126 src += width; | 126 src += width; |
127 } | 127 } |
128 } | 128 } |
(...skipping 29 matching lines...) Expand all Loading... |
158 DEF_BENCH( return new LinearSrcOverBench<SrcOverVSkOptsTrivial>(fileName); )
\ | 158 DEF_BENCH( return new LinearSrcOverBench<SrcOverVSkOptsTrivial>(fileName); )
\ |
159 DEF_BENCH( return new LinearSrcOverBench<SrcOverVSkOptsNonSimdCore>(fileName); )
\ | 159 DEF_BENCH( return new LinearSrcOverBench<SrcOverVSkOptsNonSimdCore>(fileName); )
\ |
160 DEF_BENCH( return new LinearSrcOverBench<SrcOverVSkOptsDefault>(fileName); ) | 160 DEF_BENCH( return new LinearSrcOverBench<SrcOverVSkOptsDefault>(fileName); ) |
161 #endif | 161 #endif |
162 | 162 |
163 BENCHES("yellow_rose.png") | 163 BENCHES("yellow_rose.png") |
164 BENCHES("baby_tux.png") | 164 BENCHES("baby_tux.png") |
165 BENCHES("plane.png") | 165 BENCHES("plane.png") |
166 BENCHES("mandrill_512.png") | 166 BENCHES("mandrill_512.png") |
167 BENCHES("iconstrip.png") | 167 BENCHES("iconstrip.png") |
OLD | NEW |