浏览代码

Merge pull request #364 from UnityTech/aa_optimization

optimize aa draw (won't draw hairline for Rects)
/main
GitHub 5 年前
当前提交
10f7c277
共有 2 个文件被更改,包括 12 次插入3 次删除
  1. 2
      Runtime/ui/renderer/common/geometry/path/path.cs
  2. 13
      Runtime/ui/renderer/common/geometry/path/path_cache.cs

2
Runtime/ui/renderer/common/geometry/path/path.cs


return this._cache;
}
var _cache = uiPathCache.create(scale);
var _cache = uiPathCache.create(scale, this._shapeHint);
var i = 0;
while (i < this._commands.Count) {

13
Runtime/ui/renderer/common/geometry/path/path_cache.cs


float _miterLimit;
float _fringe;
public static uiPathCache create(float scale) {
uiPath.uiPathShapeHint _shapeHint;
public static uiPathCache create(float scale, uiPath.uiPathShapeHint shapeHint) {
newPathCache._shapeHint = shapeHint;
return newPathCache;
}

return true;
}
public bool canSkipAAHairline {
get { return this._shapeHint == uiPath.uiPathShapeHint.Rect; }
}
public override void clear() {
this._paths.Clear();
this._points.Clear();

ObjectPool<uiMeshMesh>.release(this._strokeMesh);
this._strokeMesh = null;
this._shapeHint = uiPath.uiPathShapeHint.Other;
}
public uiPathCache() {

uiList<Vector3> _strokeVertices = null;
uiList<Vector2> _strokeUV = null;
if (aa > 0.0f) {
if (aa > 0.0f && !this.canSkipAAHairline) {
_strokeVertices = ObjectPool<uiList<Vector3>>.alloc();
_strokeUV = ObjectPool<uiList<Vector2>>.alloc();
cvertices = 0;

正在加载...
取消
保存