4545 };
4546
4547
4548
4550 const int step = 0x55;
4551 static_assert(step * 3 == 255);
4552 for (int a = step; a < 256; a += step) {
4553 for (int r = step; r < 256; r += step) {
4554 for (int g = step; g < 256; g += step) {
4555 for (
int b = step;
b < 256;
b += step) {
4557 }
4558 }
4559 }
4560 }
4561
4562 static constexpr float color_filter_matrix_nomtb[] = {
4563 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4564 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4565 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4566 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4567 };
4568 static constexpr float color_filter_matrix_mtb[] = {
4569 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4570 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4571 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4572 0.0001, 0.0001, 0.0001, 0.9997, 0.1,
4573 };
4578
4581 int x = 0;
4582 for (DlColor color : test_dst_colors) {
4583 SkPaint paint;
4584 paint.setColor(ToSkColor4f(color));
4585 paint.setBlendMode(SkBlendMode::kSrc);
4586 canvas->drawRect(SkRect::MakeXYWH(x, 0, 1, 1), paint);
4587 x++;
4588 }
4589 });
4590
4591
4592
4593
4594
4595 int data_count =
test_data->image()->width();
4597 data_count, data_count, true, [this, data_count](SkCanvas* canvas) {
4598 ASSERT_EQ(
test_data->width(), data_count);
4600 for (
int y = 0;
y < data_count;
y++) {
4601 canvas->drawImage(
test_data->image().get(), 0,
y);
4602 }
4603 });
4605 data_count, data_count, true, [this, data_count](SkCanvas* canvas) {
4606 ASSERT_EQ(
test_data->width(), data_count);
4608 canvas->translate(data_count, 0);
4609 canvas->rotate(90);
4610 for (
int y = 0;
y < data_count;
y++) {
4611 canvas->drawImage(
test_data->image().get(), 0,
y);
4612 }
4613 });
4614
4615 for (
int y = 0;
y < data_count;
y++) {
4616 for (
int x = 0;
x < data_count;
x++) {
4619 }
4620 }
4621 }
static std::shared_ptr< const DlColorFilter > MakeMatrix(const float matrix[20])
std::unique_ptr< RenderResult > test_data
std::shared_ptr< const 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::shared_ptr< const DlColorFilter > color_filter_mtb
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()
static constexpr DlColor kTransparent()
static constexpr DlColor kRed()
static constexpr DlColor kGreen()
static constexpr DlColor kDarkGrey()
DlColor withAlpha(uint8_t alpha) const