bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 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 | */ |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "gm/gm.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 9 | #include "include/core/SkBitmap.h" |
| 10 | #include "include/core/SkBlurTypes.h" |
| 11 | #include "include/core/SkCanvas.h" |
| 12 | #include "include/core/SkColor.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 13 | #include "include/core/SkFont.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 14 | #include "include/core/SkImage.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 15 | #include "include/core/SkImageInfo.h" |
| 16 | #include "include/core/SkMaskFilter.h" |
| 17 | #include "include/core/SkMatrix.h" |
| 18 | #include "include/core/SkPaint.h" |
| 19 | #include "include/core/SkPoint.h" |
| 20 | #include "include/core/SkRect.h" |
| 21 | #include "include/core/SkRefCnt.h" |
| 22 | #include "include/core/SkScalar.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 23 | #include "include/core/SkShader.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 24 | #include "include/core/SkSize.h" |
| 25 | #include "include/core/SkString.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 26 | #include "include/core/SkSurface.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 27 | #include "include/core/SkTileMode.h" |
| 28 | #include "include/core/SkTypeface.h" |
| 29 | #include "include/core/SkTypes.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 30 | #include "include/effects/SkGradientShader.h" |
Adlai Holler | 872a32c | 2020-07-10 14:33:22 -0400 | [diff] [blame] | 31 | #include "include/gpu/GrDirectContext.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 32 | #include "src/core/SkBlurMask.h" |
| 33 | #include "src/core/SkMathPriv.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 34 | #include "tools/ToolUtils.h" |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 35 | |
bsalomon@google.com | 7d30a21 | 2012-04-25 15:52:27 +0000 | [diff] [blame] | 36 | static SkBitmap make_chessbm(int w, int h) { |
| 37 | SkBitmap bm; |
reed@google.com | eb9a46c | 2014-01-25 16:46:20 +0000 | [diff] [blame] | 38 | bm.allocN32Pixels(w, h); |
bsalomon@google.com | 7d30a21 | 2012-04-25 15:52:27 +0000 | [diff] [blame] | 39 | |
| 40 | for (int y = 0; y < bm.height(); y++) { |
| 41 | uint32_t* p = bm.getAddr32(0, y); |
| 42 | for (int x = 0; x < bm.width(); x++) { |
| 43 | p[x] = ((x + y) & 1) ? SK_ColorWHITE : SK_ColorBLACK; |
| 44 | } |
| 45 | } |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 46 | bm.setImmutable(); |
bsalomon@google.com | 7d30a21 | 2012-04-25 15:52:27 +0000 | [diff] [blame] | 47 | return bm; |
| 48 | } |
| 49 | |
bsalomon | 7cf36cc | 2016-07-14 09:33:42 -0700 | [diff] [blame] | 50 | // Creates a bitmap and a matching image. |
reed | 9ce9d67 | 2016-03-17 10:51:11 -0700 | [diff] [blame] | 51 | static sk_sp<SkImage> makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, int h) { |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 52 | SkImageInfo info = SkImageInfo::MakeN32Premul(w, h); |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 53 | |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 54 | auto surface(ToolUtils::makeSurface(origCanvas, info)); |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 55 | SkCanvas* canvas = surface->getCanvas(); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 56 | |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 57 | canvas->clear(SK_ColorTRANSPARENT); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 58 | |
| 59 | SkScalar wScalar = SkIntToScalar(w); |
| 60 | SkScalar hScalar = SkIntToScalar(h); |
| 61 | |
| 62 | SkPoint pt = { wScalar / 2, hScalar / 2 }; |
| 63 | |
Brian Osman | 116b33e | 2020-02-05 13:34:09 -0500 | [diff] [blame] | 64 | SkScalar radius = 4 * std::max(wScalar, hScalar); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 65 | |
| 66 | SkColor colors[] = { SK_ColorRED, SK_ColorYELLOW, |
| 67 | SK_ColorGREEN, SK_ColorMAGENTA, |
| 68 | SK_ColorBLUE, SK_ColorCYAN, |
| 69 | SK_ColorRED}; |
| 70 | |
| 71 | SkScalar pos[] = {0, |
| 72 | SK_Scalar1 / 6, |
| 73 | 2 * SK_Scalar1 / 6, |
| 74 | 3 * SK_Scalar1 / 6, |
| 75 | 4 * SK_Scalar1 / 6, |
| 76 | 5 * SK_Scalar1 / 6, |
| 77 | SK_Scalar1}; |
| 78 | |
| 79 | SkPaint paint; |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 80 | SkRect rect = SkRect::MakeWH(wScalar, hScalar); |
| 81 | SkMatrix mat = SkMatrix::I(); |
| 82 | for (int i = 0; i < 4; ++i) { |
reed | 2ad1aa6 | 2016-03-09 09:50:50 -0800 | [diff] [blame] | 83 | paint.setShader(SkGradientShader::MakeRadial( |
commit-bot@chromium.org | 9c9005a | 2014-04-28 14:55:39 +0000 | [diff] [blame] | 84 | pt, radius, |
| 85 | colors, pos, |
| 86 | SK_ARRAY_COUNT(colors), |
Mike Reed | fae8fce | 2019-04-03 10:27:45 -0400 | [diff] [blame] | 87 | SkTileMode::kRepeat, |
reed | 2ad1aa6 | 2016-03-09 09:50:50 -0800 | [diff] [blame] | 88 | 0, &mat)); |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 89 | canvas->drawRect(rect, paint); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 90 | rect.inset(wScalar / 8, hScalar / 8); |
| 91 | mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4); |
| 92 | } |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 93 | |
reed | 9ce9d67 | 2016-03-17 10:51:11 -0700 | [diff] [blame] | 94 | auto image = surface->makeImageSnapshot(); |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 95 | |
| 96 | SkBitmap tempBM; |
| 97 | |
Cary Clark | 4f5a79c | 2018-02-07 15:51:00 -0500 | [diff] [blame] | 98 | image->asLegacyBitmap(&tempBM); |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 99 | |
| 100 | // Let backends know we won't change this, so they don't have to deep copy it defensively. |
| 101 | tempBM.setImmutable(); |
| 102 | *resultBM = tempBM; |
| 103 | |
| 104 | return image; |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 105 | } |
| 106 | |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 107 | static void bitmapproc(SkCanvas* canvas, SkImage*, const SkBitmap& bm, const SkIRect& srcR, |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 108 | const SkRect& dstR, const SkSamplingOptions& sampling, |
| 109 | const SkPaint* paint) { |
| 110 | canvas->drawImageRect(bm.asImage(), SkRect::Make(srcR), dstR, sampling, paint, |
| 111 | SkCanvas::kStrict_SrcRectConstraint); |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | static void bitmapsubsetproc(SkCanvas* canvas, SkImage*, const SkBitmap& bm, const SkIRect& srcR, |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 115 | const SkRect& dstR, const SkSamplingOptions& sampling, |
| 116 | const SkPaint* paint) { |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 117 | if (!bm.bounds().contains(srcR)) { |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 118 | bitmapproc(canvas, nullptr, bm, srcR, dstR, sampling, paint); |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 119 | return; |
| 120 | } |
| 121 | |
| 122 | SkBitmap subset; |
| 123 | if (bm.extractSubset(&subset, srcR)) { |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 124 | canvas->drawImageRect(subset.asImage(), dstR, sampling, paint); |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 125 | } |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 126 | } |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 127 | |
reed | 84984ef | 2015-07-17 07:09:43 -0700 | [diff] [blame] | 128 | static void imageproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect& srcR, |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 129 | const SkRect& dstR, const SkSamplingOptions& sampling, const SkPaint* paint) { |
| 130 | canvas->drawImageRect(image, SkRect::Make(srcR), dstR, sampling, paint, |
| 131 | SkCanvas::kStrict_SrcRectConstraint); |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 132 | } |
| 133 | |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 134 | static void imagesubsetproc(SkCanvas* canvas, SkImage* image, const SkBitmap& bm, |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 135 | const SkIRect& srcR, const SkRect& dstR, |
| 136 | const SkSamplingOptions& sampling, const SkPaint* paint) { |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 137 | if (!image->bounds().contains(srcR)) { |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 138 | imageproc(canvas, image, bm, srcR, dstR, sampling, paint); |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 139 | return; |
| 140 | } |
| 141 | |
Adlai Holler | 872a32c | 2020-07-10 14:33:22 -0400 | [diff] [blame] | 142 | auto direct = GrAsDirectContext(canvas->recordingContext()); |
| 143 | if (sk_sp<SkImage> subset = image->makeSubset(srcR, direct)) { |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 144 | canvas->drawImageRect(subset, dstR, sampling, paint); |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 145 | } |
| 146 | } |
| 147 | |
| 148 | typedef void DrawRectRectProc(SkCanvas*, SkImage*, const SkBitmap&, const SkIRect&, const SkRect&, |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 149 | const SkSamplingOptions&, const SkPaint*); |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 150 | |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 151 | constexpr int gSize = 1024; |
| 152 | constexpr int gBmpSize = 2048; |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 153 | |
| 154 | class DrawBitmapRectGM : public skiagm::GM { |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 155 | public: |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 156 | DrawBitmapRectGM(DrawRectRectProc proc, const char suffix[]) : fProc(proc) { |
| 157 | fName.set("drawbitmaprect"); |
| 158 | if (suffix) { |
| 159 | fName.append(suffix); |
| 160 | } |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 161 | } |
| 162 | |
reed | 9ce9d67 | 2016-03-17 10:51:11 -0700 | [diff] [blame] | 163 | DrawRectRectProc* fProc; |
| 164 | SkBitmap fLargeBitmap; |
| 165 | sk_sp<SkImage> fImage; |
| 166 | SkString fName; |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 167 | |
| 168 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 169 | SkString onShortName() override { return fName; } |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 170 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 171 | SkISize onISize() override { return SkISize::Make(gSize, gSize); } |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 172 | |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 173 | void setupImage(SkCanvas* canvas) { |
reed | 9ce9d67 | 2016-03-17 10:51:11 -0700 | [diff] [blame] | 174 | fImage = makebm(canvas, &fLargeBitmap, gBmpSize, gBmpSize); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 175 | } |
rmistry@google.com | ae933ce | 2012-08-23 18:19:56 +0000 | [diff] [blame] | 176 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 177 | void onDraw(SkCanvas* canvas) override { |
Robert Phillips | 4a3ebc2 | 2020-07-10 11:27:43 -0400 | [diff] [blame] | 178 | if (!fImage || !fImage->isValid(canvas->recordingContext())) { |
robertphillips | 24eb7a8 | 2015-09-24 08:47:49 -0700 | [diff] [blame] | 179 | this->setupImage(canvas); |
| 180 | } |
| 181 | |
vandebo@chromium.org | 663515b | 2012-01-05 18:45:27 +0000 | [diff] [blame] | 182 | SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)}; |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 183 | const int kMaxSrcRectSize = 1 << (SkNextLog2(gBmpSize) + 2); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 184 | |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 185 | const int kPadX = 30; |
| 186 | const int kPadY = 40; |
John Stiles | acf7164 | 2021-08-12 22:33:57 -0400 | [diff] [blame^] | 187 | SkPaint alphaPaint; |
| 188 | alphaPaint.setAlphaf(0.125f); |
| 189 | canvas->drawImageRect(fImage, SkRect::MakeIWH(gSize, gSize), SkSamplingOptions(), |
| 190 | &alphaPaint); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 191 | canvas->translate(SK_Scalar1 * kPadX / 2, |
| 192 | SK_Scalar1 * kPadY / 2); |
| 193 | SkPaint blackPaint; |
| 194 | SkScalar titleHeight = SK_Scalar1 * 24; |
| 195 | blackPaint.setColor(SK_ColorBLACK); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 196 | blackPaint.setAntiAlias(true); |
Mike Reed | c4745d6 | 2019-01-07 09:31:58 -0500 | [diff] [blame] | 197 | |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 198 | SkFont font(ToolUtils::create_portable_typeface(), titleHeight); |
Mike Reed | c4745d6 | 2019-01-07 09:31:58 -0500 | [diff] [blame] | 199 | |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 200 | SkString title; |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 201 | title.printf("Bitmap size: %d x %d", gBmpSize, gBmpSize); |
Mike Reed | c4745d6 | 2019-01-07 09:31:58 -0500 | [diff] [blame] | 202 | canvas->drawString(title, 0, titleHeight, font, blackPaint); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 203 | |
| 204 | canvas->translate(0, SK_Scalar1 * kPadY / 2 + titleHeight); |
| 205 | int rowCount = 0; |
| 206 | canvas->save(); |
| 207 | for (int w = 1; w <= kMaxSrcRectSize; w *= 4) { |
| 208 | for (int h = 1; h <= kMaxSrcRectSize; h *= 4) { |
| 209 | |
reed | f803da1 | 2015-01-23 05:58:07 -0800 | [diff] [blame] | 210 | SkIRect srcRect = SkIRect::MakeXYWH((gBmpSize - w) / 2, (gBmpSize - h) / 2, w, h); |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 211 | fProc(canvas, fImage.get(), fLargeBitmap, srcRect, dstRect, SkSamplingOptions(), |
| 212 | nullptr); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 213 | |
| 214 | SkString label; |
| 215 | label.appendf("%d x %d", w, h); |
| 216 | blackPaint.setAntiAlias(true); |
| 217 | blackPaint.setStyle(SkPaint::kFill_Style); |
Mike Reed | c4745d6 | 2019-01-07 09:31:58 -0500 | [diff] [blame] | 218 | font.setSize(SK_Scalar1 * 10); |
| 219 | SkScalar baseline = dstRect.height() + font.getSize() + SK_Scalar1 * 3; |
| 220 | canvas->drawString(label, 0, baseline, font, blackPaint); |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 221 | blackPaint.setStyle(SkPaint::kStroke_Style); |
| 222 | blackPaint.setStrokeWidth(SK_Scalar1); |
| 223 | blackPaint.setAntiAlias(false); |
| 224 | canvas->drawRect(dstRect, blackPaint); |
| 225 | |
| 226 | canvas->translate(dstRect.width() + SK_Scalar1 * kPadX, 0); |
| 227 | ++rowCount; |
| 228 | if ((dstRect.width() + kPadX) * rowCount > gSize) { |
| 229 | canvas->restore(); |
| 230 | canvas->translate(0, dstRect.height() + SK_Scalar1 * kPadY); |
| 231 | canvas->save(); |
| 232 | rowCount = 0; |
| 233 | } |
| 234 | } |
| 235 | } |
bsalomon@google.com | 7d30a21 | 2012-04-25 15:52:27 +0000 | [diff] [blame] | 236 | |
| 237 | { |
| 238 | // test the following code path: |
| 239 | // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() |
| 240 | SkIRect srcRect; |
John Stiles | acf7164 | 2021-08-12 22:33:57 -0400 | [diff] [blame^] | 241 | SkPaint maskPaint; |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 242 | SkBitmap bm = make_chessbm(5, 5); |
bsalomon@google.com | 7d30a21 | 2012-04-25 15:52:27 +0000 | [diff] [blame] | 243 | |
| 244 | srcRect.setXYWH(1, 1, 3, 3); |
John Stiles | acf7164 | 2021-08-12 22:33:57 -0400 | [diff] [blame^] | 245 | maskPaint.setMaskFilter(SkMaskFilter::MakeBlur( |
commit-bot@chromium.org | e396455 | 2014-04-28 16:25:35 +0000 | [diff] [blame] | 246 | kNormal_SkBlurStyle, |
Mike Reed | 1be1f8d | 2018-03-14 13:01:17 -0400 | [diff] [blame] | 247 | SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)))); |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 248 | |
Mike Reed | d396cd5 | 2021-01-23 21:14:47 -0500 | [diff] [blame] | 249 | fProc(canvas, bm.asImage().get(), bm, srcRect, dstRect, |
John Stiles | acf7164 | 2021-08-12 22:33:57 -0400 | [diff] [blame^] | 250 | SkSamplingOptions(SkFilterMode::kLinear), &maskPaint); |
bsalomon@google.com | 7d30a21 | 2012-04-25 15:52:27 +0000 | [diff] [blame] | 251 | } |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | private: |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 255 | using INHERITED = skiagm::GM; |
bsalomon@google.com | fb30951 | 2011-11-30 14:13:48 +0000 | [diff] [blame] | 256 | }; |
| 257 | |
fmalita | ab83da7 | 2016-08-26 13:04:14 -0700 | [diff] [blame] | 258 | DEF_GM( return new DrawBitmapRectGM(bitmapproc , nullptr); ) |
| 259 | DEF_GM( return new DrawBitmapRectGM(bitmapsubsetproc, "-subset"); ) |
| 260 | DEF_GM( return new DrawBitmapRectGM(imageproc , "-imagerect"); ) |
| 261 | DEF_GM( return new DrawBitmapRectGM(imagesubsetproc , "-imagerect-subset"); ) |