cogl: Fix rectangular filling fast path

Prior to this, the rectangular filling fast path passed arguments to
_cairo_cogl_journal_log_rectangle as if they represented the
coordinates of two opposite points on the rectangle, when the arguments
actually represent a rectangle with the x and y coordinates of one
point and the width and height of the rectangle.

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
This commit is contained in:
George Matsumura 2020-07-11 15:01:32 -06:00
parent 1bb048af24
commit b7e1551814
2 changed files with 4 additions and 9 deletions

View file

@ -609,7 +609,7 @@ _cairo_cogl_surface_set_side_band_state (cairo_cogl_surface_t *surface,
cairo_cogl_context_t *cr)
{
if (cr->path_ctm_age <= 1) {
if (cr->path_ctm_age == 0) {
surface->user_path = &cr->user_path;
surface->ctm = &cr->base.gstate->ctm;
surface->ctm_inverse = &cr->base.gstate->ctm_inverse;

View file

@ -1799,7 +1799,7 @@ BAIL:
return cogl_object_ref (linear_texture->texture);
}
default:
g_warning ("Un-supported source type");
g_warning ("Unsupported source type");
return NULL;
}
}
@ -2059,7 +2059,7 @@ get_source_mask_operator_destination_pipeline (const cairo_pattern_t *mask,
}
break;
default:
g_warning ("Un-supported source type");
g_warning ("Unsupported source type");
return NULL;
}
@ -2994,11 +2994,6 @@ _cairo_cogl_surface_fill_rectangle (void *abstract_surface,
#endif
if (source->type == CAIRO_PATTERN_TYPE_SOLID) {
double x1 = x;
double y1 = y;
double x2 = x1 + width;
double y2 = y1 + height;
pipeline =
get_source_mask_operator_destination_pipeline (NULL,
source,
@ -3013,7 +3008,7 @@ _cairo_cogl_surface_fill_rectangle (void *abstract_surface,
_cairo_cogl_journal_log_rectangle (surface,
pipeline,
x1, y1, x2, y2,
x, y, width, height,
0,
ctm);
return CAIRO_INT_STATUS_SUCCESS;