Changeset 64322 in webkit
- Timestamp:
- Jul 29, 2010 4:43:54 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64318 r64322 1 2010-07-29 Martin Robinson <mrobinson@igalia.com> 2 3 Unreviewed, rolling out r64318. 4 http://trac.webkit.org/changeset/64318 5 https://bugs.webkit.org/show_bug.cgi?id=41732 6 7 This change broke many tests. 8 9 * platform/graphics/cairo/GraphicsContextCairo.cpp: 10 (WebCore::GraphicsContext::drawEllipse): 11 (WebCore::GraphicsContext::drawConvexPolygon): 12 (WebCore::GraphicsContext::fillPath): 13 (WebCore::GraphicsContext::strokePath): 14 (WebCore::GraphicsContext::drawPath): 15 (WebCore::GraphicsContext::drawFocusRing): 16 (WebCore::GraphicsContext::addInnerRoundedRectClip): 17 (WebCore::GraphicsContext::beginPath): 18 (WebCore::GraphicsContext::addPath): 19 (WebCore::GraphicsContext::clipOut): 20 (WebCore::GraphicsContext::fillRoundedRect): 21 * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: 22 1 23 2010-07-29 Martin Robinson <mrobinson@igalia.com> 2 24 -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r64318 r64322 5 5 * Copyright (C) 2008 Nuanti Ltd. 6 6 * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org> 7 * Copyright (C) 2010 Igalia S.L.8 7 * 9 8 * Redistribution and use in source and binary forms, with or without … … 145 144 } 146 145 147 static void appendPathToCairoContext(cairo_t* to, cairo_t* from)148 {149 cairo_path_t* cairoPath = cairo_copy_path(from);150 cairo_append_path(to, cairoPath);151 cairo_path_destroy(cairoPath);152 }153 154 // We apply the pending path built via addPath to the Cairo context155 // lazily. This prevents interaction between the path and other routines156 // such as fillRect.157 static void setPathOnCairoContext(cairo_t* to, cairo_t* from)158 {159 cairo_new_path(to);160 appendPathToCairoContext(to, from);161 }162 163 static void appendWebCorePathToCairoContext(cairo_t* context, const Path& path)164 {165 appendPathToCairoContext(context, path.platformPath()->m_cr);166 }167 168 146 void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& kernelSize, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur) 169 147 { … … 403 381 cairo_set_line_width(cr, strokeThickness()); 404 382 cairo_stroke(cr); 405 } else 406 cairo_new_path(cr); 383 } 384 385 cairo_new_path(cr); 407 386 } 408 387 … … 520 499 cairo_set_line_width(cr, strokeThickness()); 521 500 cairo_stroke(cr); 522 } else523 cairo_new_path(cr); 524 501 } 502 503 cairo_new_path(cr); 525 504 cairo_restore(cr); 526 505 } … … 544 523 cairo_t* cr = m_data->cr; 545 524 546 setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);547 548 525 cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); 549 526 drawPathShadow(this, m_common, true, false); … … 559 536 560 537 cairo_t* cr = m_data->cr; 561 562 setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);563 564 538 drawPathShadow(this, m_common, false, true); 565 539 … … 575 549 576 550 cairo_t* cr = m_data->cr; 577 578 setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);579 551 580 552 cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); … … 702 674 int radius = (width - 1) / 2; 703 675 for (unsigned i = 0; i < rectCount; i++) 704 a ppendWebCorePathToCairoContext(cr,Path::createRoundedRectangle(rects[i], FloatSize(radius, radius)));676 addPath(Path::createRoundedRectangle(rects[i], FloatSize(radius, radius))); 705 677 706 678 // Force the alpha to 50%. This matches what the Mac does with outline rings. … … 869 841 return; 870 842 871 cairo_t* cr = m_data->cr;872 843 clip(rect); 873 844 … … 879 850 r.inflate(-thickness); 880 851 p.addEllipse(r); 881 appendWebCorePathToCairoContext(cr, p); 882 852 addPath(p); 853 854 cairo_t* cr = m_data->cr; 883 855 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); 884 856 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD); … … 1108 1080 return; 1109 1081 1110 cairo_new_path(m_data->m_pendingPath.m_cr); 1082 cairo_t* cr = m_data->cr; 1083 cairo_new_path(cr); 1111 1084 } 1112 1085 … … 1116 1089 return; 1117 1090 1118 cairo_ matrix_t currentMatrix;1119 cairo_ get_matrix(m_data->cr, ¤tMatrix);1120 cairo_ set_matrix(m_data->m_pendingPath.m_cr, ¤tMatrix);1121 appendWebCorePathToCairoContext(m_data->m_pendingPath.m_cr, path);1091 cairo_t* cr = m_data->cr; 1092 cairo_path_t* p = cairo_copy_path(path.platformPath()->m_cr); 1093 cairo_append_path(cr, p); 1094 cairo_path_destroy(p); 1122 1095 } 1123 1096 … … 1152 1125 cairo_clip_extents(cr, &x1, &y1, &x2, &y2); 1153 1126 cairo_rectangle(cr, x1, y1, x2 - x1, y2 - y1); 1154 a ppendWebCorePathToCairoContext(cr,path);1127 addPath(path); 1155 1128 1156 1129 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); … … 1211 1184 cairo_t* cr = m_data->cr; 1212 1185 cairo_save(cr); 1213 appendWebCorePathToCairoContext(cr, Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight)); 1186 beginPath(); 1187 addPath(Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight)); 1214 1188 setColor(cr, color); 1215 1189 drawPathShadow(this, m_common, true, false); -
trunk/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
r64318 r64322 96 96 cairo_t* cr; 97 97 Vector<float> layers; 98 CairoPath m_pendingPath;99 98 100 99 #if PLATFORM(GTK)
Note: See TracChangeset
for help on using the changeset viewer.