public void Begin(CanvasRenderFlags flags) { if (locks == 0) { Monitor.Enter(syncRoot); positionTransforms.Push(new LinearTransform()); textureTransforms.Push(new LinearTransform()); } else { positionTransforms.Push(positionTransforms.Peek()); textureTransforms.Push(textureTransforms.Peek()); } locks++; }
public void Begin(CanvasRenderFlags flags) { bool cpuTextureTrans = ((int)flags & (int)CanvasRenderFlags.SoftwareMappingTransform) != 0; bool cpuPosTrans = ((int)flags & (int)CanvasRenderFlags.SoftwarePositionTransform) != 0; if (locks == 0) { Monitor.Enter(syncRoot); positionTransforms.Push(new DataTransform(new LinearTransform(), cpuPosTrans)); textureTransforms.Push(new DataTransform(new LinearTransform(), cpuTextureTrans)); batch.BeginBatch(); } else { Flush(true); positionTransforms.Push(new DataTransform(positionTransforms.Peek().Transform.Clone(), cpuPosTrans)); textureTransforms.Push(new DataTransform(textureTransforms.Peek().Transform.Clone(), cpuTextureTrans)); } locks++; }