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

Side by Side Diff: gm/gradients.cpp

Issue 1109883003: Revert of Mike's radial gradient CL with better float -> int. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | src/core/SkNx.h » ('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 2011 Google Inc. 2 * Copyright 2011 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 441
442 SkISize onISize() override { return SkISize::Make(500, 500); } 442 SkISize onISize() override { return SkISize::Make(500, 500); }
443 443
444 bool runAsBench() const override { return true; } 444 bool runAsBench() const override { return true; }
445 445
446 void onOnceBeforeDraw() override { 446 void onOnceBeforeDraw() override {
447 const SkPoint center = { 0, 0 }; 447 const SkPoint center = { 0, 0 };
448 const SkScalar kRadius = 3000; 448 const SkScalar kRadius = 3000;
449 const SkColor gColors[] = { 0xFFFFFFFF, 0xFF000000 }; 449 const SkColor gColors[] = { 0xFFFFFFFF, 0xFF000000 };
450 fShader.reset(SkGradientShader::CreateRadial(center, kRadius, gColors, N ULL, 2, 450 fShader.reset(SkGradientShader::CreateRadial(center, kRadius, gColors, N ULL, 2,
451 SkShader::kClamp_TileMode)) ; 451 SkShader::kClamp_TileMode));
452 } 452 }
453 453
454 void onDraw(SkCanvas* canvas) override { 454 void onDraw(SkCanvas* canvas) override {
455 SkPaint paint; 455 SkPaint paint;
456 paint.setShader(fShader); 456 paint.setShader(fShader);
457 canvas->drawRect(SkRect::MakeWH(500, 500), paint); 457 canvas->drawRect(SkRect::MakeWH(500, 500), paint);
458 } 458 }
459 459
460 private: 460 private:
461 typedef GM INHERITED; 461 typedef GM INHERITED;
462 }; 462 };
463 DEF_GM( return new RadialGradient3GM; ) 463 DEF_GM( return new RadialGradient3GM; )
464 464
465 } 465 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkNx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698