Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–69 unchanged (69 lines)
70 boolean tunnelForward = options.isTunnelForward();
71 boolean control = options.getControl();
72 boolean sendDummyByte = options.getSendDummyByte();
73
74 Workarounds.prepareMainLooper();
75 if (Build.BRAND.equalsIgnoreCase("meizu")) {
76 // <https://github.com/Genymobile/scrcpy/issues/240>
77 // <https://github.com/Genymobile/scrcpy/issues/2656>
78 Workarounds.fillAppInfo();
79 }
80
81 try (DesktopConnection connection = DesktopConnection.open(uid, tunnelForward, control, sendDummyByte)) {
82 if (options.getSendDeviceMeta()) {
…lines 83–301 unchanged (219 lines)

After

…lines 1–69 unchanged (69 lines)
70 boolean tunnelForward = options.isTunnelForward();
71 boolean control = options.getControl();
72 boolean sendDummyByte = options.getSendDummyByte();
73
74 Workarounds.prepareMainLooper();
75 if (Build.BRAND.equalsIgnoreCase("meizu")) {
76 // Workarounds must be applied for Meizu phones:
77 // - <https://github.com/Genymobile/scrcpy/issues/240>
78 // - <https://github.com/Genymobile/scrcpy/issues/365>
79 // - <https://github.com/Genymobile/scrcpy/issues/2656>
80 //
81 // But only apply when strictly necessary, since workarounds can cause other issues:
82 // - <https://github.com/Genymobile/scrcpy/issues/940>
83 // - <https://github.com/Genymobile/scrcpy/issues/994>
84 Workarounds.fillAppInfo();
85 }
86
87 try (DesktopConnection connection = DesktopConnection.open(uid, tunnelForward, control, sendDummyByte)) {
88 if (options.getSendDeviceMeta()) {
89 Size videoSize = device.getScreenInfo().getVideoSize();
…lines 90–307 unchanged (218 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "graphics"
. "."
identifier "Rect"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "media"
. "."
identifier "MediaCodecInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "BatteryManager"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "Build"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Locale"
; ";"
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "Server"
class_body
{ "{"
constructor_declaration
modifiers
private "private"
identifier "Server"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
line_comment "// not instantiable"
} "}"
method_declaration (+400 nodes collapsed)
method_declaration
modifiers
private "private"
static "static"
void_type "void"
identifier "scrcpy"
formal_parameters
( "("
formal_parameter
type_identifier "Options"
identifier "options"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement (+52 nodes collapsed)
local_variable_declaration
modifiers
final "final"
type_identifier "Device"
variable_declarator
identifier "device"
= "="
object_creation_expression
new "new"
type_identifier "Device"
argument_list
( "("
identifier "options"
) ")"
; ";"
local_variable_declaration
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "CodecOption"
> ">"
variable_declarator
identifier "codecOptions"
= "="
method_invocation
identifier "options"
. "."
identifier "getCodecOptions"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Thread"
variable_declarator
identifier "initThread"
= "="
method_invocation
identifier "startInitThread"
argument_list
( "("
identifier "options"
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "uid"
= "="
method_invocation
identifier "options"
. "."
identifier "getUid"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "tunnelForward"
= "="
method_invocation
identifier "options"
. "."
identifier "isTunnelForward"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "control"
= "="
method_invocation
identifier "options"
. "."
identifier "getControl"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "sendDummyByte"
= "="
method_invocation
identifier "options"
. "."
identifier "getSendDummyByte"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "Workarounds"
. "."
identifier "prepareMainLooper"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
field_access
identifier "Build"
. "."
identifier "BRAND"
. "."
identifier "equalsIgnoreCase"
argument_list
( "("
string_literal
" "\""
string_fragment "meizu"
" "\""
) ")"
) ")"
block
{ "{"
line_comment "// <https://github.com/Genymobile/scrcpy/issues/240>"
line_comment "// <https://github.com/Genymobile/scrcpy/issues/2656>"
expression_statement
method_invocation
identifier "Workarounds"
. "."
identifier "fillAppInfo"
argument_list
( "("
) ")"
; ";"
} "}"
try_with_resources_statement (+319 nodes collapsed)
} "}"
method_declaration (+53 nodes collapsed)
method_declaration (+1187 nodes collapsed)
method_declaration (+192 nodes collapsed)
method_declaration (+232 nodes collapsed)
method_declaration (+102 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "genymobile"
. "."
identifier "scrcpy"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "graphics"
. "."
identifier "Rect"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "media"
. "."
identifier "MediaCodecInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "BatteryManager"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "android"
. "."
identifier "os"
. "."
identifier "Build"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Locale"
; ";"
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "Server"
class_body
{ "{"
constructor_declaration
modifiers
private "private"
identifier "Server"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
line_comment "// not instantiable"
} "}"
method_declaration (+400 nodes collapsed)
method_declaration
modifiers
private "private"
static "static"
void_type "void"
identifier "scrcpy"
formal_parameters
( "("
formal_parameter
type_identifier "Options"
identifier "options"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
expression_statement (+52 nodes collapsed)
local_variable_declaration
modifiers
final "final"
type_identifier "Device"
variable_declarator
identifier "device"
= "="
object_creation_expression
new "new"
type_identifier "Device"
argument_list
( "("
identifier "options"
) ")"
; ";"
local_variable_declaration
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "CodecOption"
> ">"
variable_declarator
identifier "codecOptions"
= "="
method_invocation
identifier "options"
. "."
identifier "getCodecOptions"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Thread"
variable_declarator
identifier "initThread"
= "="
method_invocation
identifier "startInitThread"
argument_list
( "("
identifier "options"
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "uid"
= "="
method_invocation
identifier "options"
. "."
identifier "getUid"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "tunnelForward"
= "="
method_invocation
identifier "options"
. "."
identifier "isTunnelForward"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "control"
= "="
method_invocation
identifier "options"
. "."
identifier "getControl"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "sendDummyByte"
= "="
method_invocation
identifier "options"
. "."
identifier "getSendDummyByte"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "Workarounds"
. "."
identifier "prepareMainLooper"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
field_access
identifier "Build"
. "."
identifier "BRAND"
. "."
identifier "equalsIgnoreCase"
argument_list
( "("
string_literal
" "\""
string_fragment "meizu"
" "\""
) ")"
) ")"
block
{ "{"
line_comment "// Workarounds must be applied for Meizu phones:"
line_comment "// - <https://github.com/Genymobile/scrcpy/issues/240>"
line_comment "// - <https://github.com/Genymobile/scrcpy/issues/365>"
line_comment "// - <https://github.com/Genymobile/scrcpy/issues/2656>"
line_comment "//"
line_comment "// But only apply when strictly necessary, since workarounds"...
line_comment "// - <https://github.com/Genymobile/scrcpy/issues/940>"
line_comment "// - <https://github.com/Genymobile/scrcpy/issues/994>"
expression_statement
method_invocation
identifier "Workarounds"
. "."
identifier "fillAppInfo"
argument_list
( "("
) ")"
; ";"
} "}"
try_with_resources_statement (+319 nodes collapsed)
} "}"
method_declaration (+53 nodes collapsed)
method_declaration (+1187 nodes collapsed)
method_declaration (+192 nodes collapsed)
method_declaration (+232 nodes collapsed)
method_declaration (+102 nodes collapsed)
} "}"