Implement sending of image data to GPU

This commit is contained in:
Kovid Goyal
2017-10-01 09:04:46 +05:30
parent e2a8115328
commit 3cbc20005b
6 changed files with 59 additions and 25 deletions

View File

@@ -9,7 +9,7 @@ import zlib
from base64 import standard_b64encode
from io import BytesIO
from kitty.fast_data_types import parse_bytes
from kitty.fast_data_types import parse_bytes, shm_write, shm_unlink, set_send_to_gpu
from . import BaseTest
@@ -18,6 +18,8 @@ try:
except ImportError:
Image = None
set_send_to_gpu(False)
def relpath(name):
base = os.path.dirname(os.path.abspath(__file__))
@@ -110,10 +112,10 @@ class TestGraphics(BaseTest):
# Test loading from POSIX SHM
name = '/kitty-test-shm'
g.shm_write(name, random_data)
shm_write(name, random_data)
sl(name, s=24, v=32, t='s', expecting_data=random_data)
self.assertRaises(
FileNotFoundError, g.shm_unlink, name
FileNotFoundError, shm_unlink, name
) # check that file was deleted
@unittest.skipIf(Image is None, 'PIL not available, skipping PNG tests')