Documentation
¶
Overview ¶
Package issues holds the reproductions of reported issues that the tests of every platform share: what to draw or do, a report of what came of it that can be written as text on a device and read on the host, and the check of the report. A fix is tried on one machine, and its renderer or platform code runs on the others too (Vulkan, OpenGL ES, Metal, Direct3D 12, WebGPU; Linux, Android, Windows, macOS, iOS, the web), so each platform has a test that runs the same reproduction and the same check: in the test process where a device can be opened there, in an app on the emulator, the Simulator or a browser page where it cannot.
The package is plain Go with no OS tags, and it does not import testing: the apps of the device tests link it (examples/dev/android-parity, the page apps gpuwebtest and glwebtest).
Index ¶
Constants ¶
const ( AtlasFullWidth = 1920 AtlasFullHeight = 1080 )
AtlasFullWidth and AtlasFullHeight are the size of the frames of the reproduction, in pixels.
const AtlasFullName = "atlas-full"
AtlasFullName is the name of the issue: what an app of a device test is asked for, and the prefix of the lines of its report.
const Env = "GLUTTER_ISSUE"
Env is the environment variable that names the issue an app of a device test reproduces (examples/dev/android-parity): the app and the test on the host agree on it here.
const TagIssueReportInvalid = "IssueReportInvalid"
TagIssueReportInvalid is the tag of the error of a report that does not read.
Variables ¶
This section is empty.
Functions ¶
func ShadowsScene ¶
ShadowsScene draws n shadows of panels that fill a surface of AtlasFullWidth x AtlasFullHeight pixels, each of a size of its own, so that no two share their tiles of the coverage atlas.
Types ¶
type AtlasFullDraw ¶
AtlasFullDraw draws a scene of the given size on the renderer under test and returns the pixels of the frame and the renderer's numbers of it.
type AtlasFullFrame ¶
type AtlasFullFrame struct {
Name string
AtlasFullStats
// Pixels is the SHA-256 of the frame's pixels, in hexadecimal.
Pixels string
// Shadow is how much a pixel just under the largest panel differs from a pixel of the
// background in a corner of the frame, summed over the four channels: nothing where no
// shadow was drawn, whatever the background is (white in a window, nothing off screen).
Shadow int
}
AtlasFullFrame is what came of one frame.
func AtlasFullFrameOf ¶
func AtlasFullFrameOf(name string, img *image.RGBA, st AtlasFullStats) AtlasFullFrame
AtlasFullFrameOf makes the record of a frame from its pixels and the renderer's numbers.
type AtlasFullReport ¶
type AtlasFullReport struct {
Frames []AtlasFullFrame
}
AtlasFullReport is what came of the frames of the reproduction on one renderer.
func ParseAtlasFull ¶
func ParseAtlasFull(lines []string) (AtlasFullReport, error)
ParseAtlasFull reads a report from the lines of an app's file or output; lines that are not of the report are passed over. It fails with IssueReportInvalid for a line of the report that does not read.
func RunAtlasFull ¶
func RunAtlasFull(draw AtlasFullDraw) (AtlasFullReport, *image.RGBA, error)
RunAtlasFull draws the frames of the reproduction and returns the report and the pixels of the first frame. An error of a frame, which is the issue itself on the code before the fix (AtlasFull), ends the run: the report then has the frames before it.
func (AtlasFullReport) Lines ¶
func (r AtlasFullReport) Lines() []string
Lines returns the report as text, one line for each frame, for an app on a device to write into a file or its output.
func (AtlasFullReport) Problems ¶
func (r AtlasFullReport) Problems() []string
Problems checks the report and returns what is wrong, one line for each finding; none when the renderer drew the frame of the issue whole, kept its tiles for the same frame, freed the pages over what the atlas keeps after the small frame, and drew the first frame again with the pixels it had.
type AtlasFullScene ¶
AtlasFullScene is one frame of the reproduction.
func AtlasFullScenes ¶
func AtlasFullScenes() []AtlasFullScene
AtlasFullScenes returns the frames of the reproduction, in the order a renderer draws them: the frame of the issue, the same again (its tiles are kept), a small frame (the pages over what the atlas keeps are freed), and the first again (on pages made again).