From b7e1551814821a9288cde42a6e000fb1a887ee6f Mon Sep 17 00:00:00 2001 From: George Matsumura Date: Sat, 11 Jul 2020 15:01:32 -0600 Subject: [PATCH] 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 --- src/cairo-cogl-context.c | 2 +- src/cairo-cogl-surface.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/cairo-cogl-context.c b/src/cairo-cogl-context.c index 70aa2a4d6..bc1af4de6 100644 --- a/src/cairo-cogl-context.c +++ b/src/cairo-cogl-context.c @@ -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; diff --git a/src/cairo-cogl-surface.c b/src/cairo-cogl-surface.c index 2e95f3c76..09c6f2d00 100644 --- a/src/cairo-cogl-surface.c +++ b/src/cairo-cogl-surface.c @@ -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;