| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 433 |
| 434 static void setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatP
oint* points) | 434 static void setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatP
oint* points) |
| 435 { | 435 { |
| 436 path->incReserve(numPoints); | 436 path->incReserve(numPoints); |
| 437 path->moveTo(WebCoreFloatToSkScalar(points[0].x()), | 437 path->moveTo(WebCoreFloatToSkScalar(points[0].x()), |
| 438 WebCoreFloatToSkScalar(points[0].y())); | 438 WebCoreFloatToSkScalar(points[0].y())); |
| 439 for (size_t i = 1; i < numPoints; ++i) { | 439 for (size_t i = 1; i < numPoints; ++i) { |
| 440 path->lineTo(WebCoreFloatToSkScalar(points[i].x()), | 440 path->lineTo(WebCoreFloatToSkScalar(points[i].x()), |
| 441 WebCoreFloatToSkScalar(points[i].y())); | 441 WebCoreFloatToSkScalar(points[i].y())); |
| 442 } | 442 } |
| 443 path->setIsConvex(true); | 443 |
| 444 /* The code used to just blindly call this |
| 445 path->setIsConvex(true); |
| 446 But webkit can sometimes send us non-convex 4-point values, so we mark t
he path's |
| 447 convexity as unknown, so it will get computed by skia at draw time. |
| 448 See crbug.com 108605 |
| 449 */ |
| 450 SkPath::Convexity convexity = SkPath::kConvex_Convexity; |
| 451 if (numPoints == 4) |
| 452 convexity = SkPath::kUnknown_Convexity; |
| 453 path->setConvexity(convexity); |
| 444 } | 454 } |
| 445 | 455 |
| 446 void GraphicsContext::drawConvexPolygon(size_t numPoints, | 456 void GraphicsContext::drawConvexPolygon(size_t numPoints, |
| 447 const FloatPoint* points, | 457 const FloatPoint* points, |
| 448 bool shouldAntialias) | 458 bool shouldAntialias) |
| 449 { | 459 { |
| 450 if (paintingDisabled()) | 460 if (paintingDisabled()) |
| 451 return; | 461 return; |
| 452 | 462 |
| 453 if (numPoints <= 1) | 463 if (numPoints <= 1) |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 | 1211 |
| 1202 #if PLATFORM(CHROMIUM) && OS(DARWIN) | 1212 #if PLATFORM(CHROMIUM) && OS(DARWIN) |
| 1203 CGColorSpaceRef deviceRGBColorSpaceRef() | 1213 CGColorSpaceRef deviceRGBColorSpaceRef() |
| 1204 { | 1214 { |
| 1205 static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB(); | 1215 static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB(); |
| 1206 return deviceSpace; | 1216 return deviceSpace; |
| 1207 } | 1217 } |
| 1208 #endif | 1218 #endif |
| 1209 | 1219 |
| 1210 } // namespace WebCore | 1220 } // namespace WebCore |
| OLD | NEW |