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
- func ShadowsScene(n int) *ui.Scene
- func SoftMipmapsPicture(seed uint8) *ui.Image
- type AtlasFullDraw
- type AtlasFullFrame
- type AtlasFullReport
- type AtlasFullScene
- type AtlasFullStats
- type SoftMipmapsDraw
- type SoftMipmapsFrame
- type SoftMipmapsReport
- type SoftMipmapsScene
- type SoftMipmapsStats
Constants ¶
const ( AtlasFullWidth = 1920 AtlasFullHeight = 1080 )
AtlasFullWidth and AtlasFullHeight are the size of the frames of the reproduction, in pixels.
const ( // DoneLine follows the last line of the report: the run of the issue ended without an error. DoneLine = "GLUTTER_ISSUE done" // FailedLine is the line of a run that failed, followed by the error. FailedLine = "GLUTTER_ISSUE failed" )
The lines that an app which prints its report into its output (internal/iostest/issueapp, in the Simulator) ends the report with, so that the test on the host knows when the report is whole. The lines of the report are those of the issue's Lines.
const ( SoftMipmapsWidth = 640 SoftMipmapsHeight = 480 )
SoftMipmapsWidth and SoftMipmapsHeight 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, internal/iostest/issueapp): the app and the test on the host agree on it here.
const SoftMipmapsName = "soft-mipmaps"
SoftMipmapsName 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 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.
func SoftMipmapsPicture ¶
SoftMipmapsPicture returns a picture of the reproduction: 1024 x 768 pixels of blocks of 16 pixels in two colors that the seed changes.
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).
type AtlasFullStats ¶
AtlasFullStats is what a renderer says of a frame it drew (the fields of the same names of explicit.FrameStats and gles.FrameStats).
type SoftMipmapsDraw ¶
type SoftMipmapsDraw func(scene *ui.Scene, width, height int) (*image.RGBA, SoftMipmapsStats, error)
SoftMipmapsDraw draws a scene of the given size on the renderer under test, as one frame, and returns the pixels of the frame and what the renderer's cache of mipmap chains says after it.
type SoftMipmapsFrame ¶
type SoftMipmapsFrame struct {
Name string
// Built is how many mipmap chains the frame made, and Chains how many the renderer holds
// after it.
Built, Chains int
// Picture and Spinner are the SHA-256, in hexadecimal, of the pixels of a band of the picture
// far from the spinner and of the box the spinner turns in.
Picture, Spinner string
// Block says whether the middle of the first block of the picture, at half its size, has the
// color of the picture the frame shows, within 3 in each channel.
Block bool
}
SoftMipmapsFrame is what came of one frame.
func SoftMipmapsFrameOf ¶
func SoftMipmapsFrameOf(sc SoftMipmapsScene, img *image.RGBA, built, chains int) SoftMipmapsFrame
SoftMipmapsFrameOf makes the record of a frame from its pixels and the chains it made and the renderer holds.
type SoftMipmapsReport ¶
type SoftMipmapsReport struct {
Frames []SoftMipmapsFrame
}
SoftMipmapsReport is what came of the frames of the reproduction on one renderer.
func ParseSoftMipmaps ¶
func ParseSoftMipmaps(lines []string) (SoftMipmapsReport, error)
ParseSoftMipmaps 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 RunSoftMipmaps ¶
func RunSoftMipmaps(draw SoftMipmapsDraw) (SoftMipmapsReport, error)
RunSoftMipmaps draws the frames of the reproduction and returns the report. An error of a frame ends the run: the report then has the frames before it.
func (SoftMipmapsReport) Lines ¶
func (r SoftMipmapsReport) 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 (SoftMipmapsReport) Problems ¶
func (r SoftMipmapsReport) Problems() []string
Problems checks the report and returns what is wrong, one line for each finding; none when the renderer made the chain of each picture once, kept both, and drew every frame with the picture it shows and the spinner where it turned to.
type SoftMipmapsScene ¶
type SoftMipmapsScene struct {
Name string
Scene *ui.Scene
// Seed is the seed of the picture the frame shows.
Seed uint8
}
SoftMipmapsScene is one frame of the reproduction.
func SoftMipmapsScenes ¶
func SoftMipmapsScenes() []SoftMipmapsScene
SoftMipmapsScenes returns the frames of the reproduction, in the order a renderer draws them. Each picture is recorded once, in a layer of its own, as a repaint boundary keeps it, and the spinner is a layer over it that changes in every frame.
type SoftMipmapsStats ¶
SoftMipmapsStats is what a renderer's cache of mipmap chains says after a frame (the fields of the same names of soft.CacheStats): the chains it holds, and how many it has made since it was made.