summaryrefslogtreecommitdiff
path: root/jni
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-02-23 12:27:57 -0800
committerJeff Sharkey <jsharkey@android.com>2013-02-23 12:59:59 -0800
commit6a142b6d4831c3841b6be1705fc97c9b75a7c9d1 (patch)
tree39156dc7018ee4d4c14c964bc60fb0118551c217 /jni
parentfa50ddd49c3c1cddbf75a8b1206031cf9867b923 (diff)
downloadTerminal-6a142b6d4831c3841b6be1705fc97c9b75a7c9d1.tar.gz
Working damage!
Flushing damage to the UI is now driven by the read() thread, and moverect() data is now passed across JNI. TerminalView currently treats moverect() as invalidating the union of the two rects, which repaints everything correctly, yay! Change-Id: I0d38e5c7755d3da06a23802c03fd2e2839aa1a02
Diffstat (limited to 'jni')
-rw-r--r--jni/com_android_terminal_Terminal.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/jni/com_android_terminal_Terminal.cpp b/jni/com_android_terminal_Terminal.cpp
index e195913..9133e46 100644
--- a/jni/com_android_terminal_Terminal.cpp
+++ b/jni/com_android_terminal_Terminal.cpp
@@ -139,7 +139,8 @@ static int term_prescroll(VTermRect rect, void *user) {
return 0;
}
- return env->CallIntMethod(term->getCallbacks(), prescrollMethod);
+ return env->CallIntMethod(term->getCallbacks(), prescrollMethod, rect.start_row, rect.end_row,
+ rect.start_col, rect.end_col);
}
static int term_moverect(VTermRect dest, VTermRect src, void *user) {
@@ -152,7 +153,9 @@ static int term_moverect(VTermRect dest, VTermRect src, void *user) {
return 0;
}
- return env->CallIntMethod(term->getCallbacks(), moveRectMethod);
+ return env->CallIntMethod(term->getCallbacks(), moveRectMethod,
+ dest.start_row, dest.end_row, dest.start_col, dest.end_col,
+ src.start_row, src.end_row, src.start_col, src.end_col);
}
static int term_movecursor(VTermPos pos, VTermPos oldpos, int visible, void *user) {
@@ -165,7 +168,8 @@ static int term_movecursor(VTermPos pos, VTermPos oldpos, int visible, void *use
return 0;
}
- return env->CallIntMethod(term->getCallbacks(), moveCursorMethod);
+ return env->CallIntMethod(term->getCallbacks(), moveCursorMethod, pos.row,
+ pos.col, oldpos.row, oldpos.col, visible);
}
static int term_settermprop(VTermProp prop, VTermValue *val, void *user) {
@@ -249,8 +253,7 @@ Terminal::Terminal(jobject callbacks, int rows, int cols) :
mVts = vterm_obtain_screen(mVt);
vterm_screen_enable_altscreen(mVts, 1);
vterm_screen_set_callbacks(mVts, &cb, this);
- // TODO: switch back to VTERM_DAMAGE_SCROLL?
- vterm_screen_set_damage_merge(mVts, VTERM_DAMAGE_CELL);
+ vterm_screen_set_damage_merge(mVts, VTERM_DAMAGE_SCROLL);
vterm_screen_reset(mVts, 1);
}
@@ -335,6 +338,8 @@ int Terminal::run() {
}
vterm_push_bytes(mVt, buffer, bytes);
+
+ vterm_screen_flush_damage(mVts);
}
return 1;
@@ -482,7 +487,7 @@ int register_com_android_terminal_Terminal(JNIEnv* env) {
android::prescrollMethod = env->GetMethodID(terminalCallbacksClass, "prescroll", "(IIII)I");
android::moveRectMethod = env->GetMethodID(terminalCallbacksClass, "moveRect", "(IIIIIIII)I");
android::moveCursorMethod = env->GetMethodID(terminalCallbacksClass, "moveCursor",
- "(IIIIIIIII)I");
+ "(IIIII)I");
android::setTermPropBooleanMethod = env->GetMethodID(terminalCallbacksClass,
"setTermPropBoolean", "(IZ)I");
android::setTermPropIntMethod = env->GetMethodID(terminalCallbacksClass, "setTermPropInt",