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

Unified Diff: src/pipe/SkGPipeRead.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/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkGPipeRead.cpp
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 8d3048d76f7f3954d5c364df85fad5adea928356..48e0c0641baa2370bd0996c5c521b6d1a41863ae 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -695,6 +695,19 @@ static void drawImageRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32
}
}
+static void drawImageNine_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
+ SkGPipeState* state) {
+ unsigned slot = DrawOp_unpackData(op32);
+ unsigned flags = DrawOp_unpackFlags(op32);
+ bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag);
+ const SkIRect* center = skip<SkIRect>(reader);
+ const SkRect* dst = skip<SkRect>(reader);
+ const SkImage* image = state->getImage(slot);
+ if (state->shouldDraw()) {
+ canvas->drawImageNine(image, *center, *dst, hasPaint ? &state->paint() : NULL);
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
static void drawPicture_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
@@ -866,6 +879,7 @@ static const ReadProc gReadTable[] = {
drawDRRect_rp,
drawImage_rp,
drawImageRect_rp,
+ drawImageNine_rp,
drawOval_rp,
drawPaint_rp,
drawPatch_rp,
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698