Changeset 51319 in webkit
- Timestamp:
- Nov 23, 2009 2:10:55 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51317 r51319 1 2009-11-23 Adam Langley <agl@google.com> 2 3 Reviewed by Dmitry Titov. 4 5 Chromium Linux: Limit the stroke width and mitre limit. 6 7 Limit the stroke width and mitre limit that we'll pass into Skia to 8 avoid overflowing Skia's uint16_t glyph widths. 9 10 http://code.google.com/p/chromium/issues/detail?id=28250 11 https://bugs.webkit.org/show_bug.cgi?id=31747 12 13 * platform/graphics/skia/PlatformContextSkia.cpp: 14 (scalarBound): 15 (PlatformContextSkia::setupPaintForStroking): 16 1 17 2009-11-23 Alexey Proskuryakov <ap@apple.com> 2 18 -
trunk/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
r50253 r51319 344 344 } 345 345 346 static SkScalar scalarBound(SkScalar v, SkScalar min, SkScalar max) 347 { 348 if (v < min) 349 return min; 350 if (v > max) 351 return max; 352 return v; 353 } 354 346 355 float PlatformContextSkia::setupPaintForStroking(SkPaint* paint, SkRect* rect, int length) const 347 356 { … … 352 361 paint->setShader(m_state->m_strokeShader); 353 362 paint->setStyle(SkPaint::kStroke_Style); 354 paint->setStrokeWidth(SkFloatToScalar(width)); 363 // The limits here (512 and 256) were made up but are hopefully large 364 // enough to be reasonable. They are, empirically, small enough not to 365 // cause overflows in Skia. 366 paint->setStrokeWidth(scalarBound(SkFloatToScalar(width), 0, 512)); 355 367 paint->setStrokeCap(m_state->m_lineCap); 356 368 paint->setStrokeJoin(m_state->m_lineJoin); 357 paint->setStrokeMiter( SkFloatToScalar(m_state->m_miterLimit));369 paint->setStrokeMiter(scalarBound(SkFloatToScalar(m_state->m_miterLimit), 0, 256)); 358 370 359 371 if (m_state->m_dash)
Note: See TracChangeset
for help on using the changeset viewer.