Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 152d6c3

Browse files
committed
compute buffer setup - discard isMainCanvas related logics
1 parent 069961a commit 152d6c3

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

Runtime/editor/surface.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public RenderTexture getRenderTexture() {
189189
public Canvas getCanvas() {
190190
if (this._canvas == null) {
191191
this._canvas = new CommandBufferCanvas(
192-
this._renderTexture, this.devicePixelRatio, this._meshPool, true);
192+
this._renderTexture, this.devicePixelRatio, this._meshPool);
193193
}
194194

195195
return this._canvas;

Runtime/ui/renderer/cmdbufferCanvas/command_buffer_canvas.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace Unity.UIWidgets.ui {
44
public class CommandBufferCanvas : uiRecorderCanvas {
55
readonly PictureFlusher _flusher;
66

7-
public CommandBufferCanvas(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool, bool isMainCanvas = false)
7+
public CommandBufferCanvas(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool)
88
: base(new uiPictureRecorder()) {
9-
this._flusher = new PictureFlusher(renderTexture, devicePixelRatio, meshPool, isMainCanvas);
9+
this._flusher = new PictureFlusher(renderTexture, devicePixelRatio, meshPool);
1010
}
1111

1212
public override float getDevicePixelRatio() {

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ public partial class PictureFlusher {
1111
readonly float _devicePixelRatio;
1212
readonly MeshPool _meshPool;
1313

14-
readonly bool _isMainCanvas;
15-
1614
readonly List<RenderLayer> _layers = new List<RenderLayer>();
1715
RenderLayer _currentLayer;
1816
uiRect? _lastScissor;
@@ -46,7 +44,7 @@ public void dispose() {
4644
}
4745
}
4846

49-
public PictureFlusher(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool, bool isMainCanvas) {
47+
public PictureFlusher(RenderTexture renderTexture, float devicePixelRatio, MeshPool meshPool) {
5048
D.assert(renderTexture);
5149
D.assert(devicePixelRatio > 0);
5250
D.assert(meshPool != null);
@@ -55,7 +53,6 @@ public PictureFlusher(RenderTexture renderTexture, float devicePixelRatio, MeshP
5553
this._fringeWidth = 1.0f / devicePixelRatio;
5654
this._devicePixelRatio = devicePixelRatio;
5755
this._meshPool = meshPool;
58-
this._isMainCanvas = isMainCanvas;
5956

6057
this.___drawTextDrawMeshCallback = this._drawTextDrawMeshCallback;
6158
this.___drawPathDrawMeshCallback2 = this._drawPathDrawMeshCallback2;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ RasterCacheResult _rasterizePicture(Picture picture, Matrix3 transform, float de
242242
var renderTexture = new RenderTexture(desc);
243243
renderTexture.hideFlags = HideFlags.HideAndDontSave;
244244

245-
var canvas = new CommandBufferCanvas(renderTexture, devicePixelRatio, meshPool, false);
245+
var canvas = new CommandBufferCanvas(renderTexture, devicePixelRatio, meshPool);
246246
canvas.translate(-bounds.left, -bounds.top);
247247
canvas.concat(transform);
248248
canvas.drawPicture(picture);

0 commit comments

Comments
 (0)