diff options
author | José Fonseca <[email protected]> | 2010-03-29 21:10:03 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-03-29 21:22:23 +0100 |
commit | bbe6788807db1fd1cbb1b227cf0ecfcc02db90d8 (patch) | |
tree | ca939094e88e87f3d330596e14867de8faa4a2b8 | |
parent | d0e7aa25a9258aaf0bf9b22c1e75eda1515a69f7 (diff) |
progs/gallium/python: Get tri.py sample working again.
-rw-r--r-- | progs/gallium/python/samples/tri.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/progs/gallium/python/samples/tri.py b/progs/gallium/python/samples/tri.py index d7fbdb10ac3..9f6d787dcb2 100644 --- a/progs/gallium/python/samples/tri.py +++ b/progs/gallium/python/samples/tri.py @@ -30,19 +30,19 @@ from gallium import * -def make_image(surface): - data = surface.get_tile_rgba8(0, 0, surface.width, surface.height) +def make_image(ctx, surface): + data = ctx.surface_read_rgba8(surface, 0, 0, surface.width, surface.height) import Image outimage = Image.fromstring('RGBA', (surface.width, surface.height), data, "raw", 'RGBA', 0, 1) return outimage -def save_image(filename, surface): - outimage = make_image(surface) +def save_image(ctx, surface, filename): + outimage = make_image(ctx, surface) outimage.save(filename, "PNG") -def show_image(surface): - outimage = make_image(surface) +def show_image(ctx, surface): + outimage = make_image(ctx, surface) import Tkinter as tk from PIL import Image, ImageTk @@ -216,10 +216,10 @@ def test(dev): ctx.flush() - show_image(cbuf) - #show_image(zbuf) - #save_image('cbuf.png', cbuf) - #save_image('zbuf.png', zbuf) + show_image(ctx, cbuf) + show_image(ctx, zbuf) + save_image(ctx, cbuf, 'cbuf.png') + save_image(ctx, zbuf, 'zbuf.png') |