Flutter Engine
The Flutter Engine
skbug6031.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(skbug6031, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 constexpr float kW = 512;
7 constexpr float kH = 512;
8
10 static constexpr SkClipOp replaceClipOp = static_cast<SkClipOp>(5);
11
12 canvas->clipRect(SkRect{0, 0, 2 * kW, 2 * kH}, replaceClipOp);
13 paint.setColor(SkColorSetARGB(0, 0, 0, 0));
14 canvas->drawPaint(paint);
15
16 canvas->clipRect(SkRect{0, 0, kW, kH}, replaceClipOp);
17 paint.setColor(SkColorSetARGB(255, 127, 0, 0));
18 canvas->drawPaint(paint);
19
20 canvas->clipRect(SkRect{0, kH, kW, 3 * kH}, replaceClipOp);
21 paint.setColor(SkColorSetARGB(255, 0, 127, 0));
22 canvas->drawPaint(paint);
23
24 canvas->clipRect(SkRect{kW, 0, 3 * kW, kH}, replaceClipOp);
25 paint.setColor(SkColorSetARGB(255, 0, 0, 127));
26 canvas->drawPaint(paint);
27
28 canvas->clipRect(SkRect{kW, kH, 3 * kW, 3 * kH}, replaceClipOp);
29 paint.setColor(SkColorSetARGB(255, 127, 127, 0));
30 canvas->drawPaint(paint);
31}
32} // END FIDDLE
SkClipOp
Definition: SkClipOp.h:13
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColor.h:49
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
constexpr int kH
constexpr int kW
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void drawPaint(const SkPaint &paint)
Definition: SkCanvas.cpp:1668
const Paint & paint
Definition: color_source.cc:38
REG_FIDDLE(skbug6031, 256, 256, false, 0)
Definition: skbug6031.cpp:4