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; |