4548 };
4549
4550
4551
4553 const int step = 0x55;
4554 static_assert(step * 3 == 255);
4555 for (int a = step; a < 256; a += step) {
4556 for (int r = step; r < 256; r += step) {
4557 for (int g = step; g < 256; g += step) {
4558 for (
int b = step;
b < 256;
b += step) {
4560 }
4561 }
4562 }
4563 }
4564
4565 static constexpr float color_filter_matrix_nomtb[] = {
4566 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4567 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4568 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4569 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4570 };
4571 static constexpr float color_filter_matrix_mtb[] = {
4572 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4573 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4574 0.0001, 0.0001, 0.0001, 0.9997, 0.0,
4575 0.0001, 0.0001, 0.0001, 0.9997, 0.1,
4576 };
4581
4584 int x = 0;
4585 for (DlColor color : test_dst_colors) {
4586 SkPaint paint;
4587 paint.setColor(ToSkColor4f(color));
4588 paint.setBlendMode(SkBlendMode::kSrc);
4589 canvas->drawRect(SkRect::MakeXYWH(x, 0, 1, 1), paint);
4590 x++;
4591 }
4592 });
4593
4594
4595
4596
4597
4598 int data_count =
test_data->image()->width();
4600 data_count, data_count, true, [this, data_count](SkCanvas* canvas) {
4601 ASSERT_EQ(
test_data->width(), data_count);
4603 for (
int y = 0;
y < data_count;
y++) {
4604 canvas->drawImage(
test_data->image().get(), 0,
y);
4605 }
4606 });
4608 data_count, data_count, true, [this, data_count](SkCanvas* canvas) {
4609 ASSERT_EQ(
test_data->width(), data_count);
4611 canvas->translate(data_count, 0);
4612 canvas->rotate(90);
4613 for (
int y = 0;
y < data_count;
y++) {
4614 canvas->drawImage(
test_data->image().get(), 0,
y);
4615 }
4616 });
4617
4618 for (
int y = 0;
y < data_count;
y++) {
4619 for (
int x = 0;
x < data_count;
x++) {
4622 }
4623 }
4624 }
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