25 for (
int index = 0; index < 1000; ++index) {
28 for (
int cIndex = 0; cIndex < contourCount; ++cIndex) {
31 for (
int lIndex = 0; lIndex < lineCount; ++lIndex) {
38 SkRect classicBounds = path.getBounds();
48 int outerCount =
reporter->allowExtendedTest() ? 100 : 1;
49 for (
int index = 0; index < outerCount; ++index) {
50 for (
int idx2 = 0; idx2 < 10; ++idx2) {
60 const int bitWidth = 32;
61 const int bitHeight = 32;
62 const float pathMin = 1;
63 const float pathMax = (float) (bitHeight - 2);
65 if (bits.width() == 0) {
66 bits.allocN32Pixels(bitWidth, bitHeight);
70 for (
int index = 0; index < 100; ++index) {
73 for (
int cIndex = 0; cIndex < contourCount; ++cIndex) {
76 for (
int lIndex = 0; lIndex < lineCount; ++lIndex) {
88 SkRect classicBounds = path.getBounds();
94 SkIRect bitsWritten = {31, 31, 0, 0};
95 for (
int y = 0;
y < bitHeight; ++
y) {
96 uint32_t* addr1 = data->fBitmap->getAddr32(0,
y);
97 bool lineWritten =
false;
98 for (
int x = 0;
x < bitWidth; ++
x) {
99 if (addr1[
x] == (uint32_t) -1) {
103 bitsWritten.
fLeft = std::min(bitsWritten.
fLeft,
x);
109 bitsWritten.
fTop = std::min(bitsWritten.
fTop,
y);
123 int outerCount =
reporter->allowExtendedTest() ? 100 : 1;
124 for (
int index = 0; index < outerCount; ++index) {
125 for (
int idx2 = 0; idx2 < 10; ++idx2) {
143 const SkRect& bounds = path.getBounds();
152 const SkRect& bounds = path.getBounds();
162 const SkRect& bounds = path.getBounds();
171 path.quadTo(1.000001f, 1, 1, 1);
172 const SkRect& bounds = path.getBounds();
175 SkRect moveBounds = {1, 1, 1, 1};
183 path.quadTo(2, 3, 4, 5);
184 const SkRect& bounds = path.getBounds();
193 path.quadTo(4, 3, 2, 2);
194 const SkRect& bounds = path.getBounds();
203 path.quadTo(1048578, 1048577, 1048576, 1048576);
204 const SkRect& bounds = path.getBounds();
void initializeTests(skiatest::Reporter *reporter, const char *test)
static void testTightBoundsQuads(PathOpsThreadState *data)
static void testTightBoundsLines(PathOpsThreadState *data)
constexpr SkColor SK_ColorWHITE
bool SK_API TightBounds(const SkPath &path, SkRect *result)
#define DEF_TEST(name, reporter)
#define REPORTER_ASSERT(r, cond,...)
SkTDArray< PathOpsThreadedRunnable * > fRunnables
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawPath(const SkPath &path, const SkPaint &paint)
float nextRangeF(float min, float max)
uint32_t nextRangeU(uint32_t min, uint32_t max)
int32_t fBottom
larger y-axis bounds
int32_t fTop
smaller y-axis bounds
int32_t fLeft
smaller x-axis bounds
bool contains(int32_t x, int32_t y) const
int32_t fRight
larger x-axis bounds
bool contains(SkScalar x, SkScalar y) const
void roundOut(SkIRect *dst) const
constexpr float right() const
constexpr float bottom() const