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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 1211583003: add drawImageNine (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments from #9 Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index ccf0b012b12d29323df2e621800872b37cdaa669..8e3423584857b0217f8da6759bec4435af4949d3 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -229,6 +229,9 @@ protected:
void drawImageRect(const SkDraw&, const SkImage*, const SkRect*, const SkRect&,
const SkPaint&) override
{SkASSERT(0);}
+ void drawImageNine(const SkDraw&, const SkImage*, const SkIRect&, const SkRect&,
+ const SkPaint&) override
+ {SkASSERT(0);}
void drawText(const SkDraw&, const void* text, size_t len,
SkScalar x, SkScalar y, const SkPaint& paint) override
{SkASSERT(0);}
@@ -903,6 +906,19 @@ void SkDeferredCanvas::onDrawImageRect(const SkImage* image, const SkRect* src,
this->recordedDrawCommand();
}
+void SkDeferredCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center,
+ const SkRect& dst, const SkPaint* paint) {
+ if (fDeferredDrawing &&
+ this->isFullFrame(&dst, paint) &&
+ isPaintOpaque(paint, image)) {
+ this->getDeferredDevice()->skipPendingCommands();
+ }
+
+ AutoImmediateDrawIfNeeded autoDraw(*this, image, paint);
+ this->drawingCanvas()->drawImageNine(image, center, dst, paint);
+ this->recordedDrawCommand();
+}
+
void SkDeferredCanvas::onDrawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698