Commit 7cd177f2 authored by Brian Salomon's avatar Brian Salomon Committed by Commit Bot

Reland "Reland "Avoid testing antialiased boundary in ScreenshotSyncIntegrationTest.""

This is a reland of 23370775

This reland undoes all the changes to start_x. start_X is now 10 as it was before
the original change.

Original change's description:
> Reland "Avoid testing antialiased boundary in ScreenshotSyncIntegrationTest."
>
> This is a reland of 841c0dde
>
> The updated change uses window.devicePixelRatio to determine the inset.
> It also accounts for the absolute position used by the "WithDivs"
> variations of this test. One additional device pixel of offset is used
> to make this pass on mac_chromium_rel_ng. This is probably necessary
> because either window.devicePixelRatio reports 1 incorrectly or the
> edge antialiasing covers slightly more than one pixel. This wasn't
> investigated.
>
> Original change's description:
> > Avoid testing antialiased boundary in ScreenshotSyncIntegrationTest.
> >
> > Skia currently has a driver workaround that performans antialiased
> > rectangle edge equation evalution in the fragment shader rather than
> > vertex shader on Adreno 3xx GPUs. This was done because the interpolation
> > of values computed in the vertex shader lacks enough precision to pass
> > these tests. However, doing so has a negative performance impact. Skia
> > tests run with the workaround removed show that in practice the visual
> > difference is insignificant. Moreover, cc::GLRenderer also incurs these
> > same errors as it uses the same antialiasing approach without the
> > workaround and has shipped on Adreno 3xx devices for years with no known
> > complaints about antialiasing quality/accuracy. We're better off
> > reclaiming the performance and accepting a small hit to antialiasing
> > accuracy.
> >
> > Bug: 847984
> > Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
> > Change-Id: If1e62e0780a752179a75ddd57ccc7b24128c68ac
> > Reviewed-on: https://chromium-review.googlesource.com/1129041
> > Reviewed-by: Kenneth Russell <kbr@chromium.org>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Cr-Commit-Position: refs/heads/master@{#573695}
>
> Bug: 847984
> Change-Id: Ie5e685e8d5e0afbcf4c54ea3186ee68d238464ba
> Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
> Reviewed-on: https://chromium-review.googlesource.com/1132574
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#574369}

Bug: 847984
Change-Id: I29a31001bd76436eba60df87ffe26fdb03d6d032
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/1138293
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575322}
parent 8059da40
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import math
import os
import random
import sys
......@@ -119,9 +120,17 @@ class ScreenshotSyncIntegrationTest(gpu_integration_test.GpuIntegrationTest):
"window.draw({{ red }}, {{ green }}, {{ blue }});",
red=canvasRGB.r, green=canvasRGB.g, blue=canvasRGB.b)
screenshot = tab.Screenshot(10)
# Avoid checking along antialiased boundary due to limited Adreno 3xx
# interpolation precision (crbug.com/847984). We inset by one CSS pixel
# adjusted by the device pixel ratio.
inset = int(math.ceil(tab.EvaluateJavaScript('window.devicePixelRatio')))
# It seems that we should be able to set start_x to 2 * inset (one to
# account for the inner div having left=1 and one to avoid sampling the
# aa edge). For reasons not fully understood this is insufficent on
# several bots (N9, 6P, mac_chromium_rel_ng).
start_x = 10
start_y = 0
outer_size = 256
start_y = inset
outer_size = 256 - inset
skip = 10
for y in range(start_y, outer_size, skip):
for x in range(start_x, outer_size, skip):
......
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