Changeset 120755 in webkit
- Timestamp:
- Jun 19, 2012 2:33:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r120754 r120755 1 2012-06-19 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-19 Hayato Ito <hayato@chromium.org> 2 14 -
trunk/LayoutTests/platform/efl/Skipped
r120692 r120755 386 386 # rectangle has zero height. 387 387 canvas/philip/tests/2d.path.rect.zero.6.html 388 389 # Repeat-x/-y doesn't work - not supported in Cairo, workaround needed390 # https://bugs.webkit.org/show_bug.cgi?id=53085391 canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html392 canvas/philip/tests/2d.pattern.paint.repeatx.outside.html393 canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html394 canvas/philip/tests/2d.pattern.paint.repeaty.outside.html395 388 396 389 # 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
r120706 r120755 818 818 BUGWKGTK : canvas/philip/tests/2d.path.rect.zero.6.html = TEXT 819 819 820 // Repeat-x/-y doesn't work - not supported in Cairo, workaround needed821 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html = TEXT822 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeatx.outside.html = TEXT823 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html = TEXT824 BUGWK53085 : canvas/philip/tests/2d.pattern.paint.repeaty.outside.html = TEXT825 826 820 // Tests that user modal dialogs fail in the DRT for some reason. 827 821 BUGWK53600 : fast/animation/request-animation-frame-during-modal.html = TEXT -
trunk/Source/WebCore/ChangeLog
r120754 r120755 1 2012-06-19 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-19 Hayato Ito <hayato@chromium.org> 2 22 -
trunk/Source/WebCore/platform/graphics/Pattern.h
r120607 r120755 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
r120607 r120755 32 32 #include "Gradient.h" 33 33 #include "GraphicsContext.h" 34 #include "OwnPtrCairo.h" 34 35 #include "Pattern.h" 35 36 #include <cairo.h> … … 252 253 state.fillColor, 253 254 patternAdjustment == AdjustPatternForGlobalAlpha ? globalAlpha() : 1); 255 256 if (state.fillPattern) 257 clipForPatternFilling(state); 254 258 } 255 259 … … 263 267 } 264 268 269 void PlatformContextCairo::clipForPatternFilling(const GraphicsContextState& state) 270 { 271 ASSERT(state.fillPattern); 272 273 // Hold current cairo path in a variable for restoring it after configuring the pattern clip rectangle. 274 OwnPtr<cairo_path_t> currentPath = adoptPtr(cairo_copy_path(m_cr.get())); 275 cairo_new_path(m_cr.get()); 276 277 // Initialize clipping extent from current cairo clip extents, then shrink if needed according to pattern. 278 // Inspired by GraphicsContextQt::drawRepeatPattern. 279 double x1, y1, x2, y2; 280 cairo_clip_extents(m_cr.get(), &x1, &y1, &x2, &y2); 281 FloatRect clipRect(x1, y1, x2 - x1, y2 - y1); 282 283 Image* patternImage = state.fillPattern->tileImage(); 284 ASSERT(patternImage); 285 const AffineTransform& patternTransform = state.fillPattern->getPatternSpaceTransform(); 286 FloatRect patternRect = patternTransform.mapRect(FloatRect(0, 0, patternImage->width(), patternImage->height())); 287 288 bool repeatX = state.fillPattern->repeatX(); 289 bool repeatY = state.fillPattern->repeatY(); 290 291 if (!repeatX) { 292 clipRect.setX(patternRect.x()); 293 clipRect.setWidth(patternRect.width()); 294 } 295 if (!repeatY) { 296 clipRect.setY(patternRect.y()); 297 clipRect.setHeight(patternRect.height()); 298 } 299 if (!repeatX || !repeatY) { 300 cairo_rectangle(m_cr.get(), clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()); 301 cairo_clip(m_cr.get()); 302 } 303 304 // Restoring cairo path. 305 cairo_append_path(m_cr.get(), currentPath.get()); 306 } 307 265 308 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h
r120607 r120755 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.