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

Unified Diff: gm/complexclip2.cpp

Issue 953383002: fuzzer fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix up width and height in initializer Created 5 years, 10 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 | « gm/circularclips.cpp ('k') | gm/picture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/complexclip2.cpp
diff --git a/gm/complexclip2.cpp b/gm/complexclip2.cpp
index a55d0733e073de417927ddddba3e9e1ed67f783c..361b1c0b9752f120c878a36f2dbf109d3e16c886 100644
--- a/gm/complexclip2.cpp
+++ b/gm/complexclip2.cpp
@@ -24,6 +24,21 @@ public:
ComplexClip2GM(Clip clip, bool antiAlias)
: fClip(clip)
, fAntiAlias(antiAlias) {
+ SkScalar xA = 0.65f;
+ SkScalar xF = 50.65f;
+
+ SkScalar yA = 0.65f;
+ SkScalar yF = 50.65f;
+
+ fWidth = xF - xA;
+ fHeight = yF - yA;
+
+ fTotalWidth = kCols * fWidth + SK_Scalar1 * (kCols + 1) * kPadX;
+ fTotalHeight = kRows * fHeight + SK_Scalar1 * (kRows + 1) * kPadY;
+ }
+
+protected:
+ void onOnceBeforeDraw() SK_OVERRIDE {
this->setBGColor(SkColorSetRGB(0xDD,0xA0,0xDD));
// offset the rects a bit so we get antialiasing even in the rect case
@@ -41,9 +56,6 @@ public:
SkScalar yE = 40.65f;
SkScalar yF = 50.65f;
- fWidth = xF - xA;
- fHeight = yF - yA;
-
fRects[0].set(xB, yB, xE, yE);
fRRects[0].setRectXY(fRects[0], 7, 7);
fPaths[0].addRoundRect(fRects[0], 5, 5);
@@ -69,9 +81,6 @@ public:
fPaths[4].addRoundRect(fRects[4], 5, 5);
fRectColors[4] = SK_ColorCYAN;
- fTotalWidth = kCols * fWidth + SK_Scalar1 * (kCols + 1) * kPadX;
- fTotalHeight = kRows * fHeight + SK_Scalar1 * (kRows + 1) * kPadY;
-
SkRegion::Op ops[] = {
SkRegion::kDifference_Op,
SkRegion::kIntersect_Op,
@@ -91,8 +100,6 @@ public:
}
}
-protected:
-
static const int kRows = 5;
static const int kCols = 5;
static const int kPadX = 20;
« no previous file with comments | « gm/circularclips.cpp ('k') | gm/picture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698