50 size->set(rand.
nextU() & 0xFFFF, rand.
nextU() & 0xFFFF);
62 for (
int i = 0; i < 1000; ++i) {
64 for (
int j = 0; j < 1000; ++j) {
71 for (
int i = 0; i < 1000; ++i) {
73 for (
int j = 0; j < 1000; ++j) {
82 const SkScalar tooMuchSubpixel = 100.1f;
88 const SkScalar tinySubPixel = 100.02f;
95 const SkScalar bigScale = (size.width() + twoThirds) / size.width();
101 const SkScalar smallScale = (size.width() + oneThird) / size.width();
102 mat.
setScale(smallScale, smallScale);
107 const SkScalar tinyScale = (size.width() + oneFortyth) / size.width();
122 matrix.setAll(-119.34097f,
139 matrix.setAll(0.0078740157f,
154 for (
int x = 0;
x < dev.
width(); ++
x) {
185 static const struct {
194 for (
size_t i = 0; i < std::size(
gTests); ++i) {
213 paint.setAntiAlias(
true);
226 const uint8_t* ptr =
reinterpret_cast<const uint8_t*
>(bm.
getAddr(0,
y));
227 for (
size_t i = 0; i <
count; i++) {
253 SkRect dstR = { 0, 0, 16, 16 };
static void rand_matrix(SkMatrix *mat, SkRandom &rand, unsigned mask)
static void test_nan_antihair()
static bool check_for_all_zeros(const SkBitmap &bm)
static void test_wacky_bitmapshader(skiatest::Reporter *reporter, int width, int height)
static void test_giantrepeat_crbug118018(skiatest::Reporter *reporter)
static void test_treatAsSprite(skiatest::Reporter *reporter)
static void rand_size(SkISize *size, SkRandom &rand)
static const TestCase gTests[]
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorRED
bool SkTreatAsSprite(const SkMatrix &mat, const SkISize &size, const SkSamplingOptions &sampling, bool isAntiAlias)
#define DEF_TEST(name, reporter)
#define REPORTER_ASSERT(r, cond,...)
void * getAddr(int x, int y) const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
int bytesPerPixel() const
void allocN32Pixels(int width, int height, bool isOpaque=false)
uint32_t * getAddr32(int x, int y) const
bool tryAllocN32Pixels(int width, int height, bool isOpaque=false)
void eraseColor(SkColor4f) const
void drawRect(const SkRect &rect, const SkPaint &paint)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void drawPath(const SkPath &path, const SkPaint &paint)
void concat(const SkMatrix &matrix)
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
SkMatrix & postRotate(SkScalar degrees, SkScalar px, SkScalar py)
SkMatrix & postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
SkMatrix & setPerspX(SkScalar v)
SkMatrix & setTranslate(SkScalar dx, SkScalar dy)
SkMatrix & setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
SkMatrix & setPerspY(SkScalar v)
@ kPerspective_Mask
perspective SkMatrix
@ kTranslate_Mask
translation SkMatrix
@ kScale_Mask
scale SkMatrix
@ kAffine_Mask
skew or rotate SkMatrix
@ kStroke_Style
set to stroke geometry
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)