mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-24 22:55:39 +00:00
kmstest: Fix up lifetimes of cairo objects
cairo_t is the short lived drawing context, whereas cairo_surface_t is the heavyweight object that persists and is also tied to underlying GEM objects. So make the kmstest API reflect the different weights and fix the lifetime and underlying object reference leaks. Based on the fix by Paulo Zanoni. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
+2
-1
@@ -54,7 +54,7 @@ struct kmstest_fb {
|
||||
unsigned stride;
|
||||
unsigned tiling;
|
||||
unsigned size;
|
||||
cairo_t *cairo_ctx;
|
||||
cairo_surface_t *cairo_surface;
|
||||
};
|
||||
|
||||
enum kmstest_text_align {
|
||||
@@ -77,6 +77,7 @@ unsigned int kmstest_create_fb2(int fd, int width, int height, uint32_t format,
|
||||
bool tiled, struct kmstest_fb *fb);
|
||||
void kmstest_remove_fb(int fd, struct kmstest_fb *fb_info);
|
||||
cairo_t *kmstest_get_cairo_ctx(int fd, struct kmstest_fb *fb);
|
||||
cairo_surface_t *kmstest_get_cairo_surface(int fd, struct kmstest_fb *fb);
|
||||
void kmstest_paint_color(cairo_t *cr, int x, int y, int w, int h,
|
||||
double r, double g, double b);
|
||||
void kmstest_paint_color_alpha(cairo_t *cr, int x, int y, int w, int h,
|
||||
|
||||
Reference in New Issue
Block a user