| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 | 1264 |
| 1265 void GraphicsContext::fillPath(const Path& pathToFill) | 1265 void GraphicsContext::fillPath(const Path& pathToFill) |
| 1266 { | 1266 { |
| 1267 if (contextDisabled() || pathToFill.isEmpty()) | 1267 if (contextDisabled() || pathToFill.isEmpty()) |
| 1268 return; | 1268 return; |
| 1269 | 1269 |
| 1270 // Use const_cast and temporarily modify the fill type instead of copying th
e path. | 1270 // Use const_cast and temporarily modify the fill type instead of copying th
e path. |
| 1271 SkPath& path = const_cast<SkPath&>(pathToFill.skPath()); | 1271 SkPath& path = const_cast<SkPath&>(pathToFill.skPath()); |
| 1272 SkPath::FillType previousFillType = path.getFillType(); | 1272 SkPath::FillType previousFillType = path.getFillType(); |
| 1273 | 1273 |
| 1274 SkPath::FillType temporaryFillType = static_cast<SkPath::FillType>(immutable
State()->fillRule()); | 1274 SkPath::FillType temporaryFillType = WebCoreWindRuleToSkFillType(immutableSt
ate()->fillRule()); |
| 1275 path.setFillType(temporaryFillType); | 1275 path.setFillType(temporaryFillType); |
| 1276 | 1276 |
| 1277 drawPath(path, immutableState()->fillPaint()); | 1277 drawPath(path, immutableState()->fillPaint()); |
| 1278 | 1278 |
| 1279 path.setFillType(previousFillType); | 1279 path.setFillType(previousFillType); |
| 1280 } | 1280 } |
| 1281 | 1281 |
| 1282 void GraphicsContext::fillRect(const FloatRect& rect) | 1282 void GraphicsContext::fillRect(const FloatRect& rect) |
| 1283 { | 1283 { |
| 1284 if (contextDisabled()) | 1284 if (contextDisabled()) |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 | 1455 |
| 1456 void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule) | 1456 void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule) |
| 1457 { | 1457 { |
| 1458 if (contextDisabled() || pathToClip.isEmpty()) | 1458 if (contextDisabled() || pathToClip.isEmpty()) |
| 1459 return; | 1459 return; |
| 1460 | 1460 |
| 1461 // Use const_cast and temporarily modify the fill type instead of copying th
e path. | 1461 // Use const_cast and temporarily modify the fill type instead of copying th
e path. |
| 1462 SkPath& path = const_cast<SkPath&>(pathToClip.skPath()); | 1462 SkPath& path = const_cast<SkPath&>(pathToClip.skPath()); |
| 1463 SkPath::FillType previousFillType = path.getFillType(); | 1463 SkPath::FillType previousFillType = path.getFillType(); |
| 1464 | 1464 |
| 1465 SkPath::FillType temporaryFillType = static_cast<SkPath::FillType>(clipRule)
; | 1465 SkPath::FillType temporaryFillType = WebCoreWindRuleToSkFillType(clipRule); |
| 1466 path.setFillType(temporaryFillType); | 1466 path.setFillType(temporaryFillType); |
| 1467 clipPath(path, AntiAliased); | 1467 clipPath(path, AntiAliased); |
| 1468 | 1468 |
| 1469 path.setFillType(previousFillType); | 1469 path.setFillType(previousFillType); |
| 1470 } | 1470 } |
| 1471 | 1471 |
| 1472 void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* poin
ts, bool antialiased) | 1472 void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* poin
ts, bool antialiased) |
| 1473 { | 1473 { |
| 1474 if (contextDisabled()) | 1474 if (contextDisabled()) |
| 1475 return; | 1475 return; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1492 | 1492 |
| 1493 void GraphicsContext::canvasClip(const Path& pathToClip, WindRule clipRule) | 1493 void GraphicsContext::canvasClip(const Path& pathToClip, WindRule clipRule) |
| 1494 { | 1494 { |
| 1495 if (contextDisabled()) | 1495 if (contextDisabled()) |
| 1496 return; | 1496 return; |
| 1497 | 1497 |
| 1498 // Use const_cast and temporarily modify the fill type instead of copying th
e path. | 1498 // Use const_cast and temporarily modify the fill type instead of copying th
e path. |
| 1499 SkPath& path = const_cast<SkPath&>(pathToClip.skPath()); | 1499 SkPath& path = const_cast<SkPath&>(pathToClip.skPath()); |
| 1500 SkPath::FillType previousFillType = path.getFillType(); | 1500 SkPath::FillType previousFillType = path.getFillType(); |
| 1501 | 1501 |
| 1502 SkPath::FillType temporaryFillType = static_cast<SkPath::FillType>(clipRule)
; | 1502 SkPath::FillType temporaryFillType = WebCoreWindRuleToSkFillType(clipRule); |
| 1503 path.setFillType(temporaryFillType); | 1503 path.setFillType(temporaryFillType); |
| 1504 clipPath(path); | 1504 clipPath(path); |
| 1505 | 1505 |
| 1506 path.setFillType(previousFillType); | 1506 path.setFillType(previousFillType); |
| 1507 } | 1507 } |
| 1508 | 1508 |
| 1509 void GraphicsContext::clipRect(const SkRect& rect, AntiAliasingMode aa, SkRegion
::Op op) | 1509 void GraphicsContext::clipRect(const SkRect& rect, AntiAliasingMode aa, SkRegion
::Op op) |
| 1510 { | 1510 { |
| 1511 if (contextDisabled()) | 1511 if (contextDisabled()) |
| 1512 return; | 1512 return; |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag | 1935 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag |
| 1936 // being set to true). We need to decide if we respect InterpolationNone | 1936 // being set to true). We need to decide if we respect InterpolationNone |
| 1937 // being returned from computeInterpolationQuality. | 1937 // being returned from computeInterpolationQuality. |
| 1938 resampling = InterpolationLow; | 1938 resampling = InterpolationLow; |
| 1939 } | 1939 } |
| 1940 resampling = limitInterpolationQuality(this, resampling); | 1940 resampling = limitInterpolationQuality(this, resampling); |
| 1941 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); | 1941 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); |
| 1942 } | 1942 } |
| 1943 | 1943 |
| 1944 } | 1944 } |
| OLD | NEW |