commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "gm/gm.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 9 | #include "include/core/SkBitmap.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 10 | #include "include/core/SkCanvas.h" |
| 11 | #include "include/core/SkClipOp.h" |
| 12 | #include "include/core/SkColor.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 13 | #include "include/core/SkFont.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 14 | #include "include/core/SkFontTypes.h" |
| 15 | #include "include/core/SkMatrix.h" |
| 16 | #include "include/core/SkPaint.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 17 | #include "include/core/SkPath.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 18 | #include "include/core/SkPoint.h" |
| 19 | #include "include/core/SkRect.h" |
| 20 | #include "include/core/SkScalar.h" |
| 21 | #include "include/core/SkShader.h" |
| 22 | #include "include/core/SkSize.h" |
| 23 | #include "include/core/SkString.h" |
| 24 | #include "include/core/SkTileMode.h" |
| 25 | #include "include/core/SkTypeface.h" |
| 26 | #include "include/core/SkTypes.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 27 | #include "include/effects/SkGradientShader.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 28 | #include "src/core/SkClipOpPriv.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 29 | #include "src/core/SkTLList.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 30 | #include "tools/ToolUtils.h" |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 31 | |
| 32 | static SkBitmap make_bmp(int w, int h) { |
| 33 | SkBitmap bmp; |
| 34 | bmp.allocN32Pixels(w, h, true); |
| 35 | |
| 36 | SkCanvas canvas(bmp); |
| 37 | SkScalar wScalar = SkIntToScalar(w); |
| 38 | SkScalar hScalar = SkIntToScalar(h); |
| 39 | |
| 40 | SkPoint pt = { wScalar / 2, hScalar / 2 }; |
| 41 | |
| 42 | SkScalar radius = 3 * SkMaxScalar(wScalar, hScalar); |
| 43 | |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 44 | SkColor colors[] = {SK_ColorDKGRAY, |
| 45 | ToolUtils::color_to_565(0xFF222255), |
| 46 | ToolUtils::color_to_565(0xFF331133), |
| 47 | ToolUtils::color_to_565(0xFF884422), |
| 48 | ToolUtils::color_to_565(0xFF000022), |
| 49 | SK_ColorWHITE, |
| 50 | ToolUtils::color_to_565(0xFFAABBCC)}; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 51 | |
| 52 | SkScalar pos[] = {0, |
| 53 | SK_Scalar1 / 6, |
| 54 | 2 * SK_Scalar1 / 6, |
| 55 | 3 * SK_Scalar1 / 6, |
| 56 | 4 * SK_Scalar1 / 6, |
| 57 | 5 * SK_Scalar1 / 6, |
| 58 | SK_Scalar1}; |
| 59 | |
| 60 | SkPaint paint; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 61 | SkRect rect = SkRect::MakeWH(wScalar, hScalar); |
| 62 | SkMatrix mat = SkMatrix::I(); |
| 63 | for (int i = 0; i < 4; ++i) { |
reed | 2ad1aa6 | 2016-03-09 09:50:50 -0800 | [diff] [blame] | 64 | paint.setShader(SkGradientShader::MakeRadial( |
commit-bot@chromium.org | 9c9005a | 2014-04-28 14:55:39 +0000 | [diff] [blame] | 65 | pt, radius, |
| 66 | colors, pos, |
| 67 | SK_ARRAY_COUNT(colors), |
Mike Reed | fae8fce | 2019-04-03 10:27:45 -0400 | [diff] [blame] | 68 | SkTileMode::kRepeat, |
reed | 2ad1aa6 | 2016-03-09 09:50:50 -0800 | [diff] [blame] | 69 | 0, &mat)); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 70 | canvas.drawRect(rect, paint); |
| 71 | rect.inset(wScalar / 8, hScalar / 8); |
| 72 | mat.preTranslate(6 * wScalar, 6 * hScalar); |
| 73 | mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3); |
| 74 | } |
| 75 | |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 76 | SkFont font(ToolUtils::create_portable_typeface(), wScalar / 2.2f); |
Mike Reed | 4de2f1f | 2019-01-05 16:35:13 -0500 | [diff] [blame] | 77 | |
Ben Wagner | a93a14a | 2017-08-28 10:34:05 -0400 | [diff] [blame] | 78 | paint.setShader(nullptr); |
Mike Klein | d46dce3 | 2018-08-16 10:17:03 -0400 | [diff] [blame] | 79 | paint.setColor(SK_ColorLTGRAY); |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 80 | constexpr char kTxt[] = "Skia"; |
Mike Reed | 4de2f1f | 2019-01-05 16:35:13 -0500 | [diff] [blame] | 81 | SkPoint texPos = { wScalar / 17, hScalar / 2 + font.getSize() / 2.5f }; |
Ben Wagner | 51e15a6 | 2019-05-07 15:38:46 -0400 | [diff] [blame^] | 82 | canvas.drawSimpleText(kTxt, SK_ARRAY_COUNT(kTxt)-1, SkTextEncoding::kUTF8, |
Mike Reed | 4de2f1f | 2019-01-05 16:35:13 -0500 | [diff] [blame] | 83 | texPos.fX, texPos.fY, font, paint); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 84 | paint.setColor(SK_ColorBLACK); |
| 85 | paint.setStyle(SkPaint::kStroke_Style); |
| 86 | paint.setStrokeWidth(SK_Scalar1); |
Ben Wagner | 51e15a6 | 2019-05-07 15:38:46 -0400 | [diff] [blame^] | 87 | canvas.drawSimpleText(kTxt, SK_ARRAY_COUNT(kTxt)-1, SkTextEncoding::kUTF8, |
Mike Reed | 4de2f1f | 2019-01-05 16:35:13 -0500 | [diff] [blame] | 88 | texPos.fX, texPos.fY, font, paint); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 89 | return bmp; |
| 90 | } |
| 91 | |
| 92 | namespace skiagm { |
| 93 | /** |
| 94 | * This GM tests convex polygon clips. |
| 95 | */ |
| 96 | class ConvexPolyClip : public GM { |
| 97 | public: |
| 98 | ConvexPolyClip() { |
| 99 | this->setBGColor(0xFFFFFFFF); |
| 100 | } |
| 101 | |
| 102 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 103 | SkString onShortName() override { |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 104 | return SkString("convex_poly_clip"); |
| 105 | } |
| 106 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 107 | SkISize onISize() override { |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 108 | // When benchmarking the saveLayer set of draws is skipped. |
| 109 | int w = 435; |
| 110 | if (kBench_Mode != this->getMode()) { |
| 111 | w *= 2; |
| 112 | } |
tfarina | f539318 | 2014-06-09 23:59:03 -0700 | [diff] [blame] | 113 | return SkISize::Make(w, 540); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 114 | } |
| 115 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 116 | void onOnceBeforeDraw() override { |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 117 | SkPath tri; |
| 118 | tri.moveTo(5.f, 5.f); |
| 119 | tri.lineTo(100.f, 20.f); |
| 120 | tri.lineTo(15.f, 100.f); |
| 121 | |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 122 | fClips.addToTail()->setPath(tri); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 123 | |
| 124 | SkPath hexagon; |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 125 | constexpr SkScalar kRadius = 45.f; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 126 | const SkPoint center = { kRadius, kRadius }; |
| 127 | for (int i = 0; i < 6; ++i) { |
| 128 | SkScalar angle = 2 * SK_ScalarPI * i / 6; |
Brian Osman | 4428f2c | 2019-04-02 10:59:28 -0400 | [diff] [blame] | 129 | SkPoint point = { SkScalarCos(angle), SkScalarSin(angle) }; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 130 | point.scale(kRadius); |
| 131 | point = center + point; |
| 132 | if (0 == i) { |
| 133 | hexagon.moveTo(point); |
| 134 | } else { |
| 135 | hexagon.lineTo(point); |
| 136 | } |
| 137 | } |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 138 | fClips.addToTail()->setPath(hexagon); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 139 | |
| 140 | SkMatrix scaleM; |
| 141 | scaleM.setScale(1.1f, 0.4f, kRadius, kRadius); |
| 142 | hexagon.transform(scaleM); |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 143 | fClips.addToTail()->setPath(hexagon); |
| 144 | |
| 145 | fClips.addToTail()->setRect(SkRect::MakeXYWH(8.3f, 11.6f, 78.2f, 72.6f)); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 146 | |
| 147 | SkPath rotRect; |
| 148 | SkRect rect = SkRect::MakeLTRB(10.f, 12.f, 80.f, 86.f); |
| 149 | rotRect.addRect(rect); |
| 150 | SkMatrix rotM; |
| 151 | rotM.setRotate(23.f, rect.centerX(), rect.centerY()); |
| 152 | rotRect.transform(rotM); |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 153 | fClips.addToTail()->setPath(rotRect); |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 154 | |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 155 | fBmp = make_bmp(100, 100); |
| 156 | } |
| 157 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 158 | void onDraw(SkCanvas* canvas) override { |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 159 | SkScalar y = 0; |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 160 | constexpr SkScalar kMargin = 10.f; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 161 | |
| 162 | SkPaint bgPaint; |
| 163 | bgPaint.setAlpha(0x15); |
Mike Reed | 3661bc9 | 2017-02-22 13:21:42 -0500 | [diff] [blame] | 164 | SkISize size = canvas->getBaseLayerSize(); |
reed | a5517e2 | 2015-07-14 10:54:12 -0700 | [diff] [blame] | 165 | canvas->drawBitmapRect(fBmp, SkRect::MakeIWH(size.fWidth, size.fHeight), &bgPaint); |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 166 | |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 167 | constexpr char kTxt[] = "Clip Me!"; |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 168 | SkFont font(ToolUtils::create_portable_typeface(), 23); |
Ben Wagner | 51e15a6 | 2019-05-07 15:38:46 -0400 | [diff] [blame^] | 169 | SkScalar textW = font.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1, SkTextEncoding::kUTF8); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 170 | SkPaint txtPaint; |
Mike Klein | d46dce3 | 2018-08-16 10:17:03 -0400 | [diff] [blame] | 171 | txtPaint.setColor(SK_ColorDKGRAY); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 172 | |
| 173 | SkScalar startX = 0; |
| 174 | int testLayers = kBench_Mode != this->getMode(); |
| 175 | for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { |
bsalomon | f045d60 | 2015-11-18 19:01:12 -0800 | [diff] [blame] | 176 | for (ClipList::Iter iter(fClips, ClipList::Iter::kHead_IterStart); |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 177 | iter.get(); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 178 | iter.next()) { |
| 179 | const Clip* clip = iter.get(); |
| 180 | SkScalar x = startX; |
| 181 | for (int aa = 0; aa < 2; ++aa) { |
| 182 | if (doLayer) { |
| 183 | SkRect bounds; |
| 184 | clip->getBounds(&bounds); |
| 185 | bounds.outset(2, 2); |
| 186 | bounds.offset(x, y); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 187 | canvas->saveLayer(&bounds, nullptr); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 188 | } else { |
| 189 | canvas->save(); |
| 190 | } |
| 191 | canvas->translate(x, y); |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 192 | clip->setOnCanvas(canvas, kIntersect_SkClipOp, SkToBool(aa)); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 193 | canvas->drawBitmap(fBmp, 0, 0); |
| 194 | canvas->restore(); |
| 195 | x += fBmp.width() + kMargin; |
| 196 | } |
| 197 | for (int aa = 0; aa < 2; ++aa) { |
| 198 | |
| 199 | SkPaint clipOutlinePaint; |
| 200 | clipOutlinePaint.setAntiAlias(true); |
| 201 | clipOutlinePaint.setColor(0x50505050); |
| 202 | clipOutlinePaint.setStyle(SkPaint::kStroke_Style); |
| 203 | clipOutlinePaint.setStrokeWidth(0); |
| 204 | |
| 205 | if (doLayer) { |
| 206 | SkRect bounds; |
| 207 | clip->getBounds(&bounds); |
| 208 | bounds.outset(2, 2); |
| 209 | bounds.offset(x, y); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 210 | canvas->saveLayer(&bounds, nullptr); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 211 | } else { |
| 212 | canvas->save(); |
| 213 | } |
| 214 | canvas->translate(x, y); |
| 215 | SkPath closedClipPath; |
| 216 | clip->asClosedPath(&closedClipPath); |
| 217 | canvas->drawPath(closedClipPath, clipOutlinePaint); |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 218 | clip->setOnCanvas(canvas, kIntersect_SkClipOp, SkToBool(aa)); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 219 | canvas->scale(1.f, 1.8f); |
Ben Wagner | 51e15a6 | 2019-05-07 15:38:46 -0400 | [diff] [blame^] | 220 | canvas->drawSimpleText(kTxt, SK_ARRAY_COUNT(kTxt)-1, SkTextEncoding::kUTF8, |
Mike Reed | 2e6db18 | 2018-12-15 13:45:33 -0500 | [diff] [blame] | 221 | 0, 1.5f * font.getSize(), font, txtPaint); |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 222 | canvas->restore(); |
| 223 | x += textW + 2 * kMargin; |
| 224 | } |
| 225 | y += fBmp.height() + kMargin; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 226 | } |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 227 | y = 0; |
| 228 | startX += 2 * fBmp.width() + SkScalarCeilToInt(2 * textW) + 6 * kMargin; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 229 | } |
| 230 | } |
| 231 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 232 | bool runAsBench() const override { return true; } |
mtklein | cf5d9c9 | 2015-01-23 10:31:45 -0800 | [diff] [blame] | 233 | |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 234 | private: |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 235 | class Clip { |
| 236 | public: |
| 237 | enum ClipType { |
| 238 | kNone_ClipType, |
| 239 | kPath_ClipType, |
| 240 | kRect_ClipType |
| 241 | }; |
| 242 | |
| 243 | Clip () : fClipType(kNone_ClipType) {} |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 244 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 245 | void setOnCanvas(SkCanvas* canvas, SkClipOp op, bool aa) const { |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 246 | switch (fClipType) { |
| 247 | case kPath_ClipType: |
| 248 | canvas->clipPath(fPath, op, aa); |
| 249 | break; |
| 250 | case kRect_ClipType: |
| 251 | canvas->clipRect(fRect, op, aa); |
| 252 | break; |
| 253 | case kNone_ClipType: |
| 254 | SkDEBUGFAIL("Uninitialized Clip."); |
| 255 | break; |
| 256 | } |
| 257 | } |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 258 | |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 259 | void asClosedPath(SkPath* path) const { |
| 260 | switch (fClipType) { |
| 261 | case kPath_ClipType: |
| 262 | *path = fPath; |
| 263 | path->close(); |
| 264 | break; |
| 265 | case kRect_ClipType: |
| 266 | path->reset(); |
| 267 | path->addRect(fRect); |
| 268 | break; |
| 269 | case kNone_ClipType: |
| 270 | SkDEBUGFAIL("Uninitialized Clip."); |
| 271 | break; |
| 272 | } |
| 273 | } |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 274 | |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 275 | void setPath(const SkPath& path) { |
| 276 | fClipType = kPath_ClipType; |
| 277 | fPath = path; |
| 278 | } |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 279 | |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 280 | void setRect(const SkRect& rect) { |
| 281 | fClipType = kRect_ClipType; |
| 282 | fRect = rect; |
| 283 | fPath.reset(); |
| 284 | } |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 285 | |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 286 | ClipType getType() const { return fClipType; } |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 287 | |
commit-bot@chromium.org | b21fac1 | 2014-02-07 21:13:11 +0000 | [diff] [blame] | 288 | void getBounds(SkRect* bounds) const { |
| 289 | switch (fClipType) { |
| 290 | case kPath_ClipType: |
| 291 | *bounds = fPath.getBounds(); |
| 292 | break; |
| 293 | case kRect_ClipType: |
| 294 | *bounds = fRect; |
| 295 | break; |
| 296 | case kNone_ClipType: |
| 297 | SkDEBUGFAIL("Uninitialized Clip."); |
| 298 | break; |
| 299 | } |
| 300 | } |
| 301 | |
commit-bot@chromium.org | b511be5 | 2014-02-04 15:09:16 +0000 | [diff] [blame] | 302 | private: |
| 303 | ClipType fClipType; |
| 304 | SkPath fPath; |
| 305 | SkRect fRect; |
| 306 | }; |
skia.committer@gmail.com | 1dab403 | 2014-02-05 03:01:48 +0000 | [diff] [blame] | 307 | |
bsalomon | f045d60 | 2015-11-18 19:01:12 -0800 | [diff] [blame] | 308 | typedef SkTLList<Clip, 1> ClipList; |
| 309 | ClipList fClips; |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 310 | SkBitmap fBmp; |
| 311 | |
| 312 | typedef GM INHERITED; |
| 313 | }; |
| 314 | |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 315 | DEF_GM(return new ConvexPolyClip;) |
commit-bot@chromium.org | a343c84 | 2014-01-31 14:48:58 +0000 | [diff] [blame] | 316 | } |