浏览代码

Code cleanup.

/main
Yuncong Zhang 5 年前
当前提交
0d23d301
共有 3 个文件被更改,包括 23 次插入11 次删除
  1. 27
      Runtime/flow/raster_cache.cs
  2. 2
      Runtime/ui/painting/codec_gif.cs
  3. 5
      Runtime/ui/painting/image.cs

27
Runtime/flow/raster_cache.cs


var y = this.matrix[5] * devicePixelRatio;
this.matrix[2] = (x - (int) x) / devicePixelRatio; // x
this.matrix[5] = (y - (int) y) / devicePixelRatio; // y
this.matrix[5] = 0.0f;
this.matrix[5] = 0.0f;
this.devicePixelRatio = devicePixelRatio;
this.antiAliasing = antiAliasing;
}

readonly Dictionary<_RasterCacheKey, _RasterCacheEntry> _cache;
MeshPool _meshPool;
Picture picture, Matrix3 transform, float devicePixelRatio, int antiAliasing, bool isComplex, bool willChange) {
Picture picture, Matrix3 transform, float devicePixelRatio, int antiAliasing, bool isComplex,
bool willChange) {
if (this.threshold == 0) {
return null;
}

if (entry.image == null) {
D.assert(this._meshPool != null);
entry.image = this._rasterizePicture(picture, transform, devicePixelRatio, antiAliasing, this._meshPool);
entry.image =
this._rasterizePicture(picture, transform, devicePixelRatio, antiAliasing, this._meshPool);
}
return entry.image;

foreach (DrawCmd drawCmd in picture.drawCmds) {
switch (drawCmd) {
case DrawImage cmd: {
if (cmd.image.isDynamic)
if (cmd.image.isDynamic) {
}
if (cmd.image.isDynamic)
if (cmd.image.isDynamic) {
}
if (cmd.image.isDynamic)
if (cmd.image.isDynamic) {
}
break;
}
}

2
Runtime/ui/painting/codec_gif.cs


using System;
using System.Collections;
using System.IO;
using RSG;
using Unity.UIWidgets.foundation;
using UnityEngine;

this._image = new Image(this._texture, isDynamic: true);
this._frameData.frameInfo.image = this._image;
}
this._frameData.gifFrame = this._decoder.currentFrame;
D.assert(this._frameData.gifFrame != null);

5
Runtime/ui/painting/image.cs


readonly bool _isDynamic;
AssetBundle _bundle;
public Image(Texture texture, bool noDispose = false, bool isAsset = false, AssetBundle bundle = null, bool isDynamic = false) {
public Image(Texture texture, bool noDispose = false, bool isAsset = false, AssetBundle bundle = null,
bool isDynamic = false) {
D.assert(!noDispose || !isAsset && bundle == null);
D.assert(isAsset || bundle == null);

}
public bool isDynamic {
get { return this._isDynamic; }
get { return this._isDynamic; }
}
~Image() {

正在加载...
取消
保存