Documentation
¶
Overview ¶
Package renderingtest is a temporary harness for the tests of the rendering library: it builds a RendererBinding on a fake engine, lays out and paints a render tree through the pipeline, and renders the scene with the software renderer. It stands in for gluttertest (step 7.5), which replaces it.
Flutter: no counterpart (test/rendering/rendering_tester.dart)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BundledTextEngine ¶
BundledTextEngine is a text engine that has only the fonts bundled with Glutter, so that the text is laid out the same on every machine. The engine is made once per process, because registering the fonts is slow.
func NewTextEngine ¶
NewTextEngine makes a text engine of its own, with the bundled fonts and the given ones and no system font, for a test that must not change the shared engine of BundledTextEngine. It fails with the tags of text.Collection.AddFont.
Types ¶
type Font ¶
Font is a font for NewTextEngine: the bytes of a TrueType or OpenType file under a family name (the name inside the font when Family is empty).
type Harness ¶
type Harness struct {
*renderhost.Stack
// TextEngine is the engine that lays out the text.
TextEngine ui.ParagraphFactory
// Errors collects the errors that the binding reported.
Errors []error
}
Harness is a rendering binding on a fake engine, with one view.
func New ¶
New creates the harness with the render view attached to the binding's root pipeline owner, ready for SetRoot.
type Opts ¶
type Opts struct {
// Size is the size of the view in physical pixels; the default is 800x600.
Size ui.Size
// DevicePixelRatio defaults to 1.
DevicePixelRatio float64
// Debug are the debug flags; the default is a fresh set.
Debug *rendering.DebugOptions
// TextEngine lays out the text; the default is BundledTextEngine().
TextEngine ui.ParagraphFactory
// CollectPanics makes the harness collect the panics that layout and paint
// recover in Errors. By default it panics again with them, so that a test
// that does not expect one fails where it happens.
CollectPanics bool
}
Opts are the optional parameters of New.