
Previously, we were generating the display update one character at a time, and writing them one at a time to stderr, which is not buffered, doing so caused one syscall per character printed which is s l o w (TM) This commit makes LibLine write the update contents into a buffer, and flush it after all the update is generated :^)
24 lines
558 B
C++
24 lines
558 B
C++
/*
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <LibLine/Style.h>
|
|
|
|
namespace Line {
|
|
namespace VT {
|
|
|
|
void save_cursor(OutputStream&);
|
|
void restore_cursor(OutputStream&);
|
|
void clear_to_end_of_line(OutputStream&);
|
|
void clear_lines(size_t count_above, size_t count_below, OutputStream&);
|
|
void move_relative(int x, int y, OutputStream&);
|
|
void move_absolute(u32 x, u32 y, OutputStream&);
|
|
void apply_style(const Style&, OutputStream&, bool is_starting = true);
|
|
|
|
}
|
|
}
|