WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-154283-20170209183244.patch (text/plain), 4.08 KB, created by
Miguel Gomez
on 2017-02-09 09:35:10 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Miguel Gomez
Created:
2017-02-09 09:35:10 PST
Size:
4.08 KB
patch
obsolete
>Subversion Revision: 211857 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 885e351c25764d7cab5b2e8a476e75be9a19c18d..1fa2a653f433ded33dcc203d4e3efe796f289a42 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2017-02-09 Miguel Gomez <magomez@igalia.com> >+ >+ [GTK] scroll with transparent background not repainted after scrollY >= 32768 >+ https://bugs.webkit.org/show_bug.cgi?id=154283 >+ >+ Reviewed by Carlos Garcia Campos. >+ >+ Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is >+ not able to draw anything when using transformation matrices with values bigger than 32768. When >+ drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't >+ draw anything in, which causes the reported transparent backgrounds. >+ >+ The patch modifies the transformation matrices both from the current context and the pattern we >+ are painting, to avoid them to hold values that cannot stored in 16 bits. >+ >+ There's still the possibility that this happens, but it would require using a pattern with a size >+ bigger than 32768. >+ >+ Based on a previous patch by Gwang Yoon Hwang <yoon@igalia.com>. >+ >+ No new tests. >+ >+ * platform/graphics/cairo/CairoUtilities.cpp: >+ (WebCore::drawPatternToCairoContext): >+ > 2017-02-08 Zan Dobersek <zdobersek@igalia.com> > > [EME] Implement MediaKeySession::remove() >diff --git a/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp b/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp >index fc485894014f2d2d0baa2893989b13934ba2a7d6..440c6c6cb0044a9002b2f337e7f307f4e5cf497e 100644 >--- a/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp >+++ b/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp >@@ -205,8 +205,28 @@ void drawPatternToCairoContext(cairo_t* cr, cairo_surface_t* image, const IntSiz > cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image); > cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); > >+ // Cairo cannot convert a cairo_matrix to a Pixman's matrix if any of its components is bigger than maximum int size of Pixman. >+ // With this condition, Cairo gives up to draw given pattern entirely. To workaround this problem, we reduce the coordinate >+ // space by translating CTM and destRect. >+ cairo_matrix_t ctm; >+ cairo_get_matrix(cr, &ctm); >+ double dx = 0, dy = 0; >+ cairo_matrix_transform_point(&ctm, &dx, &dy); >+ double xScale = 1, yScale = 1; >+ cairo_matrix_transform_distance(&ctm, &xScale, &yScale); >+ >+ dx = std::trunc(-dx / tileRect.width()) * tileRect.width() / xScale; >+ dy = std::trunc(-dy / tileRect.height()) * tileRect.height() / yScale; >+ cairo_translate(cr, dx, dy); >+ >+ FloatRect adjustedDestRect(destRect); >+ adjustedDestRect.move(-dx, -dy); >+ >+ // Again, we need to reduce the coordinate of the transformation matrix we are using for the pattern. > cairo_matrix_t patternMatrix = cairo_matrix_t(patternTransform); >- cairo_matrix_t phaseMatrix = {1, 0, 0, 1, phase.x() + tileRect.x() * patternTransform.a(), phase.y() + tileRect.y() * patternTransform.d()}; >+ dx = phase.x() - std::trunc(phase.x() / tileRect.width()) * tileRect.width(); >+ dy = phase.y() - std::trunc(phase.y() / tileRect.height()) * tileRect.height(); >+ cairo_matrix_t phaseMatrix = {1, 0, 0, 1, dx + tileRect.x() * patternTransform.a(), dy + tileRect.y() * patternTransform.d()}; > cairo_matrix_t combined; > cairo_matrix_multiply(&combined, &patternMatrix, &phaseMatrix); > cairo_matrix_invert(&combined); >@@ -215,7 +235,7 @@ void drawPatternToCairoContext(cairo_t* cr, cairo_surface_t* image, const IntSiz > cairo_set_operator(cr, op); > cairo_set_source(cr, pattern); > cairo_pattern_destroy(pattern); >- cairo_rectangle(cr, destRect.x(), destRect.y(), destRect.width(), destRect.height()); >+ cairo_rectangle(cr, adjustedDestRect.x(), adjustedDestRect.y(), adjustedDestRect.width(), adjustedDestRect.height()); > cairo_fill(cr); > > cairo_restore(cr);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 154283
:
271986
|
272084
|
277862
|
301043
|
301047
|
301051
|
301744