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

Unified Diff: gm/xfermodes.cpp

Issue 45953005: Fix int/SkScalar mismatch in gm. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes.cpp
diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp
index 76db8b7d4e26db801ac813618467c3a11b332200..02cdd61927539c25f4d56456f44c863586016a55 100644
--- a/gm/xfermodes.cpp
+++ b/gm/xfermodes.cpp
@@ -82,7 +82,8 @@ class XfermodesGM : public GM {
p.setXfermode(mode);
switch (srcType) {
case kQuarterClearInLayer_SrcType: {
- SkRect bounds = SkRect::MakeXYWH(x, y, W, H);
+ SkRect bounds = SkRect::MakeXYWH(x, y, SkIntToScalar(W),
+ SkIntToScalar(H));
canvas->saveLayer(&bounds, &p);
restoreNeeded = true;
p.setXfermodeMode(SkXfermode::kSrcOver_Mode);
@@ -92,10 +93,11 @@ class XfermodesGM : public GM {
SkScalar halfW = SkIntToScalar(W) / 2;
SkScalar halfH = SkIntToScalar(H) / 2;
p.setColor(0xFF66AAFF);
- SkRect r = SkRect::MakeXYWH(x + halfW, y, halfW, H);
+ SkRect r = SkRect::MakeXYWH(x + halfW, y, halfW,
+ SkIntToScalar(H));
canvas->drawRect(r, p);
p.setColor(0xFFAA66FF);
- r = SkRect::MakeXYWH(x, y + halfH, W, halfH);
+ r = SkRect::MakeXYWH(x, y + halfH, SkIntToScalar(W), halfH);
canvas->drawRect(r, p);
break;
}
« 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