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

Unified Diff: src/pipe/SkGPipeRead.cpp

Issue 1529803004: Revert of remove drawSprite from canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 24f3e2d1eabe933083f023341716a4e255c41aee..4d57a6cca9db0896249b825ff03af0bb70f2418f 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -654,6 +654,17 @@
}
}
+static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
+ SkGPipeState* state) {
+ BitmapHolder holder(reader, op32, state);
+ bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_DrawOpFlag);
+ const SkIPoint* point = skip<SkIPoint>(reader);
+ const SkBitmap* bitmap = holder.getBitmap();
+ if (state->shouldDraw()) {
+ canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->paint() : nullptr);
+ }
+}
+
static void drawImage_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, SkGPipeState* state) {
unsigned slot = DrawOp_unpackData(op32);
unsigned flags = DrawOp_unpackFlags(op32);
@@ -880,6 +891,7 @@
drawPosTextH_rp,
drawRect_rp,
drawRRect_rp,
+ drawSprite_rp,
drawText_rp,
drawTextBlob_rp,
drawTextOnPath_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