Commit 11d94d86 by Jamie Madill Committed by Commit Bot

Integrate Skia Gold with restricted trace tests.

The implementation is based heavily on the Chromium Skia Gold Python classes in //build/skia_gold_common . Results will be visible here: https://angle-gold.skia.org/ Currently results are not visible until this CL lands. Bug: angleproject:4090 Bug: b/168049670 Change-Id: I7a5d64fe35583ad7ea6360804a0f6b72cd9f6d8b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2430179Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarBrian Sheedy <bsheedy@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 38ef7955
...@@ -385,8 +385,15 @@ void TracePerfTest::saveScreenshot(const std::string &screenshotName) ...@@ -385,8 +385,15 @@ void TracePerfTest::saveScreenshot(const std::string &screenshotName)
} }
} }
angle::SavePNGRGB(screenshotName.c_str(), "ANGLE Screenshot", mTestParams.windowWidth, if (!angle::SavePNGRGB(screenshotName.c_str(), "ANGLE Screenshot", mTestParams.windowWidth,
mTestParams.windowHeight, rgbData); mTestParams.windowHeight, rgbData))
{
FAIL() << "Error saving screenshot: " << screenshotName;
}
else
{
printf("Saved screenshot: '%s'\n", screenshotName.c_str());
}
// Finish the frame loop. // Finish the frame loop.
for (uint32_t nextFrame = traceInfo.startFrame + 1; nextFrame <= traceInfo.endFrame; for (uint32_t nextFrame = traceInfo.startFrame + 1; nextFrame <= traceInfo.endFrame;
......
...@@ -64,12 +64,33 @@ angle_shared_library("angle_restricted_traces") { ...@@ -64,12 +64,33 @@ angle_shared_library("angle_restricted_traces") {
} }
} }
group("goldctl") {
data = []
# Because this links to a CIPD dependency, which is a symlink on Unix
# platforms, refer to the actual executable rather than the whole directory;
# copying the whole directory doesn't work, at least with "mb.py zip".
if (is_win) {
data += [ "//tools/skia_goldctl/win/goldctl.exe" ]
} else if (is_mac) {
data += [ "//tools/skia_goldctl/mac/goldctl" ]
} else {
data += [ "//tools/skia_goldctl/linux/goldctl" ]
}
}
group("angle_restricted_trace_gold_tests") { group("angle_restricted_trace_gold_tests") {
testonly = true testonly = true
data_deps = [ "$angle_root/src/tests:angle_perftests" ] data_deps = [
":goldctl",
"$angle_root/src/tests:angle_perftests",
"$angle_root/src/tests:angle_system_info_test",
]
data = [ data = [
"restricted_trace_gold_tests.py", "restricted_trace_gold_tests.py",
"restricted_traces.json", "restricted_traces.json",
"skia_gold/",
"//build/skia_gold_common/",
"//testing/scripts/common.py", "//testing/scripts/common.py",
"//testing/xvfb.py", "//testing/xvfb.py",
] ]
......
# Copyright 2020 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
d = os.path.dirname
THIS_DIR = d(os.path.abspath(__file__))
ANGLE_SRC_DIR = d(d(d(d(THIS_DIR))))
sys.path.insert(0, os.path.join(ANGLE_SRC_DIR, 'build'))
CHROMIUM_SRC_DIR = d(d(ANGLE_SRC_DIR))
sys.path.insert(0, os.path.join(CHROMIUM_SRC_DIR, 'build'))
# Copyright 2020 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ANGLE implementation of //build/skia_gold_common/skia_gold_properties.py."""
import subprocess
from skia_gold_common import skia_gold_properties
class ANGLESkiaGoldProperties(skia_gold_properties.SkiaGoldProperties):
@staticmethod
def _GetGitOriginMasterHeadSha1():
try:
return subprocess.check_output(['git', 'rev-parse', 'origin/master'],
shell=_IsWin(),
cwd=ANGLE_SRC_DIR).strip()
except subprocess.CalledProcessError:
return None
def _IsWin():
return sys.platform == 'win32'
# Copyright 2020 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ANGLE implementation of //build/skia_gold_common/skia_gold_session.py."""
from skia_gold_common import output_managerless_skia_gold_session as omsgs
class ANGLESkiaGoldSession(omsgs.OutputManagerlessSkiaGoldSession):
def _GetDiffGoldInstance(self):
return str(self._instance)
# Copyright 2020 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ANGLE implementation of //build/skia_gold_common/skia_gold_session_manager.py."""
from skia_gold_common import skia_gold_session_manager as sgsm
import angle_skia_gold_session
class ANGLESkiaGoldSessionManager(sgsm.SkiaGoldSessionManager):
@staticmethod
def _GetDefaultInstance():
return 'angle'
@staticmethod
def GetSessionClass():
return angle_skia_gold_session.ANGLESkiaGoldSession
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