浏览代码

Merge pull request #124 from UnityTech/xwzhu

shadow improve + performance step 2.1 (focus on Path)
/main
GitHub 6 年前
当前提交
cb2fe3b3
共有 2 个文件被更改,包括 5 次插入6 次删除
  1. 2
      Runtime/flow/physical_shape_layer.cs
  2. 9
      Runtime/ui/painting/path.cs

2
Runtime/flow/physical_shape_layer.cs


public static void drawShadow(Canvas canvas, Path path, Color color, float elevation, bool transparentOccluder,
float dpr) {
float kAmbientAlpha = 0.039f;
float kSpotAlpha = 0.25f;
float kSpotAlpha = ShadowUtils.kUseFastShadow ? 0.1f : 0.25f;
float kLightHeight = 600f;
float kLightRadius = 800f;

9
Runtime/ui/painting/path.cs


}
}
}
// Split arc into max 90 degree segments.
int ndivs = Mathf.Max(1, Mathf.Min((int) (Mathf.Abs(da) / (Mathf.PI * 0.5f) + 0.5f), 5));
float hda = (da / ndivs) / 2.0f;

this.addPoint(0, 0, PointFlags.corner);
}
var path = this._paths.Last();
var path = this._paths[this._paths.Count - 1];
var pt = this._points.Last();
var pt = this._points[this._points.Count - 1];
if (PathUtils.ptEquals(pt.x, pt.y, point.x, point.y, this._distTol)) {
pt.flags |= point.flags;
return;

y1 = 0;
}
else {
var pt = this._points.Last();
var pt = this._points[this._points.Count - 1];
x1 = pt.x;
y1 = pt.y;
}

return;
}
var path = this._paths.Last();
var path = this._paths[this._paths.Count - 1];
path.winding = winding;
}

正在加载...
取消
保存