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

Side by Side Diff: gm/gradients_2pt_conical.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify xfermodes, fix SkLayerDrawLooper Created 6 years, 4 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 | gm/imagefiltersbase.cpp » ('j') | include/core/SkFlattenable.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 10
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 { SkIntToScalar(100), SkIntToScalar(100) } 325 { SkIntToScalar(100), SkIntToScalar(100) }
326 }; 326 };
327 SkShader::TileMode tm = SkShader::kClamp_TileMode; 327 SkShader::TileMode tm = SkShader::kClamp_TileMode;
328 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(100) }; 328 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(100) };
329 SkPaint paint; 329 SkPaint paint;
330 paint.setAntiAlias(true); 330 paint.setAntiAlias(true);
331 331
332 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); 332 canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
333 333
334 const GradMaker* gradMaker = gGradCases[fGradCaseType].fMaker; 334 const GradMaker* gradMaker = gGradCases[fGradCaseType].fMaker;
335 const int count = gGradCases[fGradCaseType].fCount; 335 const int count = gGradCases[fGradCaseType].fCount;
sugoi1 2014/08/19 18:46:16 This may have been mentioned earlier in the review
336 336
337 for (size_t i = 0; i < SK_ARRAY_COUNT(gGradData); i++) { 337 for (size_t i = 0; i < SK_ARRAY_COUNT(gGradData); i++) {
338 canvas->save(); 338 canvas->save();
robertphillips 2014/08/19 15:23:27 Why are we skipping these cases now ?
reed1 2014/08/19 19:58:05 debugging. fixed.
339 for (int j = 0; j < count; j++) { 339 for (int j = 1; j < 2+0*count; j++) {
340 SkMatrix scale = SkMatrix::I(); 340 SkMatrix scale = SkMatrix::I();
341 341
342 if (i == 3) { // if the clamp case 342 if (i == 3) { // if the clamp case
343 scale.setScale(0.5f, 0.5f); 343 scale.setScale(0.5f, 0.5f);
344 scale.postTranslate(25.f, 25.f); 344 scale.postTranslate(25.f, 25.f);
345 } 345 }
346 346
347 SkShader* shader = gradMaker[j](pts, gGradData[i], tm, scale); 347 SkShader* shader = gradMaker[j](pts, gGradData[i], tm, scale);
348 paint.setShader(shader); 348 paint.setShader(shader);
349 canvas->drawRect(r, paint); 349 canvas->drawRect(r, paint);
(...skipping 15 matching lines...) Expand all
365 365
366 static GM* MyFactory1(void*) { return new ConicalGradientsGM(kInside_GradCaseTyp e); } 366 static GM* MyFactory1(void*) { return new ConicalGradientsGM(kInside_GradCaseTyp e); }
367 static GMRegistry reg1(MyFactory1); 367 static GMRegistry reg1(MyFactory1);
368 368
369 static GM* MyFactory2(void*) { return new ConicalGradientsGM(kOutside_GradCaseTy pe); } 369 static GM* MyFactory2(void*) { return new ConicalGradientsGM(kOutside_GradCaseTy pe); }
370 static GMRegistry reg2(MyFactory2); 370 static GMRegistry reg2(MyFactory2);
371 371
372 static GM* MyFactory3(void*) { return new ConicalGradientsGM(kEdge_GradCaseType) ; } 372 static GM* MyFactory3(void*) { return new ConicalGradientsGM(kEdge_GradCaseType) ; }
373 static GMRegistry reg3(MyFactory3); 373 static GMRegistry reg3(MyFactory3);
374 } 374 }
OLDNEW
« no previous file with comments | « no previous file | gm/imagefiltersbase.cpp » ('j') | include/core/SkFlattenable.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698