diff options
author | 2015-06-21 17:34:42 -0400 | |
---|---|---|
committer | 2015-12-06 19:03:36 -0500 | |
commit | 551b77f27e864ce47421ebc920d9625aea2d270d (patch) | |
tree | 2679f812c52dddfc2253f8fde7268389f4bc31a7 | |
parent | 81f21fc7acff783732417bfcf8b88d012431f51c (diff) |
Remove display-posterizing code. It's been dead 3 years.
Signed-off-by: John Hood <cgull@glup.org>
-rw-r--r-- | src/examples/termemu.cc | 2 | ||||
-rw-r--r-- | src/frontend/stmclient.cc | 3 | ||||
-rw-r--r-- | src/terminal/terminaldisplay.h | 4 | ||||
-rw-r--r-- | src/terminal/terminaldisplayinit.cc | 8 | ||||
-rw-r--r-- | src/terminal/terminalframebuffer.cc | 66 | ||||
-rw-r--r-- | src/terminal/terminalframebuffer.h | 4 |
6 files changed, 1 insertions, 86 deletions
diff --git a/src/examples/termemu.cc b/src/examples/termemu.cc index cedf90a..5704408 100644 --- a/src/examples/termemu.cc +++ b/src/examples/termemu.cc @@ -187,8 +187,6 @@ static bool tick( Terminal::Framebuffer &state, Terminal::Framebuffer &new_frame if ( (!initialized) || (diff >= 0.02) ) { - display.downgrade( new_frame ); - std::string update = display.new_frame( initialized, state, new_frame ); swrite( STDOUT_FILENO, update.c_str() ); state = new_frame; diff --git a/src/frontend/stmclient.cc b/src/frontend/stmclient.cc index d08124d..e034907 100644 --- a/src/frontend/stmclient.cc +++ b/src/frontend/stmclient.cc @@ -268,9 +268,6 @@ void STMClient::output_new_frame( void ) /* apply local overlays */ overlays.apply( new_state ); - /* apply any mutations */ - display.downgrade( new_state ); - /* calculate minimal difference from where we are */ const string diff( display.new_frame( !repaint_requested, local_framebuffer, diff --git a/src/terminal/terminaldisplay.h b/src/terminal/terminaldisplay.h index 188cd1f..14cd23a 100644 --- a/src/terminal/terminaldisplay.h +++ b/src/terminal/terminaldisplay.h @@ -75,15 +75,11 @@ namespace Terminal { bool has_title; /* supports window title and icon name */ - int posterize_colors; /* downsample input colors >8 to [0..7] */ - const char *smcup, *rmcup; /* enter and exit alternate screen mode */ bool put_row( bool initialized, FrameState &frame, const Framebuffer &f, int frame_y, const Row &old_row, bool wrap ) const; public: - void downgrade( Framebuffer &f ) const { if ( posterize_colors ) { f.posterize(); } } - std::string open() const; std::string close() const; diff --git a/src/terminal/terminaldisplayinit.cc b/src/terminal/terminaldisplayinit.cc index 89117bb..50a0a35 100644 --- a/src/terminal/terminaldisplayinit.cc +++ b/src/terminal/terminaldisplayinit.cc @@ -90,7 +90,7 @@ const char *Display::ti_str( const char *capname ) } Display::Display( bool use_environment ) - : has_ech( true ), has_bce( true ), has_title( true ), posterize_colors( 0 ), smcup( NULL ), rmcup( NULL ) + : has_ech( true ), has_bce( true ), has_title( true ), smcup( NULL ), rmcup( NULL ) { if ( use_environment ) { int errret = -2; @@ -141,12 +141,6 @@ Display::Display( bool use_environment ) } } - /* posterization disabled because server now only advertises - xterm-256color when client has colors = 256 */ - /* - posterize_colors = ti_num( "colors" ) < 256; - */ - if ( !getenv( "MOSH_NO_TERM_INIT" ) ) { smcup = ti_str("smcup"); rmcup = ti_str("rmcup"); diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc index 9f6c4cd..37af871 100644 --- a/src/terminal/terminalframebuffer.cc +++ b/src/terminal/terminalframebuffer.cc @@ -398,19 +398,6 @@ void Framebuffer::soft_reset( void ) ds.clear_saved_cursor(); } -void Framebuffer::posterize( void ) -{ - for ( rows_type::iterator i = rows.begin(); - i != rows.end(); - i++ ) { - for ( Row::cells_type::iterator j = (*i)->cells.begin(); - j != (*i)->cells.end(); - j++ ) { - j->renditions.posterize(); - } - } -} - void Framebuffer::resize( int s_width, int s_height ) { assert( s_width > 0 ); @@ -571,59 +558,6 @@ std::string Renditions::sgr( void ) const return ret; } -/* Reduce 256 "standard" colors to the 8 ANSI colors. */ - -/* Terminal emulators generally agree on the (R',G',B') values of the - "standard" 256-color palette beyond #15, but for the first 16 - colors there is disagreement. Most terminal emulators are roughly - self-consistent, except on Ubuntu's gnome-terminal where "ANSI - blue" (#4) has been replaced with the aubergine system-wide - color. See - https://lists.ubuntu.com/archives/ubuntu-devel/2011-March/032726.html - - Terminal emulators that advertise "xterm" are inconsistent on the - handling of initc to change the contents of a cell in the color - palette. On RIS (reset to initial state) or choosing reset from - the user interface, xterm resets all entries, but gnome-terminal - only resets entries beyond 16. (rxvt doesn't reset any entries, - and Terminal.app ignores initc.) On initc, xterm applies changes - immediately (but slowly), but gnome-terminal's changes are only - prospective unless the user resizes the terminal. - - mosh ignores initc for now, despite advertising xterm-256color. */ - -/* Table mapping common color cube for [16 .. 255] - to xterm's system colors (0 .. 7) with closest - CIE deltaE(2000). */ -static const char standard_posterization[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 7, 1, 2, 3, 4, 5, 6, 7, - 0, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 2, 6, 6, 6, - 6, 4, 2, 2, 6, 6, 6, 6, 2, 2, 2, 6, 6, 6, 2, 2, - 2, 2, 6, 6, 1, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, - 2, 2, 6, 6, 4, 5, 2, 2, 6, 6, 6, 6, 2, 2, 2, 6, - 6, 6, 2, 2, 2, 2, 6, 6, 1, 5, 5, 4, 4, 4, 1, 1, - 5, 5, 5, 5, 3, 3, 7, 5, 5, 5, 2, 2, 2, 6, 7, 7, - 2, 2, 2, 6, 6, 6, 2, 2, 2, 2, 6, 6, 1, 5, 5, 5, - 5, 5, 1, 1, 5, 5, 5, 5, 3, 1, 7, 5, 5, 5, 3, 3, - 3, 7, 7, 7, 3, 3, 2, 7, 6, 7, 3, 2, 2, 2, 6, 6, - 1, 5, 5, 5, 5, 5, 1, 1, 5, 5, 5, 5, 3, 1, 1, 5, - 5, 5, 3, 3, 7, 7, 7, 7, 3, 3, 3, 7, 7, 7, 3, 3, - 3, 3, 7, 7, 1, 1, 5, 5, 5, 5, 1, 1, 5, 5, 5, 5, - 1, 1, 1, 5, 5, 5, 3, 7, 7, 7, 7, 7, 3, 3, 3, 7, - 7, 7, 3, 3, 3, 3, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; - -void Renditions::posterize( void ) -{ - if ( foreground_color ) { - foreground_color = 30 + standard_posterization[ foreground_color - 30 ]; - } - - if ( background_color ) { - background_color = 40 + standard_posterization[ background_color - 40 ]; - } -} - void Row::reset( color_type background_color ) { gen = get_gen(); diff --git a/src/terminal/terminalframebuffer.h b/src/terminal/terminalframebuffer.h index 37367c0..51cc16f 100644 --- a/src/terminal/terminalframebuffer.h +++ b/src/terminal/terminalframebuffer.h @@ -68,8 +68,6 @@ namespace Terminal { void set_rendition( color_type num ); std::string sgr( void ) const; - void posterize( void ); - bool operator==( const Renditions &x ) const { return ( attributes == x.attributes ) @@ -428,8 +426,6 @@ namespace Terminal { void reset_cell( Cell *c ) { c->reset( ds.get_background_rendition() ); } void reset_row( Row *r ) { r->reset( ds.get_background_rendition() ); } - void posterize( void ); - void ring_bell( void ) { bell_count++; } unsigned int get_bell_count( void ) const { return bell_count; } |