浏览代码

draw cmd => pool item

/main
xingwei.zhu 6 年前
当前提交
57d22776
共有 3 个文件被更改,包括 210 次插入3 次删除
  1. 2
      Runtime/ui/utils/renderer/cmdbufferCanvas/command_buffer_canvas.cs
  2. 209
      Runtime/ui/utils/renderer/common/draw_cmd.cs
  3. 2
      Runtime/ui/utils/renderer/common/picture.cs

2
Runtime/ui/utils/renderer/cmdbufferCanvas/command_buffer_canvas.cs


public override void flush() {
var picture = this._recorder.endRecording();
this._recorder.reset();
this._recorder.reset();
}
public void dispose() {

209
Runtime/ui/utils/renderer/common/draw_cmd.cs


using System.Runtime.CompilerServices;
public abstract class uiDrawCmd {
public abstract class uiDrawCmd : PoolItem {
public uiDrawSave() {
}
public static uiDrawSave create() {
var drawSave = ItemPoolManager.alloc<uiDrawSave>();
return drawSave;
}
public uiDrawSaveLayer() {
}
public static uiDrawSaveLayer create(Rect rect, Paint paint) {
var drawSaveLayer = ItemPoolManager.alloc<uiDrawSaveLayer>();
drawSaveLayer.rect = rect;
drawSaveLayer.paint = paint;
return drawSaveLayer;
}
public uiDrawRestore() {
}
public static uiDrawRestore create() {
var drawRestore = ItemPoolManager.alloc<uiDrawRestore>();
return drawRestore;
}
public uiDrawTranslate() {
}
public static uiDrawTranslate create(float dx, float dy) {
var drawTranslate = ItemPoolManager.alloc<uiDrawTranslate>();
drawTranslate.dx = dx;
drawTranslate.dy = dy;
return drawTranslate;
}
public uiDrawScale() {
}
public static uiDrawScale create(float sx, float? sy) {
var drawScale = ItemPoolManager.alloc<uiDrawScale>();
drawScale.sx = sx;
drawScale.sy = sy;
return drawScale;
}
public uiDrawRotate() {
}
public static uiDrawRotate create(float radians, Offset offset) {
var drawRotate = ItemPoolManager.alloc<uiDrawRotate>();
drawRotate.radians = radians;
drawRotate.offset = offset;
return drawRotate;
}
public uiDrawSkew() {
}
public static uiDrawSkew create(float sx, float sy) {
var drawSkew = ItemPoolManager.alloc<uiDrawSkew>();
drawSkew.sx = sx;
drawSkew.sy = sy;
return drawSkew;
}
public uiDrawConcat() {
}
public static uiDrawConcat create(Matrix3 matrix) {
var drawConcat = ItemPoolManager.alloc<uiDrawConcat>();
drawConcat.matrix = matrix;
return drawConcat;
}
public uiDrawResetMatrix() {
}
public static uiDrawResetMatrix create() {
var drawResetMatrix = ItemPoolManager.alloc<uiDrawResetMatrix>();
return drawResetMatrix;
}
public uiDrawSetMatrix() {
}
public static uiDrawSetMatrix create(Matrix3 matrix) {
var drawSetMatrix = ItemPoolManager.alloc<uiDrawSetMatrix>();
drawSetMatrix.matrix = matrix;
return drawSetMatrix;
}
public uiDrawClipRect() {
}
public static uiDrawClipRect create(Rect rect) {
var drawClipRect = ItemPoolManager.alloc<uiDrawClipRect>();
drawClipRect.rect = rect;
return drawClipRect;
}
public uiDrawClipRRect() {
}
public static uiDrawClipRRect create(RRect rrect) {
var drawClipRRect = ItemPoolManager.alloc<uiDrawClipRRect>();
drawClipRRect.rrect = rrect;
return drawClipRRect;
}
public uiDrawClipPath() {
}
public static uiDrawClipPath create(Path path) {
var drawClipPath = ItemPoolManager.alloc<uiDrawClipPath>();
drawClipPath.path = path;
return drawClipPath;
}
public uiDrawPath() {
}
public static uiDrawPath create(Path path, Paint paint) {
var drawPath = ItemPoolManager.alloc<uiDrawPath>();
drawPath.path = path;
drawPath.paint = paint;
return drawPath;
}
public uiDrawImage() {
}
public static uiDrawImage create(Image image, Offset offset, Paint paint) {
var drawImage = ItemPoolManager.alloc<uiDrawImage>();
drawImage.image = image;
drawImage.offset = offset;
drawImage.paint = paint;
return drawImage;
}
public Image image;
public Offset offset;
public Paint paint;

public uiDrawImageRect() {
}
public static uiDrawImageRect create(Image image, Rect src, Rect dst, Paint paint) {
var drawImageRect = ItemPoolManager.alloc<uiDrawImageRect>();
drawImageRect.image = image;
drawImageRect.src = src;
drawImageRect.dst = dst;
drawImageRect.paint = paint;
return drawImageRect;
}
public Image image;
public Rect src;
public Rect dst;

public class uiDrawImageNine : uiDrawCmd {
public uiDrawImageNine() {
}
public static uiDrawImageNine create(Image image, Rect src, Rect center, Rect dst, Paint paint) {
var drawImageNine = ItemPoolManager.alloc<uiDrawImageNine>();
drawImageNine.image = image;
drawImageNine.src = src;
drawImageNine.center = center;
drawImageNine.dst = dst;
drawImageNine.paint = paint;
return drawImageNine;
}
public Image image;
public Rect src;
public Rect center;

public class uiDrawPicture : uiDrawCmd {
public uiDrawPicture() {
}
public static uiDrawPicture create(Picture picture) {
var drawPicture = ItemPoolManager.alloc<uiDrawPicture>();
drawPicture.picture = picture;
return drawPicture;
}
public override void clear() {
this.picture = null;
}
public uiDrawTextBlob() {
}
public static uiDrawTextBlob create(TextBlob textBlob, Offset offset, Paint paint) {
var drawTextBlob = ItemPoolManager.alloc<uiDrawTextBlob>();
drawTextBlob.textBlob = textBlob;
drawTextBlob.offset = offset;
drawTextBlob.paint = paint;
return drawTextBlob;
}
public override void clear() {
this.textBlob = null;
}
public TextBlob textBlob;
public Offset offset;
public Paint paint;

2
Runtime/ui/utils/renderer/common/picture.cs


}
var state = this._getState();
return new uiPicture(new List<uiDrawCmd>(this._drawCmds), state.paintBounds);
return new uiPicture(this._drawCmds, state.paintBounds);
}
public void addDrawCmd(uiDrawCmd drawCmd) {

正在加载...
取消
保存