reed@google.com | 7112173 | 2012-09-18 15:14:33 +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 | 2ad1aa6 | 2016-03-09 09:50:50 -0800 | [diff] [blame] | 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "gm/gm.h" |
Ben Wagner | 6a34f3a | 2019-05-01 10:59:30 -0400 | [diff] [blame] | 9 | #include "include/core/SkBitmap.h" |
| 10 | #include "include/core/SkBlendMode.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkCanvas.h" |
Ben Wagner | 6a34f3a | 2019-05-01 10:59:30 -0400 | [diff] [blame] | 12 | #include "include/core/SkColor.h" |
| 13 | #include "include/core/SkPaint.h" |
| 14 | #include "include/core/SkPoint.h" |
| 15 | #include "include/core/SkRect.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 16 | #include "include/core/SkShader.h" |
Ben Wagner | 6a34f3a | 2019-05-01 10:59:30 -0400 | [diff] [blame] | 17 | #include "include/core/SkSize.h" |
| 18 | #include "include/core/SkString.h" |
Mike Reed | 6dbeac5 | 2021-01-13 13:14:23 -0500 | [diff] [blame] | 19 | #include "include/core/SkSurface.h" |
Ben Wagner | 6a34f3a | 2019-05-01 10:59:30 -0400 | [diff] [blame] | 20 | #include "include/core/SkTileMode.h" |
| 21 | #include "include/core/SkTypes.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 22 | #include "include/effects/SkGradientShader.h" |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 23 | |
Mike Reed | 6dbeac5 | 2021-01-13 13:14:23 -0500 | [diff] [blame] | 24 | static sk_sp<SkImage> make_image() { |
| 25 | auto surf = SkSurface::MakeRasterN32Premul(64, 64); |
| 26 | auto canvas = surf->getCanvas(); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 27 | |
Mike Reed | 6dbeac5 | 2021-01-13 13:14:23 -0500 | [diff] [blame] | 28 | canvas->drawColor(SK_ColorRED); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 29 | SkPaint paint; |
| 30 | paint.setAntiAlias(true); |
| 31 | const SkPoint pts[] = { { 0, 0 }, { 64, 64 } }; |
| 32 | const SkColor colors[] = { SK_ColorWHITE, SK_ColorBLUE }; |
Mike Reed | fae8fce | 2019-04-03 10:27:45 -0400 | [diff] [blame] | 33 | paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkTileMode::kClamp)); |
Mike Reed | 6dbeac5 | 2021-01-13 13:14:23 -0500 | [diff] [blame] | 34 | canvas->drawCircle(32, 32, 32, paint); |
| 35 | |
| 36 | return surf->makeImageSnapshot(); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | class DrawBitmapRect2 : public skiagm::GM { |
| 40 | bool fUseIRect; |
| 41 | public: |
| 42 | DrawBitmapRect2(bool useIRect) : fUseIRect(useIRect) { |
| 43 | } |
| 44 | |
| 45 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 46 | SkString onShortName() override { |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 47 | SkString str; |
| 48 | str.printf("bitmaprect_%s", fUseIRect ? "i" : "s"); |
| 49 | return str; |
| 50 | } |
| 51 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 52 | SkISize onISize() override { |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 53 | return SkISize::Make(640, 480); |
| 54 | } |
| 55 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 56 | void onDraw(SkCanvas* canvas) override { |
Mike Klein | d46dce3 | 2018-08-16 10:17:03 -0400 | [diff] [blame] | 57 | canvas->drawColor(0xFFCCCCCC); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 58 | |
| 59 | const SkIRect src[] = { |
| 60 | { 0, 0, 32, 32 }, |
| 61 | { 0, 0, 80, 80 }, |
| 62 | { 32, 32, 96, 96 }, |
| 63 | { -32, -32, 32, 32, } |
| 64 | }; |
| 65 | |
| 66 | SkPaint paint; |
| 67 | paint.setStyle(SkPaint::kStroke_Style); |
Mike Reed | e02d7f8 | 2021-01-21 22:25:21 -0500 | [diff] [blame] | 68 | auto sampling = SkSamplingOptions(); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 69 | |
Mike Reed | 6dbeac5 | 2021-01-13 13:14:23 -0500 | [diff] [blame] | 70 | auto image = make_image(); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 71 | |
| 72 | SkRect dstR = { 0, 200, 128, 380 }; |
| 73 | |
| 74 | canvas->translate(16, 40); |
| 75 | for (size_t i = 0; i < SK_ARRAY_COUNT(src); i++) { |
| 76 | SkRect srcR; |
| 77 | srcR.set(src[i]); |
| 78 | |
Mike Reed | e02d7f8 | 2021-01-21 22:25:21 -0500 | [diff] [blame] | 79 | canvas->drawImage(image, 0, 0, sampling, &paint); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 80 | if (!fUseIRect) { |
Mike Reed | e02d7f8 | 2021-01-21 22:25:21 -0500 | [diff] [blame] | 81 | canvas->drawImageRect(image.get(), srcR, dstR, sampling, &paint, |
Mike Reed | 6dbeac5 | 2021-01-13 13:14:23 -0500 | [diff] [blame] | 82 | SkCanvas::kStrict_SrcRectConstraint); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 83 | } else { |
Mike Reed | e02d7f8 | 2021-01-21 22:25:21 -0500 | [diff] [blame] | 84 | canvas->drawImageRect(image.get(), SkRect::Make(src[i]), dstR, sampling, &paint, |
| 85 | SkCanvas::kStrict_SrcRectConstraint); |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | canvas->drawRect(dstR, paint); |
| 89 | canvas->drawRect(srcR, paint); |
| 90 | |
| 91 | canvas->translate(160, 0); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | private: |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 96 | using INHERITED = skiagm::GM; |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | ////////////////////////////////////////////////////////////////////////////// |
reed | 776c0cd | 2015-01-27 07:26:51 -0800 | [diff] [blame] | 100 | |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 101 | static void make_3x3_bitmap(SkBitmap* bitmap) { |
reed | 776c0cd | 2015-01-27 07:26:51 -0800 | [diff] [blame] | 102 | const int xSize = 3; |
| 103 | const int ySize = 3; |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 104 | |
reed | 776c0cd | 2015-01-27 07:26:51 -0800 | [diff] [blame] | 105 | const SkColor textureData[xSize][ySize] = { |
robertphillips@google.com | 93f0332 | 2012-12-03 17:35:19 +0000 | [diff] [blame] | 106 | { SK_ColorRED, SK_ColorWHITE, SK_ColorBLUE }, |
| 107 | { SK_ColorGREEN, SK_ColorBLACK, SK_ColorCYAN }, |
| 108 | { SK_ColorYELLOW, SK_ColorGRAY, SK_ColorMAGENTA } |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 109 | }; |
| 110 | |
reed | 776c0cd | 2015-01-27 07:26:51 -0800 | [diff] [blame] | 111 | bitmap->allocN32Pixels(xSize, ySize, true); |
| 112 | SkCanvas canvas(*bitmap); |
| 113 | SkPaint paint; |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 114 | |
reed | 776c0cd | 2015-01-27 07:26:51 -0800 | [diff] [blame] | 115 | for (int y = 0; y < ySize; y++) { |
| 116 | for (int x = 0; x < xSize; x++) { |
| 117 | paint.setColor(textureData[x][y]); |
| 118 | canvas.drawIRect(SkIRect::MakeXYWH(x, y, 1, 1), paint); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
reed | a5517e2 | 2015-07-14 10:54:12 -0700 | [diff] [blame] | 123 | // This GM attempts to make visible any issues drawBitmapRect may have |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 124 | // with partial source rects. In this case the eight pixels on the border |
| 125 | // should be half the width/height of the central pixel, i.e.: |
| 126 | // __|____|__ |
| 127 | // | | |
| 128 | // __|____|__ |
| 129 | // | | |
| 130 | class DrawBitmapRect3 : public skiagm::GM { |
| 131 | public: |
| 132 | DrawBitmapRect3() { |
| 133 | this->setBGColor(SK_ColorBLACK); |
| 134 | } |
| 135 | |
| 136 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 137 | SkString onShortName() override { |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 138 | SkString str; |
| 139 | str.printf("3x3bitmaprect"); |
| 140 | return str; |
| 141 | } |
| 142 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 143 | SkISize onISize() override { |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 144 | return SkISize::Make(640, 480); |
| 145 | } |
| 146 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 147 | void onDraw(SkCanvas* canvas) override { |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 148 | |
| 149 | SkBitmap bitmap; |
| 150 | make_3x3_bitmap(&bitmap); |
| 151 | |
| 152 | SkRect srcR = { 0.5f, 0.5f, 2.5f, 2.5f }; |
| 153 | SkRect dstR = { 100, 100, 300, 200 }; |
| 154 | |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 155 | canvas->drawImageRect(bitmap.asImage(), srcR, dstR, SkSamplingOptions(), |
| 156 | nullptr, SkCanvas::kStrict_SrcRectConstraint); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | private: |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 160 | using INHERITED = skiagm::GM; |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | ////////////////////////////////////////////////////////////////////////////// |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 164 | static sk_sp<SkImage> make_big_bitmap() { |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 165 | |
mtklein | dbfd7ab | 2016-09-01 11:24:54 -0700 | [diff] [blame] | 166 | constexpr int gXSize = 4096; |
| 167 | constexpr int gYSize = 4096; |
| 168 | constexpr int gBorderWidth = 10; |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 169 | |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 170 | SkBitmap bitmap; |
| 171 | bitmap.allocN32Pixels(gXSize, gYSize); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 172 | for (int y = 0; y < gYSize; ++y) { |
| 173 | for (int x = 0; x < gXSize; ++x) { |
skia.committer@gmail.com | 44d4988 | 2012-09-27 02:01:04 +0000 | [diff] [blame] | 174 | if (x <= gBorderWidth || x >= gXSize-gBorderWidth || |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 175 | y <= gBorderWidth || y >= gYSize-gBorderWidth) { |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 176 | *bitmap.getAddr32(x, y) = SkPreMultiplyColor(0x88FFFFFF); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 177 | } else { |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 178 | *bitmap.getAddr32(x, y) = SkPreMultiplyColor(0x88FF0000); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 179 | } |
| 180 | } |
| 181 | } |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 182 | bitmap.setImmutable(); |
| 183 | return bitmap.asImage(); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | // This GM attempts to reveal any issues we may have when the GPU has to |
| 187 | // break up a large texture in order to draw it. The XOR transfer mode will |
| 188 | // create stripes in the image if there is imprecision in the destination |
| 189 | // tile placement. |
| 190 | class DrawBitmapRect4 : public skiagm::GM { |
| 191 | bool fUseIRect; |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 192 | sk_sp<SkImage> fBigImage; |
commit-bot@chromium.org | 9a558d4 | 2014-05-30 15:06:24 +0000 | [diff] [blame] | 193 | |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 194 | public: |
| 195 | DrawBitmapRect4(bool useIRect) : fUseIRect(useIRect) { |
| 196 | this->setBGColor(0x88444444); |
| 197 | } |
| 198 | |
| 199 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 200 | SkString onShortName() override { |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 201 | SkString str; |
| 202 | str.printf("bigbitmaprect_%s", fUseIRect ? "i" : "s"); |
| 203 | return str; |
| 204 | } |
| 205 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 206 | SkISize onISize() override { |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 207 | return SkISize::Make(640, 480); |
| 208 | } |
| 209 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 210 | void onOnceBeforeDraw() override { |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 211 | fBigImage = make_big_bitmap(); |
commit-bot@chromium.org | 9a558d4 | 2014-05-30 15:06:24 +0000 | [diff] [blame] | 212 | } |
| 213 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 214 | void onDraw(SkCanvas* canvas) override { |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 215 | SkPaint paint; |
| 216 | paint.setAlpha(128); |
reed | 374772b | 2016-10-05 17:33:02 -0700 | [diff] [blame] | 217 | paint.setBlendMode(SkBlendMode::kXor); |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 218 | SkSamplingOptions sampling; |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 219 | |
robertphillips@google.com | ffad46b | 2012-10-01 14:32:51 +0000 | [diff] [blame] | 220 | SkRect srcR1 = { 0.0f, 0.0f, 4096.0f, 2040.0f }; |
| 221 | SkRect dstR1 = { 10.1f, 10.1f, 629.9f, 400.9f }; |
| 222 | |
| 223 | SkRect srcR2 = { 4085.0f, 10.0f, 4087.0f, 12.0f }; |
| 224 | SkRect dstR2 = { 10, 410, 30, 430 }; |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 225 | |
| 226 | if (!fUseIRect) { |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 227 | canvas->drawImageRect(fBigImage, srcR1, dstR1, sampling, &paint, |
reed | 84984ef | 2015-07-17 07:09:43 -0700 | [diff] [blame] | 228 | SkCanvas::kStrict_SrcRectConstraint); |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 229 | canvas->drawImageRect(fBigImage, srcR2, dstR2, sampling, &paint, |
reed | 84984ef | 2015-07-17 07:09:43 -0700 | [diff] [blame] | 230 | SkCanvas::kStrict_SrcRectConstraint); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 231 | } else { |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 232 | canvas->drawImageRect(fBigImage, SkRect::Make(srcR1.roundOut()), dstR1, sampling, |
| 233 | &paint, SkCanvas::kStrict_SrcRectConstraint); |
| 234 | canvas->drawImageRect(fBigImage, SkRect::Make(srcR2.roundOut()), dstR2, sampling, |
| 235 | &paint, SkCanvas::kStrict_SrcRectConstraint); |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | |
| 239 | private: |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 240 | using INHERITED = skiagm::GM; |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 241 | }; |
| 242 | |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 243 | class BitmapRectRounding : public skiagm::GM { |
| 244 | SkBitmap fBM; |
| 245 | |
| 246 | public: |
| 247 | BitmapRectRounding() {} |
| 248 | |
| 249 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 250 | SkString onShortName() override { |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 251 | SkString str; |
| 252 | str.printf("bitmaprect_rounding"); |
| 253 | return str; |
| 254 | } |
| 255 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 256 | SkISize onISize() override { |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 257 | return SkISize::Make(640, 480); |
| 258 | } |
| 259 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 260 | void onOnceBeforeDraw() override { |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 261 | fBM.allocN32Pixels(10, 10); |
| 262 | fBM.eraseColor(SK_ColorBLUE); |
| 263 | } |
| 264 | |
| 265 | // This choice of coordinates and matrix land the bottom edge of the clip (and bitmap dst) |
| 266 | // at exactly 1/2 pixel boundary. However, drawBitmapRect may lose precision along the way. |
| 267 | // If it does, we may see a red-line at the bottom, instead of the bitmap exactly matching |
| 268 | // the clip (in which case we should see all blue). |
| 269 | // The correct image should be all blue. |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 270 | void onDraw(SkCanvas* canvas) override { |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 271 | SkPaint paint; |
| 272 | paint.setColor(SK_ColorRED); |
| 273 | |
| 274 | const SkRect r = SkRect::MakeXYWH(1, 1, 110, 114); |
| 275 | canvas->scale(0.9f, 0.9f); |
| 276 | |
| 277 | // the drawRect shows the same problem as clipRect(r) followed by drawcolor(red) |
| 278 | canvas->drawRect(r, paint); |
Mike Reed | fa582c8 | 2021-01-23 22:07:05 -0500 | [diff] [blame] | 279 | canvas->drawImageRect(fBM.asImage(), r, SkSamplingOptions()); |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 280 | } |
mtklein | 1c40292 | 2015-01-23 11:07:07 -0800 | [diff] [blame] | 281 | |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 282 | private: |
John Stiles | 7571f9e | 2020-09-02 22:42:33 -0400 | [diff] [blame] | 283 | using INHERITED = skiagm::GM; |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 284 | }; |
reed | 0393912 | 2014-12-15 13:42:51 -0800 | [diff] [blame] | 285 | DEF_GM( return new BitmapRectRounding; ) |
reed | f786901 | 2014-12-01 13:54:01 -0800 | [diff] [blame] | 286 | |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 287 | ////////////////////////////////////////////////////////////////////////////// |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 288 | |
scroggo | 96f16e8 | 2015-12-10 13:31:59 -0800 | [diff] [blame] | 289 | DEF_GM( return new DrawBitmapRect2(false); ) |
| 290 | DEF_GM( return new DrawBitmapRect2(true); ) |
| 291 | DEF_GM( return new DrawBitmapRect3(); ) |
robertphillips@google.com | 21a95f1 | 2012-09-26 13:10:19 +0000 | [diff] [blame] | 292 | |
robertphillips@google.com | 653b0d6 | 2012-09-26 15:28:04 +0000 | [diff] [blame] | 293 | #ifndef SK_BUILD_FOR_ANDROID |
scroggo | 96f16e8 | 2015-12-10 13:31:59 -0800 | [diff] [blame] | 294 | DEF_GM( return new DrawBitmapRect4(false); ) |
| 295 | DEF_GM( return new DrawBitmapRect4(true); ) |
robertphillips@google.com | 653b0d6 | 2012-09-26 15:28:04 +0000 | [diff] [blame] | 296 | #endif |