Commit 625c29d9 authored by Sean Gilhuly's avatar Sean Gilhuly Committed by Commit Bot

Add baseline images for SkiaRenderer AA tests

SkiaRenderer's handling of AA edges is slightly different (up to 10
difference in the RGB values), but perceptually close enough. Add images
specific to SkiaRenderer to the tests AntiAliasing and
AntiAliasingPerspective.

Bug: 947055
Change-Id: If7e9571ec6a038d28786b23e21870ea5a4312146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553879Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Sean Gilhuly <sgilhuly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648744}
parent ef070420
......@@ -3083,7 +3083,7 @@ TYPED_TEST(ExternalStencilPixelTest, RenderSurfacesIgnoreStencil) {
template <typename RendererType>
class RendererAAPixelTest : public RendererPixelTest<RendererType> {
public:
void AntiAliasing() {
void AntiAliasing(const base::FilePath& filepath) {
gfx::Rect rect(this->device_viewport_size_);
int id = 1;
......@@ -3115,12 +3115,11 @@ class RendererAAPixelTest : public RendererPixelTest<RendererType> {
RenderPassList pass_list;
pass_list.push_back(std::move(pass));
EXPECT_TRUE(this->RunPixelTest(
&pass_list, base::FilePath(FILE_PATH_LITERAL("anti_aliasing.png")),
cc::FuzzyPixelOffByOneComparator(true)));
EXPECT_TRUE(this->RunPixelTest(&pass_list, filepath,
cc::FuzzyPixelOffByOneComparator(true)));
}
void AntiAliasingPerspective() {
void AntiAliasingPerspective(const base::FilePath& filepath) {
gfx::Rect rect(this->device_viewport_size_);
std::unique_ptr<RenderPass> pass = CreateTestRootRenderPass(1, rect);
......@@ -3149,33 +3148,31 @@ class RendererAAPixelTest : public RendererPixelTest<RendererType> {
RenderPassList pass_list;
pass_list.push_back(std::move(pass));
EXPECT_TRUE(this->RunPixelTest(
&pass_list,
base::FilePath(FILE_PATH_LITERAL("anti_aliasing_perspective.png")),
cc::FuzzyPixelOffByOneComparator(true)));
EXPECT_TRUE(this->RunPixelTest(&pass_list, filepath,
cc::FuzzyPixelOffByOneComparator(true)));
}
};
// TODO(crbug.com/939442): Combine these tests once they are passing on
// SkiaRenderer.
using GLRendererAAPixelTest = RendererAAPixelTest<GLRenderer>;
using SkiaRendererAAPixelTest = RendererAAPixelTest<SkiaRenderer>;
// Software renderer does not support anti-aliased edges.
TEST_F(GLRendererAAPixelTest, AntiAliasing) {
AntiAliasing();
AntiAliasing(base::FilePath(FILE_PATH_LITERAL("anti_aliasing_gl.png")));
}
TEST_F(SkiaRendererAAPixelTest, DISABLED_AntiAliasing) {
AntiAliasing();
TEST_F(SkiaRendererAAPixelTest, AntiAliasing) {
AntiAliasing(base::FilePath(FILE_PATH_LITERAL("anti_aliasing_skia.png")));
}
TEST_F(GLRendererAAPixelTest, AntiAliasingPerspective) {
AntiAliasingPerspective();
AntiAliasingPerspective(
base::FilePath(FILE_PATH_LITERAL("anti_aliasing_perspective_gl.png")));
}
TEST_F(SkiaRendererAAPixelTest, DISABLED_AntiAliasingPerspective) {
AntiAliasingPerspective();
TEST_F(SkiaRendererAAPixelTest, AntiAliasingPerspective) {
AntiAliasingPerspective(
base::FilePath(FILE_PATH_LITERAL("anti_aliasing_perspective_skia.png")));
}
// This test tests that anti-aliasing works for axis aligned quads.
......
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