* @ignore
(texture)
| 120 | * @ignore |
| 121 | */ |
| 122 | getUnit(texture) { |
| 123 | const source = texture.sources.get(texture.activeAtlas); |
| 124 | const repeat = normalizeRepeat(texture.repeat); |
| 125 | let perRepeat = this.units.get(source); |
| 126 | if (perRepeat === undefined) { |
| 127 | perRepeat = new Map(); |
| 128 | this.units.set(source, perRepeat); |
| 129 | } |
| 130 | if (!perRepeat.has(repeat)) { |
| 131 | perRepeat.set(repeat, this.allocateTextureUnit()); |
| 132 | } |
| 133 | return perRepeat.get(repeat); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * @ignore |
no test coverage detected