public void Submit() { if (!isDirty) { if (buffer == null) { return; } lock (buffer) { buffer.SetPixels(pixels, width, height ); } isDirty = true; } }