diff options
author | Mike Reed <reed@google.com> | 2016-10-05 11:52:51 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-05 16:41:15 +0000 |
commit | ef4ab9d5aaf90f0881927e0e940a48584f7fa60f (patch) | |
tree | ad032ee260ebd9036b42b018c3cbf56e5319a5df /src/utils | |
parent | 39eabb6ccba244f47534ed5a2a961596777904f4 (diff) |
update defer-canvas for lattice and regions
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2985
Change-Id: I9106841d1cc246064d0a963b0a1e9feae109589d
Reviewed-on: https://skia-review.googlesource.com/2985
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 19 | ||||
-rw-r--r-- | src/utils/SkDeferredCanvas.h | 16 |
2 files changed, 31 insertions, 4 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index c8af14c08a..da05f63a7e 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -318,6 +318,11 @@ void SkDeferredCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) { fCanvas->drawRect(modRect, paint); } +void SkDeferredCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) { + this->flush_all(); // can we do better? + fCanvas->drawRegion(region, paint); +} + void SkDeferredCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) { SkRect modRect = rect; this->flush_check(&modRect, &paint, kNoClip_Flag); @@ -387,6 +392,13 @@ void SkDeferredCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& c fCanvas->drawBitmapNine(bitmap, center, modRect, paint); } +void SkDeferredCanvas::onDrawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, + const SkRect& dst, const SkPaint* paint) { + SkRect modRect = dst; + this->flush_check(&modRect, paint, kNoClip_Flag); + fCanvas->drawBitmapLattice(bitmap, lattice, modRect, paint); +} + void SkDeferredCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, const SkPaint* paint) { SkRect modRect = dst; @@ -414,6 +426,13 @@ void SkDeferredCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, fCanvas->legacy_drawImageRect(image, src, modRect, paint, constraint); } +void SkDeferredCanvas::onDrawImageLattice(const SkImage* image, const Lattice& lattice, + const SkRect& dst, const SkPaint* paint) { + SkRect modRect = dst; + this->flush_check(&modRect, paint, kNoClip_Flag); + fCanvas->drawImageLattice(image, lattice, modRect, paint); +} + void SkDeferredCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, const SkPaint& paint) { this->flush_translate(&x, &y, paint); diff --git a/src/utils/SkDeferredCanvas.h b/src/utils/SkDeferredCanvas.h index 05ad4cfca8..312c22d26e 100644 --- a/src/utils/SkDeferredCanvas.h +++ b/src/utils/SkDeferredCanvas.h @@ -62,20 +62,28 @@ protected: void onDrawPaint(const SkPaint&) override; void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override; void onDrawRect(const SkRect&, const SkPaint&) override; + void onDrawRegion(const SkRegion& region, const SkPaint& paint) override; void onDrawOval(const SkRect&, const SkPaint&) override; void onDrawArc(const SkRect&, SkScalar, SkScalar, bool, const SkPaint&) override; void onDrawRRect(const SkRRect&, const SkPaint&) override; void onDrawPath(const SkPath&, const SkPaint&) override; + void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override; + void onDrawBitmapLattice(const SkBitmap&, const Lattice& lattice, const SkRect& dst, + const SkPaint*) override; + void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, + const SkPaint*) override; void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, SrcRectConstraint) override; + void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override; - void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, - const SkPaint*, SrcRectConstraint) override; - void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, - const SkPaint*) override; + void onDrawImageLattice(const SkImage*, const Lattice& lattice, const SkRect& dst, + const SkPaint*) override; void onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, const SkPaint*) override; + void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, + const SkPaint*, SrcRectConstraint) override; + void onDrawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], SkXfermode* xmode, |