4360 };
4361
4362
4363
4365 const int step = 0x55;
4366 static_assert(
step * 3 == 255);
4368 for (
int r =
step; r < 256; r +=
step) {
4369 for (
int g =
step; g < 256; g +=
step) {
4372 }
4373 }
4374 }
4375 }
4376
4377 static constexpr float color_filter_matrix_nomtb[] = {
4378 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4379 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4380 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4381 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4382 };
4383 static constexpr float color_filter_matrix_mtb[] = {
4384 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4385 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4386 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4387 0.0001, 0.0001, 0.0001, 0.9997, 0.1,
4388 };
4393
4396 int x = 0;
4397 for (DlColor color : test_dst_colors) {
4398 SkPaint paint;
4399 paint.setColor(ToSk(color));
4400 paint.setBlendMode(SkBlendMode::kSrc);
4401 canvas->drawRect(SkRect::MakeXYWH(x, 0, 1, 1), paint);
4402 x++;
4403 }
4404 });
4405
4406
4407
4408
4409
4410 int data_count =
test_data->image()->width();
4412 data_count, data_count,
true, [
this, data_count](
SkCanvas* canvas) {
4413 ASSERT_EQ(
test_data->width(), data_count);
4415 for (
int y = 0;
y < data_count;
y++) {
4417 }
4418 });
4420 data_count, data_count,
true, [
this, data_count](
SkCanvas* canvas) {
4421 ASSERT_EQ(
test_data->width(), data_count);
4425 for (
int y = 0;
y < data_count;
y++) {
4427 }
4428 });
4429
4430 for (
int y = 0;
y < data_count;
y++) {
4431 for (
int x = 0;
x < data_count;
x++) {
4434 }
4435 }
4436 }
static int step(int x, SkScalar min, SkScalar max)
void translate(SkScalar dx, SkScalar dy)
void rotate(SkScalar degrees)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static std::shared_ptr< DlColorFilter > Make(const float matrix[20])
std::shared_ptr< DlColorFilter > color_filter_mtb
std::unique_ptr< RenderResult > test_data
std::shared_ptr< DlColorFilter > color_filter_nomtb
std::unique_ptr< RenderResult > test_image_dst_data
std::vector< DlColor > test_dst_colors
std::unique_ptr< RenderResult > test_image_src_data
std::vector< DlColor > test_src_colors
std::unique_ptr< RenderResult > get_output(int w, int h, bool snapshot, const std::function< void(SkCanvas *)> &renderer)
DisplayListRenderingTestBase<::testing::Test > DisplayListRendering
static constexpr DlColor kWhite()
static constexpr DlColor kBlue()
static constexpr DlColor kBlack()
static constexpr DlColor kLightGrey()
constexpr DlColor withAlpha(uint8_t alpha) const
static constexpr DlColor kTransparent()
static constexpr DlColor kRed()
static constexpr DlColor kGreen()
static constexpr DlColor kDarkGrey()
#define EXPECT_TRUE(handle)