MCPcopy Create free account
hub / github.com/cogentcore/core / SetSizes

Method SetSizes

vgpu/szalloc/szalloc.go:83–88  ·  view source on GitHub ↗

SetSizes sets the max number of groups along each dimension (X, Y), so total number of groups is X*Y, and max items per group, and item sizes to organize -- directly uses the given slice so it should not be something that is reallocated.

(gps image.Point, itmsPerGp int, itms []image.Point)

Source from the content-addressed store, hash-verified

81// and item sizes to organize -- directly uses the given slice
82// so it should not be something that is reallocated.
83func (sa *SzAlloc) SetSizes(gps image.Point, itmsPerGp int, itms []image.Point) {
84 sa.MaxGps = gps
85 sa.MaxNGps = Area(gps)
86 sa.MaxItemsPerGp = itmsPerGp
87 sa.ItemSizes = itms
88}
89
90func Area(sz image.Point) int {
91 return sz.X * sz.Y

Callers 6

TestRandSzAllocFunction · 0.95
TestUniqSzAllocFunction · 0.95
AllocTexBySizeMethod · 0.45
allocSizesMethod · 0.45
setUnitContextFunction · 0.45
styleSizeUpdateMethod · 0.45

Calls 1

AreaFunction · 0.85

Tested by 2

TestRandSzAllocFunction · 0.76
TestUniqSzAllocFunction · 0.76