Chromium Code Reviews| Index: gm/xfermodes.cpp |
| diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp |
| index 6e1de3eb67bf5e5236facf7455ff2f9422f25971..7ee1e8008614900370f92d44c2d46ba1e949d190 100644 |
| --- a/gm/xfermodes.cpp |
| +++ b/gm/xfermodes.cpp |
| @@ -66,8 +66,10 @@ class XfermodesGM : public GM { |
| kQuarterClearInLayer_SrcType = 0x20, |
| //! A W/2xH/2 transparent image. |
| kSmallTransparentImage_SrcType = 0x40, |
| + //! kRectangleImage_SrcType drawn directly with a mask. |
| + kRectangleWithMask_SrcType = 0x80, |
| - kAll_SrcType = 0x7F, //!< All the source types. |
| + kAll_SrcType = 0xFF, //!< All the source types. |
| kBasic_SrcType = 0x03, //!< Just basic source types. |
| }; |
| @@ -112,6 +114,15 @@ class XfermodesGM : public GM { |
| canvas->drawRect(r, p); |
| break; |
| } |
| + case kRectangleWithMask_SrcType: { |
|
vandebo (ex-Chrome)
2013/12/17 23:11:03
This demonstrates the problem in the bug before th
|
| + canvas->save(SkCanvas::kClip_SaveFlag); |
| + restoreNeeded = true; |
| + SkScalar w = SkIntToScalar(W); |
| + SkScalar h = SkIntToScalar(H); |
| + SkRect r = SkRect::MakeXYWH(x, y + h / 4, w, h * 23 / 60); |
| + canvas->clipRect(r); |
| + // Fall through. |
| + } |
| case kRectangle_SrcType: { |
| SkScalar w = SkIntToScalar(W); |
| SkScalar h = SkIntToScalar(H); |