void
renderTriangleMesh(RenderState renderState, Int16List ixList, Float32List vxList, int color)
Source
@override
void renderTriangleMesh(
RenderState renderState,
Int16List ixList, Float32List vxList, int color) {
var context = _renderingContext;
var matrix = renderState.globalMatrix;
var alpha = renderState.globalAlpha;
var blendMode = renderState.globalBlendMode;
if (_activeAlpha != alpha) {
_activeAlpha = alpha;
context.globalAlpha = alpha;
}
if (_activeBlendMode != blendMode) {
_activeBlendMode = blendMode;
context.globalCompositeOperation = blendMode.compositeOperation;
}
context.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);
context.beginPath();
for(int i = 0; i < ixList.length - 2; i += 3) {
int i0 = ixList[i + 0] << 1;
int i1 = ixList[i + 1] << 1;
int i2 = ixList[i + 2] << 1;
num x1 = vxList[i0 + 0];
num y1 = vxList[i0 + 1];
num x2 = vxList[i1 + 0];
num y2 = vxList[i1 + 1];
num x3 = vxList[i2 + 0];
num y3 = vxList[i2 + 1];
context.moveTo(x1, y1);
context.lineTo(x2, y2);
context.lineTo(x3, y3);
}
context.fillStyle = color2rgba(color);
context.fill();
}