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

Side by Side Diff: gm/SkLinearBitmapPipelineGM.cpp

Issue 1719333002: tile spans (Closed) Base URL: https://skia.googlesource.com/skia.git@code-organization-speed
Patch Set: Address remaining comments. Created 4 years, 9 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 | src/core/SkLinearBitmapPipeline.cpp » ('j') | 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 "gm.h" 8 #include "gm.h"
9 #include "SkBlitter.h" 9 #include "SkBlitter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 SkBitmap bm; 137 SkBitmap bm;
138 fill_in_bits(bm, ir, c, true); 138 fill_in_bits(bm, ir, c, true);
139 139
140 canvas->drawBitmap(bm, r.left(), r.top(), nullptr); 140 canvas->drawBitmap(bm, r.left(), r.top(), nullptr);
141 } 141 }
142 142
143 /* 143 /*
144 * Test SkXfer4fProcs directly for src-over, comparing them to current SkColor blits. 144 * Test SkXfer4fProcs directly for src-over, comparing them to current SkColor blits.
145 */ 145 */
146 DEF_SIMPLE_GM(linear_pipeline, canvas, 580, 1400) { 146 DEF_SIMPLE_GM(linear_pipeline, canvas, 580, 2200) {
147 const int IW = 50; 147 const int IW = 50;
148 const SkScalar W = IW; 148 const SkScalar W = IW;
149 const SkScalar H = 100; 149 const SkScalar H = 100;
150 150
151 const SkColor colors[] = { 151 const SkColor colors[] = {
152 0x880000FF, 0x8800FF00, 0x88FF0000, 0x88000000, 152 0x880000FF, 0x8800FF00, 0x88FF0000, 0x88000000,
153 SK_ColorBLUE, SK_ColorGREEN, SK_ColorRED, SK_ColorBLACK, 153 SK_ColorBLUE, SK_ColorGREEN, SK_ColorRED, SK_ColorBLACK,
154 }; 154 };
155 155
156 canvas->translate(20, 20); 156 canvas->translate(20, 20);
157 157
158 SkMatrix mi = SkMatrix::I(); 158 SkMatrix mi = SkMatrix::I();
159 SkMatrix mlr;
160 mlr.setScale(-1.0f, 1.0f, 20, 0.0f);
159 SkMatrix mt; 161 SkMatrix mt;
160 mt.setTranslate(8, 8); 162 mt.setTranslate(8, 8);
163 SkMatrix mt2;
164 mt2.setTranslate(-18, -18);
161 SkMatrix ms; 165 SkMatrix ms;
162 ms.setScale(2.7f, 2.7f); 166 ms.setScale(2.7f, 2.7f);
167 SkMatrix ms2;
168 ms2.setScale(-0.2f, 0.2f);
163 SkMatrix mr; 169 SkMatrix mr;
164 mr.setRotate(10); 170 mr.setRotate(10);
165 171
166 const SkMatrix* mats[] = {nullptr, &mi, &mt, &ms, &mr}; 172 const SkMatrix* mats[] = {nullptr, &mi, &mlr, &mt, &mt2, &ms, &ms2, &mr};
167 173
168 const SkRect r = SkRect::MakeWH(W, H); 174 const SkRect r = SkRect::MakeWH(W, H);
169 bool useBilerp = false; 175 bool useBilerp = false;
170 while (true) { 176 while (true) {
171 canvas->save(); 177 canvas->save();
172 for (auto mat : mats) { 178 for (auto mat : mats) {
173 canvas->save(); 179 canvas->save();
174 for (SkColor c : colors) { 180 for (SkColor c : colors) {
175 if (mat == nullptr) { 181 if (mat == nullptr) {
176 SkPaint p; 182 SkPaint p;
(...skipping 11 matching lines...) Expand all
188 } 194 }
189 canvas->restore(); 195 canvas->restore();
190 canvas->translate(0, H + 20); 196 canvas->translate(0, H + 20);
191 } 197 }
192 canvas->restore(); 198 canvas->restore();
193 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); 199 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats));
194 if (useBilerp) break; 200 if (useBilerp) break;
195 useBilerp = true; 201 useBilerp = true;
196 } 202 }
197 } 203 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkLinearBitmapPipeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698