mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 21:34:09 +00:00
compositor: Make meta_actor_painting_untransformed take a framebuffer
Stop using the cogl draw framebuffer implicitly. https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
This commit is contained in:
parent
eac18647c3
commit
37e36e8208
@ -146,7 +146,8 @@ meta_actor_is_untransformed (ClutterActor *actor,
|
|||||||
* transform.
|
* transform.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
meta_actor_painting_untransformed (int paint_width,
|
meta_actor_painting_untransformed (CoglFramebuffer *fb,
|
||||||
|
int paint_width,
|
||||||
int paint_height,
|
int paint_height,
|
||||||
int *x_origin,
|
int *x_origin,
|
||||||
int *y_origin)
|
int *y_origin)
|
||||||
@ -156,8 +157,8 @@ meta_actor_painting_untransformed (int paint_width,
|
|||||||
float viewport[4];
|
float viewport[4];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
cogl_get_modelview_matrix (&modelview);
|
cogl_framebuffer_get_modelview_matrix (fb, &modelview);
|
||||||
cogl_get_projection_matrix (&projection);
|
cogl_framebuffer_get_projection_matrix (fb, &projection);
|
||||||
|
|
||||||
cogl_matrix_multiply (&modelview_projection,
|
cogl_matrix_multiply (&modelview_projection,
|
||||||
&projection,
|
&projection,
|
||||||
@ -176,7 +177,7 @@ meta_actor_painting_untransformed (int paint_width,
|
|||||||
vertices[3].y = paint_height;
|
vertices[3].y = paint_height;
|
||||||
vertices[3].z = 0;
|
vertices[3].z = 0;
|
||||||
|
|
||||||
cogl_get_viewport (viewport);
|
cogl_framebuffer_get_viewport4fv (fb, viewport);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,8 @@ gboolean meta_actor_is_untransformed (ClutterActor *actor,
|
|||||||
int *x_origin,
|
int *x_origin,
|
||||||
int *y_origin);
|
int *y_origin);
|
||||||
|
|
||||||
gboolean meta_actor_painting_untransformed (int paint_width,
|
gboolean meta_actor_painting_untransformed (CoglFramebuffer *fb,
|
||||||
|
int paint_width,
|
||||||
int paint_height,
|
int paint_height,
|
||||||
int *x_origin,
|
int *x_origin,
|
||||||
int *y_origin);
|
int *y_origin);
|
||||||
|
@ -329,6 +329,7 @@ setup_pipeline (MetaBackgroundActor *self,
|
|||||||
PipelineFlags pipeline_flags = 0;
|
PipelineFlags pipeline_flags = 0;
|
||||||
guint8 opacity;
|
guint8 opacity;
|
||||||
float color_component;
|
float color_component;
|
||||||
|
CoglFramebuffer *fb;
|
||||||
CoglPipelineFilter filter;
|
CoglPipelineFilter filter;
|
||||||
|
|
||||||
opacity = clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self));
|
opacity = clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self));
|
||||||
@ -422,8 +423,12 @@ setup_pipeline (MetaBackgroundActor *self,
|
|||||||
color_component,
|
color_component,
|
||||||
opacity / 255.);
|
opacity / 255.);
|
||||||
|
|
||||||
|
fb = cogl_get_draw_framebuffer ();
|
||||||
if (!self->force_bilinear &&
|
if (!self->force_bilinear &&
|
||||||
meta_actor_painting_untransformed (actor_pixel_rect->width, actor_pixel_rect->height, NULL, NULL))
|
meta_actor_painting_untransformed (fb,
|
||||||
|
actor_pixel_rect->width,
|
||||||
|
actor_pixel_rect->height,
|
||||||
|
NULL, NULL))
|
||||||
filter = COGL_PIPELINE_FILTER_NEAREST;
|
filter = COGL_PIPELINE_FILTER_NEAREST;
|
||||||
else
|
else
|
||||||
filter = COGL_PIPELINE_FILTER_LINEAR;
|
filter = COGL_PIPELINE_FILTER_LINEAR;
|
||||||
|
@ -568,17 +568,20 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
|||||||
|
|
||||||
tex_rect = (cairo_rectangle_int_t) { 0, 0, dst_width, dst_height };
|
tex_rect = (cairo_rectangle_int_t) { 0, 0, dst_width, dst_height };
|
||||||
|
|
||||||
|
fb = cogl_get_draw_framebuffer ();
|
||||||
|
|
||||||
/* Use nearest-pixel interpolation if the texture is unscaled. This
|
/* Use nearest-pixel interpolation if the texture is unscaled. This
|
||||||
* improves performance, especially with software rendering.
|
* improves performance, especially with software rendering.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
filter = COGL_PIPELINE_FILTER_LINEAR;
|
filter = COGL_PIPELINE_FILTER_LINEAR;
|
||||||
|
|
||||||
if (meta_actor_painting_untransformed (dst_width, dst_height, NULL, NULL))
|
if (meta_actor_painting_untransformed (fb,
|
||||||
|
dst_width, dst_height,
|
||||||
|
NULL, NULL))
|
||||||
filter = COGL_PIPELINE_FILTER_NEAREST;
|
filter = COGL_PIPELINE_FILTER_NEAREST;
|
||||||
|
|
||||||
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||||
fb = cogl_get_draw_framebuffer ();
|
|
||||||
|
|
||||||
opacity = clutter_actor_get_paint_opacity (actor);
|
opacity = clutter_actor_get_paint_opacity (actor);
|
||||||
clutter_actor_get_allocation_box (actor, &alloc);
|
clutter_actor_get_allocation_box (actor, &alloc);
|
||||||
|
@ -80,7 +80,11 @@ meta_window_group_paint (ClutterActor *actor)
|
|||||||
*/
|
*/
|
||||||
if (clutter_actor_is_in_clone_paint (actor))
|
if (clutter_actor_is_in_clone_paint (actor))
|
||||||
{
|
{
|
||||||
if (!meta_actor_painting_untransformed (screen_width,
|
CoglFramebuffer *fb;
|
||||||
|
|
||||||
|
fb = cogl_get_draw_framebuffer ();
|
||||||
|
if (!meta_actor_painting_untransformed (fb,
|
||||||
|
screen_width,
|
||||||
screen_height,
|
screen_height,
|
||||||
&paint_x_origin,
|
&paint_x_origin,
|
||||||
&paint_y_origin) ||
|
&paint_y_origin) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user