drm-backend: Cache paint node transform
Instead of calculating this multiple times, just store it in the paint node. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
da3d3c7e95
commit
e3ec879d11
|
@ -677,14 +677,12 @@ drm_head_find_by_connector(struct drm_backend *backend, uint32_t connector_id);
|
||||||
static inline bool
|
static inline bool
|
||||||
drm_paint_node_transform_supported(struct weston_paint_node *node, struct weston_output *output)
|
drm_paint_node_transform_supported(struct weston_paint_node *node, struct weston_output *output)
|
||||||
{
|
{
|
||||||
enum wl_output_transform wt;
|
|
||||||
|
|
||||||
/* if false, the transform doesn't map to any of the standard
|
/* if false, the transform doesn't map to any of the standard
|
||||||
* (ie: 90 degree) output transformations. */
|
* (ie: 90 degree) output transformations. */
|
||||||
if (!weston_matrix_to_transform(&node->buffer_to_output_matrix, &wt))
|
if (!node->valid_transform)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (wt != WL_OUTPUT_TRANSFORM_NORMAL)
|
if (node->transform != WL_OUTPUT_TRANSFORM_NORMAL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -157,9 +157,13 @@ paint_node_update(struct weston_paint_node *pnode)
|
||||||
pnode->output, mat);
|
pnode->output, mat);
|
||||||
weston_matrix_invert(&pnode->output_to_buffer_matrix, mat);
|
weston_matrix_invert(&pnode->output_to_buffer_matrix, mat);
|
||||||
pnode->needs_filtering = weston_matrix_needs_filtering(mat);
|
pnode->needs_filtering = weston_matrix_needs_filtering(mat);
|
||||||
|
|
||||||
|
pnode->valid_transform = weston_matrix_to_transform(mat,
|
||||||
|
&pnode->transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
pnode->status = PAINT_NODE_CLEAN;
|
pnode->status = PAINT_NODE_CLEAN;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct weston_paint_node *
|
static struct weston_paint_node *
|
||||||
|
|
|
@ -506,6 +506,9 @@ struct weston_paint_node {
|
||||||
struct weston_matrix output_to_buffer_matrix;
|
struct weston_matrix output_to_buffer_matrix;
|
||||||
bool needs_filtering;
|
bool needs_filtering;
|
||||||
|
|
||||||
|
bool valid_transform;
|
||||||
|
enum wl_output_transform transform;
|
||||||
|
|
||||||
/* struct weston_output::paint_node_z_order_list */
|
/* struct weston_output::paint_node_z_order_list */
|
||||||
struct wl_list z_order_link;
|
struct wl_list z_order_link;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue