hasMethod('hd')); } /** How many texture pixels a view pixel has now (1 without HD). */ public static function factor(Renderer $r): int { return self::supported() ? max(1, (int)$r->hd()) : 1; } /** WebGl can compose its layer by the 2D's alpha (no key colour). */ public static function alphaLayers(): bool { if (self::$legacy) { return false; } if (self::$alpha === null) { $param = (new \ReflectionMethod(WebGl::class, 'setLayer'))->getParameters()[2] ?? null; self::$alpha = $param !== null && $param->allowsNull(); } return self::$alpha; } }