()
| 613 | // requestNewUpdate() requests an update from the server, having set the |
| 614 | // format and encoding appropriately. |
| 615 | private void requestNewUpdate() |
| 616 | { |
| 617 | if (formatChange && !pendingPFChange) { |
| 618 | /* Catch incorrect requestNewUpdate calls */ |
| 619 | assert(!pendingUpdate || continuousUpdates); |
| 620 | |
| 621 | // We have to make sure we switch the internal format at a safe |
| 622 | // time. For continuous updates we temporarily disable updates and |
| 623 | // look for a EndOfContinuousUpdates message to see when to switch. |
| 624 | // For classical updates we just got a new update right before this |
| 625 | // function was called, so we need to make sure we finish that |
| 626 | // update before we can switch. |
| 627 | |
| 628 | pendingPFChange = true; |
| 629 | pendingPF = nextPF; |
| 630 | |
| 631 | if (continuousUpdates) |
| 632 | writer().writeEnableContinuousUpdates(false, 0, 0, 0, 0); |
| 633 | |
| 634 | writer().writeSetPixelFormat(pendingPF); |
| 635 | |
| 636 | if (continuousUpdates) |
| 637 | writer().writeEnableContinuousUpdates(true, 0, 0, |
| 638 | server.width(), |
| 639 | server.height()); |
| 640 | formatChange = false; |
| 641 | } |
| 642 | |
| 643 | if (encodingChange) { |
| 644 | updateEncodings(); |
| 645 | encodingChange = false; |
| 646 | } |
| 647 | |
| 648 | if (forceNonincremental || !continuousUpdates) { |
| 649 | pendingUpdate = true; |
| 650 | writer().writeFramebufferUpdateRequest(new Rect(0, 0, |
| 651 | server.width(), |
| 652 | server.height()), |
| 653 | !forceNonincremental); |
| 654 | } |
| 655 | |
| 656 | forceNonincremental = false; |
| 657 | } |
| 658 | |
| 659 | // Ask for encodings based on which decoders are supported. Assumes higher |
| 660 | // encoding numbers are more desirable. |
no test coverage detected