| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkColorFilter.h" | 8 #include "SkColorFilter.h" |
| 9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
| 10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 geo = kUnknown_SkPixelGeometry; | 68 geo = kUnknown_SkPixelGeometry; |
| 69 } | 69 } |
| 70 break; | 70 break; |
| 71 } | 71 } |
| 72 return geo; | 72 return geo; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void SkBaseDevice::drawArc(const SkDraw& draw, const SkRect& oval, SkScalar star
tAngle, | 75 void SkBaseDevice::drawArc(const SkDraw& draw, const SkRect& oval, SkScalar star
tAngle, |
| 76 SkScalar sweepAngle, bool useCenter, const SkPaint& p
aint) { | 76 SkScalar sweepAngle, bool useCenter, const SkPaint& p
aint) { |
| 77 SkASSERT(SkScalarAbs(sweepAngle) >= 0.f && SkScalarAbs(sweepAngle) < 360.f); | 77 SkASSERT(SkScalarAbs(sweepAngle) >= 0.f && SkScalarAbs(sweepAngle) < 360.f); |
| 78 SkPath path; | 78 SkPath path; |
| 79 if (useCenter) { | 79 if (useCenter) { |
| 80 path.moveTo(oval.centerX(), oval.centerY()); | 80 path.moveTo(oval.centerX(), oval.centerY()); |
| 81 } | 81 } |
| 82 path.arcTo(oval, startAngle, sweepAngle, !useCenter); | 82 path.arcTo(oval, startAngle, sweepAngle, !useCenter); |
| 83 if (useCenter) { | 83 if (useCenter) { |
| 84 path.close(); | 84 path.close(); |
| 85 } | 85 } |
| 86 path.setIsVolatile(true); |
| 86 this->drawPath(draw, path, paint); | 87 this->drawPath(draw, path, paint); |
| 87 } | 88 } |
| 88 | 89 |
| 89 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, | 90 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, |
| 90 const SkRRect& inner, const SkPaint& paint) { | 91 const SkRRect& inner, const SkPaint& paint) { |
| 91 SkPath path; | 92 SkPath path; |
| 92 path.addRRect(outer); | 93 path.addRRect(outer); |
| 93 path.addRRect(inner); | 94 path.addRRect(inner); |
| 94 path.setFillType(SkPath::kEvenOdd_FillType); | 95 path.setFillType(SkPath::kEvenOdd_FillType); |
| 96 path.setIsVolatile(true); |
| 95 | 97 |
| 96 const SkMatrix* preMatrix = nullptr; | 98 const SkMatrix* preMatrix = nullptr; |
| 97 const bool pathIsMutable = true; | 99 const bool pathIsMutable = true; |
| 98 this->drawPath(draw, path, paint, preMatrix, pathIsMutable); | 100 this->drawPath(draw, path, paint, preMatrix, pathIsMutable); |
| 99 } | 101 } |
| 100 | 102 |
| 101 void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const
SkColor colors[4], | 103 void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const
SkColor colors[4], |
| 102 const SkPoint texCoords[4], SkXfermode* xmode, cons
t SkPaint& paint) { | 104 const SkPoint texCoords[4], SkXfermode* xmode, cons
t SkPaint& paint) { |
| 103 SkPatchUtils::VertexData data; | 105 SkPatchUtils::VertexData data; |
| 104 | 106 |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 550 |
| 549 // Also log filter quality independent scale factor. | 551 // Also log filter quality independent scale factor. |
| 550 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, | 552 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, |
| 551 kLast_ScaleFactor + 1); | 553 kLast_ScaleFactor + 1); |
| 552 | 554 |
| 553 // Also log an overall histogram of filter quality. | 555 // Also log an overall histogram of filter quality. |
| 554 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali
ty + 1); | 556 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali
ty + 1); |
| 555 #endif | 557 #endif |
| 556 } | 558 } |
| 557 | 559 |
| OLD | NEW |