Commit Graph

92 Commits

Author SHA1 Message Date
Kovid Goyal
15d77c648d Speed up loading of background image
Use a persistent cache of RGBA data. Also as a free bonus, support more
image formats for the background image.
2024-07-23 15:10:54 +05:30
Kovid Goyal
bc8c4ac3d6 migrate graphics code to verstable 2024-07-12 11:45:48 +05:30
Kovid Goyal
c410ab8a8f Hide graphics internal APIs 2024-07-12 11:45:48 +05:30
Kovid Goyal
f45cd87488 Implement paused rendering for graphics 2024-02-25 09:57:33 +05:30
Kovid Goyal
7b963a2372 Allow texture references to outlive parent images
This is needed for paused rendering of images. Use a simple ref counting
scheme.
2024-02-25 09:57:33 +05:30
Kovid Goyal
c2b4df0666 No need to use fmemopen 2023-11-23 19:30:43 +05:30
Kovid Goyal
52d5a4679f Graphics protocol: Support for positioning images relative to other images
Fixes #6617
2023-10-27 15:27:30 +05:30
Kovid Goyal
7cb392c7ab Use a hash table for images 2023-10-26 20:40:02 +05:30
Kovid Goyal
f8d5e30300 Use a hash table for image placements 2023-10-26 19:42:32 +05:30
Kovid Goyal
be5a0e8559 Same treatment for image and render data arrays 2023-10-26 16:29:13 +05:30
Kovid Goyal
7cffb2a714 Prepare for fast image/ref lookup via hashmap 2023-10-26 15:45:06 +05:30
Kovid Goyal
248301f8b3 Cleanup a bunch of shader infrastructure
1) No longer us glScissor. It's an awful API and is not available in
   Vulkan. Instead the graphics drawing code ensures the graphic is
   drawn within the current viewport

2) Use generated code to automatically get the locations of uniforms
   from shaders. Greatly simplifies adding new uniforms to a shader.

3) Dont use a VAO for loading graphics vertices. Greatly simplifies
   a bunch of book keeping code.
2023-06-22 19:38:05 +05:30
Kovid Goyal
a4373ec8b4 Fix graphics being scaled during live resize 2023-06-21 06:17:35 +05:30
Kovid Goyal
c66e4ced56 Preserve text size during live resize 2023-06-20 19:41:57 +05:30
olzhasar
d0a5d1b3a4 Fix misspellings 2023-06-14 03:39:53 +06:00
Kovid Goyal
046eb86091 Only move graphics on resize if the actual num of content lines chages
Avoids spurious moves when the window is not full and therefore text
does not move on vertical resize
2023-05-24 15:40:41 +05:30
Kovid Goyal
8add28de96 Merge branch 'pr-unicode-placeholders' of https://github.com/sergei-grechanik/kitty 2023-03-03 10:55:02 +05:30
Kovid Goyal
1bf180f354 Allow loading window background images from memory 2023-03-01 16:11:38 +05:30
Sergei Grechanik
d63eeada73 Image placement using Unicode placeholders
This commit introduces the Unicode placeholder image placement method.
In particular:
- Virtual placements can be created by passing `U=1` in a put command.
- Images with virtual placements can be displayed using the placeholder
  character `U+10EEEE` with diacritics indicating rows and columns.
- The image ID is indicated by the foreground color of the placeholder.
  Additionally, the most significant byte of the ID can be specified via
  the third diacritic.
- Underline color can be optionally used to specify the placement ID.
- A bug was fixed, which caused incomplete image removal when it was
  overwritten by another image with the same ID.
