Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

Issue 9254016: Merge 104609 - [skia] not all convex paths are convex, so recompute convexity for the problematic... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698