Chromium Code Reviews| Index: src/core/SkCanvas.cpp |
| diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
| index 4462b4cc2ad2308ca3fcab2a343084143f7f62eb..bbb5f110bf13dcaed42593615030467b301f1968 100644 |
| --- a/src/core/SkCanvas.cpp |
| +++ b/src/core/SkCanvas.cpp |
| @@ -1596,6 +1596,25 @@ GrContext* SkCanvas::getGrContext() { |
| } |
| +void SkCanvas::drawDRRect(const SkRRect& outer, const SkRRect& inner, |
| + const SkPaint& paint) { |
| + // We don't have this method (yet), but technically this is what we should |
| + // be able to assert... |
| + // SkASSERT(outer.contains(inner)); |
| + // |
| + // For now at least check for containment of bounds |
| + SkASSERT(outer.getBounds().contains(inner.getBounds())); |
| + |
| + if (outer.isEmpty()) { |
| + return; |
| + } |
| + if (inner.isEmpty()) { |
| + this->drawRRect(outer, paint); |
| + return; |
| + } |
| + this->onDrawDRRect(outer, inner, paint); |
| +} |
| + |
| ////////////////////////////////////////////////////////////////////////////// |
| // These are the virtual drawing methods |
| ////////////////////////////////////////////////////////////////////////////// |
| @@ -1731,6 +1750,27 @@ void SkCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { |
| LOOPER_END |
| } |
| +void SkCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, |
| + const SkPaint& paint) { |
| + CHECK_SHADER_NOSETCONTEXT(paint); |
| + |
| + SkRect storage; |
| + const SkRect* bounds = NULL; |
| + if (paint.canComputeFastBounds()) { |
| + bounds = &paint.computeFastBounds(outer.getBounds(), &storage); |
| + if (this->quickReject(*bounds)) { |
| + return; |
| + } |
| + } |
| + |
|
robertphillips
2014/02/20 19:47:46
kDRRect_Type?
|
| + LOOPER_BEGIN(paint, SkDrawFilter::kRRect_Type, bounds) |
| + |
| + while (iter.next()) { |
| + iter.fDevice->drawDRRect(iter, outer, inner, looper.paint()); |
| + } |
| + |
| + LOOPER_END |
| +} |
| void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) { |
| CHECK_SHADER_NOSETCONTEXT(paint); |