Changeset 246354 in webkit
- Timestamp:
- Jun 12, 2019 9:21:20 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246350 r246354 1 2019-06-12 Truitt Savell <tsavell@apple.com> 2 3 Unreviewed, rolling out r246350. 4 5 r246350 Introduced a failing and timing out test svg/clip-path 6 /clip-hidpi.svg 7 8 Reverted changeset: 9 10 "[cairo][SVG] Putting multiple path elements in clippath 11 causes rendering artifacts" 12 https://bugs.webkit.org/show_bug.cgi?id=198701 13 https://trac.webkit.org/changeset/246350 14 1 15 2019-06-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r246350 r246354 1 2019-06-12 Truitt Savell <tsavell@apple.com> 2 3 Unreviewed, rolling out r246350. 4 5 r246350 Introduced a failing and timing out test svg/clip-path 6 /clip-hidpi.svg 7 8 Reverted changeset: 9 10 "[cairo][SVG] Putting multiple path elements in clippath 11 causes rendering artifacts" 12 https://bugs.webkit.org/show_bug.cgi?id=198701 13 https://trac.webkit.org/changeset/246350 14 1 15 2019-06-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 16 -
trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
r246350 r246354 31 31 #if USE(CAIRO) 32 32 33 #include "CairoUtilities.h" 34 #include "Gradient.h" 35 #include "GraphicsContext.h" 36 #include "Pattern.h" 33 37 #include <cairo.h> 34 38 35 39 namespace WebCore { 40 41 // In Cairo image masking is immediate, so to emulate image clipping we must save masking 42 // details as part of the context state and apply them during platform restore. 43 class ImageMaskInformation { 44 public: 45 void update(cairo_surface_t* maskSurface, const FloatRect& maskRect) 46 { 47 m_maskSurface = maskSurface; 48 m_maskRect = maskRect; 49 } 50 51 bool isValid() const { return m_maskSurface; } 52 cairo_surface_t* maskSurface() const { return m_maskSurface.get(); } 53 const FloatRect& maskRect() const { return m_maskRect; } 54 55 private: 56 RefPtr<cairo_surface_t> m_maskSurface; 57 FloatRect m_maskRect; 58 }; 59 36 60 37 61 // Encapsulates the additional painting state information we store for each … … 41 65 State() = default; 42 66 43 struct { 44 RefPtr<cairo_pattern_t> pattern; 45 cairo_matrix_t matrix; 46 } m_mask; 67 ImageMaskInformation m_imageMaskInformation; 47 68 }; 48 69 … … 56 77 void PlatformContextCairo::restore() 57 78 { 58 if (m_state->m_mask.pattern) { 79 const ImageMaskInformation& maskInformation = m_state->m_imageMaskInformation; 80 if (maskInformation.isValid()) { 81 const FloatRect& maskRect = maskInformation.maskRect(); 59 82 cairo_pop_group_to_source(m_cr.get()); 60 61 cairo_matrix_t matrix; 62 cairo_get_matrix(m_cr.get(), &matrix); 63 cairo_set_matrix(m_cr.get(), &m_state->m_mask.matrix); 64 cairo_mask(m_cr.get(), m_state->m_mask.pattern.get()); 65 cairo_set_matrix(m_cr.get(), &matrix); 83 cairo_mask_surface(m_cr.get(), maskInformation.maskSurface(), maskRect.x(), maskRect.y()); 66 84 } 67 85 … … 88 106 // since we actually apply the mask in restorePlatformState. 89 107 ASSERT(!m_stateStack.isEmpty()); 90 m_state->m_mask.pattern = adoptRef(cairo_pattern_create_for_surface(surface)); 91 cairo_get_matrix(m_cr.get(), &m_state->m_mask.matrix); 108 m_state->m_imageMaskInformation.update(surface, rect); 92 109 93 cairo_matrix_t matrix; 94 cairo_matrix_init_translate(&matrix, -rect.x(), -rect.y()); 95 cairo_pattern_set_matrix(m_state->m_mask.pattern.get(), &matrix); 96 110 // Cairo doesn't support the notion of an image clip, so we push a group here 111 // and then paint it to the surface with an image mask (which is an immediate 112 // operation) during restorePlatformState. 97 113 cairo_push_group(m_cr.get()); 98 114 }
Note: See TracChangeset
for help on using the changeset viewer.