95 {
96 auto context = ctxInfo.directContext();
97 static constexpr SkISize kDimensions{10, 10};
99
100
101 struct RectAndSamplePoint {
105 } allRectsAndPoints[3] = {
109 };
110
112 RectAndSamplePoint fRectAndPoints;
114 int fSampleCnt;
116 };
118
120 for (int sampleCnt : {1, 4}) {
121 for (auto rectAndPoints : allRectsAndPoints) {
123 testCases.push_back({rectAndPoints,
clip, sampleCnt, origin});
124 }
125 }
126 }
127 }
128
129
131 int sampleCnt = testCase.fSampleCnt;
132 SkRect paintRect = testCase.fRectAndPoints.rect;
133 SkIPoint outPoint = testCase.fRectAndPoints.outPoint;
134 SkIPoint inPoint = testCase.fRectAndPoints.inPoint;
136
137
139 kDimensions,
140 origin,
141 sampleCnt,
143
144 if (!
surface && sampleCnt > 1) {
145
146 continue;
147 }
149
150
152 canvas->
clipRect(testCase.fClip,
false);
156
157
158
162 canvas->
drawRect(paintRect, white_paint);
163
164
171
172
177 }
178}
@ kBottomLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define SkColorSetRGB(r, g, b)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
#define REPORTER_ASSERT(r, cond,...)
static constexpr auto kColorType
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void setColor(SkColor color)
void setBlendMode(SkBlendMode mode)
sk_sp< SkBlender > blender SkRect rect
sk_sp< SkSurface > MakeBackendRenderTargetSurface(GrDirectContext *dContext, const SkImageInfo &ii, GrSurfaceOrigin origin, int sampleCnt, GrProtected isProtected, const SkSurfaceProps *props)
constexpr int32_t y() const
static constexpr SkIPoint Make(int32_t x, int32_t y)
constexpr int32_t x() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkRect Make(const SkISize &size)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)