// glx opcode 2 - render large (rest) private void end_render_large_request(Data data) { if (render_large_total == 0) { // non-large render_request.write1 (data); render_request.write_unused (data.p ()); return; } // 16 = size of header of rest render large request int max_data_per_request = display.maximum_request_length*4 - 16; for (int i=2, offset=data.offset; i<=render_large_total; i++, offset+=max_data_per_request) { int len = max_data_per_request; bool last = i == render_large_total; if (last) len = data.data.Length - offset; Request request = begin_command_request (2, 4+Data.unit(len)); request.write4 (tag); request.write2 (i); request.write2 (render_large_total); request.write4 (len); request.write1 (data.data, offset, len); if (last) request.write_unused (data.p ()); display.send_request (request); } render_large_total = 0; }