Commit 2d283b78 authored by Mike Reed's avatar Mike Reed Committed by Chromium LUCI CQ

Opt into new picture-shader sampling

Test images rebaselined to account for the new behavior in skia's
picture-shader when a post-raster sampling is required.

Note on change to cc_unittest:

Several of these tests try to compare output between a direct draw
(RasterExpectedBitmap) and an OOPR draw (Raster), expecting the two
results to be identical.

However, OOP doesn't *always* produce the same Skia calls as direct;
if it sees a picture-shader (PaintShader::MakePaintRecord) it will
convert this to a pre-scaled picture-image-shader, and then draw with
that. This makes it invalid to always require *exact* pixel comparisons,
since it may have sent (slightly) different commands/floats to the GPU.

This CL (with a change to picture-shader's handling of post-raster
sampling) stumbled over such a different (perhaps only on
Nexus5-lollipop). To make the test more robust, those tests now
call set_has_animated_images(true) to force converting kRasterAtScale
to kFixedScale for both direct and oop.

Change-Id: Ic0ce9128c75ea598f593187f3a1b54e2c0c4cd8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2619838Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarFlorin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Cr-Commit-Position: refs/heads/master@{#844395}
parent 88b020c4
...@@ -683,6 +683,10 @@ TEST_F(OopImagePixelTest, DrawRecordShaderTranslatedTileRect) { ...@@ -683,6 +683,10 @@ TEST_F(OopImagePixelTest, DrawRecordShaderTranslatedTileRect) {
sk_sp<PaintShader> paint_record_shader = PaintShader::MakePaintRecord( sk_sp<PaintShader> paint_record_shader = PaintShader::MakePaintRecord(
shader_buffer, tile_rect, SkTileMode::kRepeat, SkTileMode::kRepeat, shader_buffer, tile_rect, SkTileMode::kRepeat, SkTileMode::kRepeat,
nullptr, PaintShader::ScalingBehavior::kRasterAtScale); nullptr, PaintShader::ScalingBehavior::kRasterAtScale);
// Force paint_flags to convert this to kFixedScale, so we can safely compare
// pixels between direct and oop-r modes (since oop will convert to
// kFixedScale no matter what.
paint_record_shader->set_has_animated_images(true);
gfx::Size output_size(10, 10); gfx::Size output_size(10, 10);
...@@ -1712,7 +1716,12 @@ class OopRecordShaderPixelTest : public OopPixelTest, ...@@ -1712,7 +1716,12 @@ class OopRecordShaderPixelTest : public OopPixelTest,
BuildTextBlob(SkTypeface::MakeDefault(), UseLcdText()), 0u, 0u, flags); BuildTextBlob(SkTypeface::MakeDefault(), UseLcdText()), 0u, 0u, flags);
auto paint_record_shader = PaintShader::MakePaintRecord( auto paint_record_shader = PaintShader::MakePaintRecord(
paint_record, SkRect::MakeWH(25, 25), SkTileMode::kRepeat, paint_record, SkRect::MakeWH(25, 25), SkTileMode::kRepeat,
SkTileMode::kRepeat, nullptr); SkTileMode::kRepeat, nullptr,
PaintShader::ScalingBehavior::kRasterAtScale);
// Force paint_flags to convert this to kFixedScale, so we can safely
// compare pixels between direct and oop-r modes (since oop will convert to
// kFixedScale no matter what.
paint_record_shader->set_has_animated_images(true);
auto display_item_list = base::MakeRefCounted<DisplayItemList>(); auto display_item_list = base::MakeRefCounted<DisplayItemList>();
display_item_list->StartPaint(); display_item_list->StartPaint();
......
...@@ -214,10 +214,6 @@ SK_API void SkDebugf_FileLine(const char* file, ...@@ -214,10 +214,6 @@ SK_API void SkDebugf_FileLine(const char* file,
#define SK_DISABLE_REDUCE_OPLIST_SPLITTING #define SK_DISABLE_REDUCE_OPLIST_SPLITTING
#endif #endif
#ifndef SK_SUPPORT_LEGACY_INHERITED_PICTURE_SHADER_FILTER
#define SK_SUPPORT_LEGACY_INHERITED_PICTURE_SHADER_FILTER
#endif
// Max. verb count for paths rendered by the edge-AA tessellating path renderer. // Max. verb count for paths rendered by the edge-AA tessellating path renderer.
#define GR_AA_TESSELLATOR_MAX_VERB_COUNT 100 #define GR_AA_TESSELLATOR_MAX_VERB_COUNT 100
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment