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

Unified Diff: src/core/SkRecordDraw.cpp

Issue 610003002: Override SkCanvas::drawImage() in SkRecorder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase master Created 6 years, 2 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 | « no previous file | src/core/SkRecorder.h » ('j') | tests/RecordDrawTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 45324b8cecba03a10346a0abab4a2a192f5becde..6a39b7e225fcf045bcbee493996dc8aba436a3b5 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -93,6 +93,8 @@ DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.p
DRAW(DrawBitmapRectToRect,
drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, r.flags));
DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint));
+DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint));
+DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint));
DRAW(DrawOval, drawOval(r.oval, r.paint));
DRAW(DrawPaint, drawPaint(r.paint));
DRAW(DrawPath, drawPath(r.path, r.paint));
@@ -359,7 +361,15 @@ private:
Bounds bounds(const DrawDRRect& op) const {
return this->adjustAndMap(op.outer.rect(), &op.paint);
}
+ Bounds bounds(const DrawImage& op) const {
+ const SkImage* image = op.image;
+ SkRect rect = SkRect::MakeXYWH(op.left, op.top, image->width(), image->height());
+ return this->adjustAndMap(rect, op.paint);
+ }
+ Bounds bounds(const DrawImageRect& op) const {
+ return this->adjustAndMap(op.dst, op.paint);
+ }
Bounds bounds(const DrawBitmapRectToRect& op) const {
return this->adjustAndMap(op.dst, op.paint);
}
« no previous file with comments | « no previous file | src/core/SkRecorder.h » ('j') | tests/RecordDrawTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698