浏览代码

compute buffer setup - discard isMainCanvas related logics

/main
xingwei.zhu 5 年前
当前提交
c340751f
共有 4 个文件被更改,包括 5 次插入8 次删除
  1. 2
      Runtime/editor/surface.cs
  2. 4
      Runtime/ui/renderer/cmdbufferCanvas/command_buffer_canvas.cs
  3. 5
      Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_impl.cs
  4. 2
      Runtime/ui/renderer/compositeCanvas/flow/raster_cache.cs

2
Runtime/editor/surface.cs


public Canvas getCanvas() {
if (this._canvas == null) {
this._canvas = new CommandBufferCanvas(
this._renderTexture, this.devicePixelRatio, this._meshPool, true);
this._renderTexture, this.devicePixelRatio, this._meshPool);
}
return this._canvas;

4
Runtime/ui/renderer/cmdbufferCanvas/command_buffer_canvas.cs


public class CommandBufferCanvas : uiRecorderCanvas {
readonly PictureFlusher _flusher;
public CommandBufferCanvas(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool, bool isMainCanvas = false)
public CommandBufferCanvas(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool)
this._flusher = new PictureFlusher(renderTexture, devicePixelRatio, meshPool, isMainCanvas);
this._flusher = new PictureFlusher(renderTexture, devicePixelRatio, meshPool);
}
public override float getDevicePixelRatio() {

5
Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_impl.cs


readonly float _devicePixelRatio;
readonly MeshPool _meshPool;
readonly bool _isMainCanvas;
readonly List<RenderLayer> _layers = new List<RenderLayer>();
RenderLayer _currentLayer;
uiRect? _lastScissor;

}
}
public PictureFlusher(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool, bool isMainCanvas) {
public PictureFlusher(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool) {
D.assert(renderTexture);
D.assert(devicePixelRatio > 0);
D.assert(meshPool != null);

this._devicePixelRatio = devicePixelRatio;
this._meshPool = meshPool;
this._isMainCanvas = isMainCanvas;
this.___drawTextDrawMeshCallback = this._drawTextDrawMeshCallback;
this.___drawPathDrawMeshCallback2 = this._drawPathDrawMeshCallback2;

2
Runtime/ui/renderer/compositeCanvas/flow/raster_cache.cs


var renderTexture = new RenderTexture(desc);
renderTexture.hideFlags = HideFlags.HideAndDontSave;
var canvas = new CommandBufferCanvas(renderTexture, devicePixelRatio, meshPool, false);
var canvas = new CommandBufferCanvas(renderTexture, devicePixelRatio, meshPool);
canvas.translate(-bounds.left, -bounds.top);
canvas.concat(transform);
canvas.drawPicture(picture);

正在加载...
取消
保存