|
|
|
|
|
|
layer.clipStack.save(); |
|
|
|
} |
|
|
|
|
|
|
|
readonly uiOffset[] _saveLayer_Points = new uiOffset[4]; |
|
|
|
static uiOffset[] _cachedPoints = new uiOffset[4]; |
|
|
|
|
|
|
|
void _saveLayer(uiRect bounds, uiPaint paint) { |
|
|
|
D.assert(bounds.width > 0); |
|
|
|
|
|
|
this._currentLayer = layer; |
|
|
|
|
|
|
|
if (paint.backdrop != null) { |
|
|
|
if (paint.backdrop is _BlurImageFilter) { |
|
|
|
var filter = (_BlurImageFilter) paint.backdrop; |
|
|
|
|
|
|
|
if (paint.backdrop is _uiBlurImageFilter) { |
|
|
|
var filter = (_uiBlurImageFilter) paint.backdrop; |
|
|
|
this._saveLayer_Points[0] = bounds.topLeft; |
|
|
|
this._saveLayer_Points[1] = bounds.bottomLeft; |
|
|
|
this._saveLayer_Points[2] = bounds.bottomRight; |
|
|
|
this._saveLayer_Points[3] = bounds.topRight; |
|
|
|
_cachedPoints[0] = bounds.topLeft; |
|
|
|
_cachedPoints[1] = bounds.bottomLeft; |
|
|
|
_cachedPoints[2] = bounds.bottomRight; |
|
|
|
_cachedPoints[3] = bounds.topRight; |
|
|
|
state.matrix.Value.mapPoints(this._saveLayer_Points); |
|
|
|
state.matrix.Value.mapPoints(ref _cachedPoints); |
|
|
|
this._saveLayer_Points[i] = new uiOffset( |
|
|
|
(this._saveLayer_Points[i].dx - parentBounds.left) / parentBounds.width, |
|
|
|
(this._saveLayer_Points[i].dy - parentBounds.top) / parentBounds.height |
|
|
|
_cachedPoints[i] = new uiOffset( |
|
|
|
(_cachedPoints[i].dx - parentBounds.left) / parentBounds.width, |
|
|
|
(_cachedPoints[i].dy - parentBounds.top) / parentBounds.height |
|
|
|
this._saveLayer_Points[0], |
|
|
|
this._saveLayer_Points[1], |
|
|
|
this._saveLayer_Points[2], |
|
|
|
this._saveLayer_Points[3], |
|
|
|
_cachedPoints[0], |
|
|
|
_cachedPoints[1], |
|
|
|
_cachedPoints[2], |
|
|
|
_cachedPoints[3], |
|
|
|
bounds); |
|
|
|
var renderDraw = CanvasShader.texRT(layer, layer.layerPaint.Value, mesh, parentLayer); |
|
|
|
layer.draws.Add(renderDraw); |
|
|
|
|
|
|
layer.draws.Add(CanvasShader.texRT(layer, paint, blurMesh, blurLayer)); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (paint.backdrop is _MatrixImageFilter) { |
|
|
|
var filter = (_MatrixImageFilter) paint.backdrop; |
|
|
|
else if (paint.backdrop is _uiMatrixImageFilter) { |
|
|
|
var filter = (_uiMatrixImageFilter) paint.backdrop; |
|
|
|
this._saveLayer_Points[0] = bounds.topLeft; |
|
|
|
this._saveLayer_Points[1] = bounds.bottomLeft; |
|
|
|
this._saveLayer_Points[2] = bounds.bottomRight; |
|
|
|
this._saveLayer_Points[3] = bounds.topRight; |
|
|
|
state.matrix.Value.mapPoints(this._saveLayer_Points); |
|
|
|
_cachedPoints[0] = bounds.topLeft; |
|
|
|
_cachedPoints[1] = bounds.bottomLeft; |
|
|
|
_cachedPoints[2] = bounds.bottomRight; |
|
|
|
_cachedPoints[3] = bounds.topRight; |
|
|
|
|
|
|
|
state.matrix.Value.mapPoints(ref _cachedPoints); |
|
|
|
this._saveLayer_Points[i] = new uiOffset( |
|
|
|
(this._saveLayer_Points[i].dx - parentBounds.left) / parentBounds.width, |
|
|
|
(this._saveLayer_Points[i].dy - parentBounds.top) / parentBounds.height |
|
|
|
_cachedPoints[i] = new uiOffset( |
|
|
|
(_cachedPoints[i].dx - parentBounds.left) / parentBounds.width, |
|
|
|
(_cachedPoints[i].dy - parentBounds.top) / parentBounds.height |
|
|
|
matrix.postConcat(uiMatrix3.fromMatrix3(filter.transform)); |
|
|
|
matrix.postConcat(filter.transform); |
|
|
|
this._saveLayer_Points[0], |
|
|
|
this._saveLayer_Points[1], |
|
|
|
this._saveLayer_Points[2], |
|
|
|
this._saveLayer_Points[3], |
|
|
|
_cachedPoints[0], |
|
|
|
_cachedPoints[1], |
|
|
|
_cachedPoints[2], |
|
|
|
_cachedPoints[3], |
|
|
|
bounds); |
|
|
|
var renderDraw = CanvasShader.texRT(layer, layer.layerPaint.Value, mesh, parentLayer); |
|
|
|
layer.draws.Add(renderDraw); |
|
|
|