2023-02-21 18:23:16 -08:00
Kovid Goyal
11badac95d Ensure cell start position is clamped to a pixel 2021-12-05 18:26:25 +05:30
Kovid Goyal
759feac95b Make the gl pixel clamping functions more widely available 2021-12-05 18:16:36 +05:30
Kovid Goyal
78c63e6a18 Show window titles during visual select
Still has to be implemented on macOS
2021-10-15 14:19:56 +05:30
Kovid Goyal
630379651e Use union instead of define for graphics commands aliases 2021-07-25 13:14:52 +05:30
Kovid Goyal
83bbcf0aa1 Graphics protocol: Add a control to allow clients to specify that the cursor should not move when displaying an image
Fixes #3411
2021-03-22 22:16:40 +05:30
Kovid Goyal
7a1785e1e8 Get chunked loading working with frames 2021-02-04 21:04:44 +05:30
Kovid Goyal
b479510f6c Allow controlling the number of loops in icat 2021-02-04 17:47:53 +05:30
Kovid Goyal
b72dbc973d Allow controlling how many times an animation will loop 2021-02-03 20:54:43 +05:30
Kovid Goyal
19f0e2303d Refactor to store frame deltas instead of fully coalesced frames
Trades CPU usage for cache/memory space
2021-02-03 15:49:33 +05:30
Kovid Goyal
bb5c5a8e4f Allow gapless frames 2021-02-01 16:22:36 +05:30
Kovid Goyal
19e0406459 Wire up animation state tracking 2021-01-31 20:58:43 +05:30
Kovid Goyal
00edb6058e Start work on implementing frame transitions
Also ensure that the correct OS Window is current when uploading images
to GPU.
2021-01-31 20:58:42 +05:30
Kovid Goyal
1d20472759 Avoid a cache move when deleting frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
d76e757d53 Implement delete for frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
35f3312a1e Use shorter cache keys 2021-01-31 20:58:41 +05:30
Kovid Goyal
6631bb0eac Make the image dict more complete 2021-01-31 20:58:41 +05:30
Kovid Goyal
0adbbc6d62 Implement loading of frame animation data 2021-01-31 20:58:41 +05:30
Kovid Goyal
cc4f9ddad8 More work an animation handling 2021-01-31 20:58:41 +05:30
Kovid Goyal
5a182d3d13 Store image data in a disk cache 2021-01-31 20:58:41 +05:30
Kovid Goyal
dfe41217f8 Start work on allowing images to have multiple frames 2021-01-24 12:37:21 +05:30
Kovid Goyal
3162d391cc Start work on disk cache 2020-12-29 19:16:21 +05:30
Kovid Goyal
e96ff19a7a Graphics protocol: Add support for having the terminal emulator assign image ids
Useful when multiple non co-operating programs want to share the screen.
Fixes #3163
2020-12-16 17:31:15 +05:30
Kovid Goyal
23420adfa6 Graphics protocol: Allow suppressing responses from the terminal to graphics commands 2020-12-03 20:42:03 +05:30
Kovid Goyal
b5e704a934 Graphics protocol: Add support for giving individual image placements their
Fixes #3133
2020-12-02 05:25:19 +05:30
Kovid Goyal
8116ee015a API for changing the background image of OS windows
Uses reference counting
2020-02-01 09:17:41 +05:30
Kovid Goyal
fdd7fe1948 Properly release resources used by bgimage
Also allow per OS Window bg images in the future
2020-01-31 12:17:54 +05:30
Kovid Goyal
9bf24bdff5 Cleanup png_path_to_bitmap() 2020-01-31 09:46:16 +05:30
Fredrick Brennan
aaaa34e119 Move a bunch of unneeded stuff 2020-01-30 18:08:25 +08:00
Fredrick Brennan
9f364209af Add background_image 2020-01-30 17:23:42 +08:00
Fredrick Brennan
8020657d8c Allow drawing images below cells w/background 2020-01-11 16:56:59 +05:30
Luflosi
f3b9ff5f9f Use datatype monotonic_t instead of double to keep track of time
The time is stored in a signed 64 bit integer with nanosecond accuracy. This eliminates the possibility of floating-point inaccuracies.
`monotonic_t` can currently hold values large enough to work correctly for more than 200 years into the future.
Using a typedef instead of directly using `int64_t` everywhere will also allow easily changing the datatype in the future should the need arise for more precise or bigger time values.
2019-09-25 17:43:11 +02:00