Changeset 120598 in webkit
- Timestamp:
- Jun 18, 2012 8:41:05 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r120595 r120598 1 2012-06-18 Dominik Röttsches <dominik.rottsches@intel.com> 2 3 [cairo] Fix LayoutTests/fast/canvas/patternfill-repeat.html 4 https://bugs.webkit.org/show_bug.cgi?id=53085 5 6 Reviewed by Martin Robinson. 7 8 canvas/philip/tests/2d.pattern.paint.repeat* tests now passing. 9 10 * platform/efl/Skipped: 11 * platform/gtk/TestExpectations: 12 1 13 2012-06-18 Zan Dobersek <zandobersek@gmail.com> 2 14 -
trunk/LayoutTests/platform/efl/Skipped
r120593 r120598 389 389 # rectangle has zero height. 390 390 canvas/philip/tests/2d.path.rect.zero.6.html 391 392 # Repeat-x/-y doesn't work - not supported in Cairo, workaround needed393 # https://bugs.webkit.org/show_bug.cgi?id=53085394 canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html395 canvas/philip/tests/2d.pattern.paint.repeatx.outside.html396 canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html397 canvas/philip/tests/2d.pattern.paint.repeaty.outside.html398 391 399 392 # BUG: Bug in the test itself, as the input box can be big enough for the given coordinates to be inside it. -
trunk/LayoutTests/platform/gtk/TestExpectations
r120593 r120598 821 821 BUGWKGTK : canvas/philip/tests/2d.path.rect.zero.6.html = TEXT 822 822 823 // Repeat-x/-y doesn't work - not supported in Cairo, workaround needed824 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html = TEXT825 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeatx.outside.html = TEXT826 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html = TEXT827 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeaty.outside.html = TEXT828 829 823 // Tests that user modal dialogs fail in the DRT for some reason. 830 824 BUGWK53600 : fast/animation/request-animation-frame-during-modal.html = TEXT -
trunk/Source/WebCore/ChangeLog
r120597 r120598 1 2012-06-18 Dominik Röttsches <dominik.rottsches@intel.com> 2 3 [cairo] Fix LayoutTests/fast/canvas/patternfill-repeat.html 4 https://bugs.webkit.org/show_bug.cgi?id=53085 5 6 Reviewed by Martin Robinson. 7 8 Clipping previously unlimited vertical and horizontal pattern repeats with 9 a clip rectangle similar to the Qt Graphics Context. 10 11 No new tests, this patch fixes 12 canvas/philip/tests/2d.pattern.paint.repeat* tests. 13 14 * platform/graphics/Pattern.h: 15 (WebCore::Pattern::getPatternSpaceTransform): Adding constant getter method to be able to map to pattern space externally, needed by PlatformContextCairo::clipForPatternFilling. 16 * platform/graphics/cairo/PlatformContextCairo.cpp: 17 (WebCore::PlatformContextCairo::prepareForFilling): 18 (WebCore::PlatformContextCairo::clipForPatternFilling): Clip pattern repeats if needed. 19 * platform/graphics/cairo/PlatformContextCairo.h: 20 1 21 2012-06-18 Robert Kroeger <rjkroege@chromium.org> 2 22 -
trunk/Source/WebCore/platform/graphics/Pattern.h
r113830 r120598 83 83 #endif 84 84 void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation); 85 const AffineTransform& getPatternSpaceTransform() { return m_patternSpaceTransformation; }; 85 86 void setPlatformPatternSpaceTransform(); 86 87 -
trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
r120279 r120598 252 252 state.fillColor, 253 253 patternAdjustment == AdjustPatternForGlobalAlpha ? globalAlpha() : 1); 254 255 if (state.fillPattern) 256 clipForPatternFilling(state); 254 257 } 255 258 … … 263 266 } 264 267 268 void PlatformContextCairo::clipForPatternFilling(const GraphicsContextState& state) 269 { 270 ASSERT(state.fillPattern); 271 272 // Hold current cairo path in a variable for restoring it after configuring the pattern clip rectangle. 273 OwnPtr<cairo_path_t> currentPath = adoptPtr(cairo_copy_path(m_cr.get())); 274 cairo_new_path(m_cr.get()); 275 276 // Initialize clipping extent from current cairo clip extents, then shrink if needed according to pattern. 277 // Inspired by GraphicsContextQt::drawRepeatPattern. 278 double x1, y1, x2, y2; 279 cairo_clip_extents(m_cr.get(), &x1, &y1, &x2, &y2); 280 FloatRect clipRect(x1, y1, x2 - x1, y2 - y1); 281 282 Image* patternImage = state.fillPattern->tileImage(); 283 ASSERT(patternImage); 284 const AffineTransform& patternTransform = state.fillPattern->getPatternSpaceTransform(); 285 FloatRect patternRect = patternTransform.mapRect(FloatRect(0, 0, patternImage->width(), patternImage->height())); 286 287 bool repeatX = state.fillPattern->repeatX(); 288 bool repeatY = state.fillPattern->repeatY(); 289 290 if (!repeatX) { 291 clipRect.setX(patternRect.x()); 292 clipRect.setWidth(patternRect.width()); 293 } 294 if (!repeatY) { 295 clipRect.setY(patternRect.y()); 296 clipRect.setHeight(patternRect.height()); 297 } 298 if (!repeatX || !repeatY) { 299 cairo_rectangle(m_cr.get(), clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()); 300 cairo_clip(m_cr.get()); 301 } 302 303 // Restoring cairo path. 304 cairo_append_path(m_cr.get(), currentPath.get()); 305 } 306 265 307 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h
r119392 r120598 69 69 70 70 private: 71 void clipForPatternFilling(const GraphicsContextState&); 72 71 73 RefPtr<cairo_t> m_cr; 72 74
Note: See TracChangeset
for help on using the changeset viewer.