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

Unified Diff: gm/reveal.cpp

Issue 2344963002: Fix color bug in SkRRectsGaussianEdgeShader (Closed)
Patch Set: Add new constant to GM Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/effects/SkRRectsGaussianEdgeShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/reveal.cpp
diff --git a/gm/reveal.cpp b/gm/reveal.cpp
index ed54f91c653f4052f60f51b59d3c8a25ae5971c6..3451fa1dac912f8bd7cb4d74239e1c5fff31fae3 100644
--- a/gm/reveal.cpp
+++ b/gm/reveal.cpp
@@ -19,6 +19,7 @@ constexpr int kNumCols = 2;
constexpr int kNumRows = 5;
constexpr int kCellSize = 128;
constexpr SkScalar kPad = 8.0f;
+constexpr SkScalar kBlurRadius = 8.0f;
constexpr SkScalar kPeriod = 8.0f;
constexpr int kClipOffset = 32;
@@ -348,14 +349,14 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
// G channel is an F6.2 radius
- paint.setColor(SkColorSetARGB(255, 0, (unsigned char)(4*kPad), 0));
+ paint.setColor(SkColorSetARGB(255, 0, (unsigned char)(4*kBlurRadius), 0));
paint.setShader(SkGaussianEdgeShader::Make());
drawObj->draw(canvas, paint);
canvas->restore();
} else if (kBlurMask_Mode == fMode) {
SkPath clippedPath;
- SkScalar sigma = kPad / 4.0f;
+ SkScalar sigma = kBlurRadius / 4.0f;
if (clipObj->contains(drawObj->bounds())) {
clippedPath = drawObj->asPath(2.0f*sigma);
@@ -382,7 +383,7 @@ protected:
if (clipObj->asRRect(&clipRR) && drawObj->asRRect(&drawnRR)) {
paint.setShader(SkRRectsGaussianEdgeShader::Make(clipRR, drawnRR,
- kPad, 0.0f));
+ kBlurRadius));
}
canvas->drawRect(cover, paint);
« no previous file with comments | « no previous file | include/effects/SkRRectsGaussianEdgeShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698