Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: bench/SkBlend_optsBench.cpp

Issue 1967803002: Use proper color type for assert. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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")
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698