205 {
206 const int WIDTH = 400;
208 const int SPACER = 10;
209
211 layerRect.
inset(2*SPACER, 2*SPACER);
212
216
219
220 SkIRect regionInterior = regionBounds;
221 regionInterior.
inset(SPACER*3, SPACER*3);
222
224 clipRegion.
setRect(regionBounds);
226
227
231 };
232
234 int32_t r, int32_t
b, int32_t clipOp,
235 int32_t regionRects, int32_t* rectCoords);
236
237#if defined(SK_TEST_CANVAS_STATE_CROSS_LIBRARY)
238 OpenLibResult openLibResult(
reporter);
239 *(void**) (&drawFn) = openLibResult.procAddress("complex_clips_draw_from_canvas_state");
240#else
242#endif
243
245 if (!drawFn) {
246 return;
247 }
248
250 for (int i = 0; i < 2; ++i) {
252 SkCanvas* canvas = surf->getCanvas();
253
255
257
260 for (size_t j = 0; j < std::size(clipOps); ++j) {
263
264 if (i) {
267
270 for (; !iter.done(); iter.next()) {
276 }
279 rectCoords.
size() / 4, rectCoords.
begin());
281
283 } else {
286 localRegion);
287 }
288
290
291
294 }
295 images[i] = surf->makeImageSnapshot();
296 }
297
299}
bool complex_clips_draw_from_canvas_state(SkCanvasState *state, int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t clipOp, int32_t regionRects, int32_t *rectCoords)
void complex_clips_draw(SkCanvas *canvas, int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t clipOp, const SkRegion &localRegion)
static void compare(skiatest::Reporter *reporter, SkImage *img0, SkImage *img1)
constexpr SkColor SK_ColorRED
static SkCanvasState * CaptureCanvasState(SkCanvas *canvas)
static void ReleaseCanvasState(SkCanvasState *state)
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void translate(int dx, int dy)
@ kIntersect_Op
target intersected with operand
@ kDifference_Op
target minus operand
bool op(const SkIRect &rect, Op op)
bool setRect(const SkIRect &rect)
std::array< MockImage, 3 > images
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
sk_sp< SkBlender > blender SkRect rect
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
const myers::Point & get(const myers::Segment &)
void inset(int32_t dx, int32_t dy)
constexpr int32_t height() const
void offset(int32_t dx, int32_t dy)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkRect Make(const SkISize &size)