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

Unified Diff: src/core/SkLiteDL.cpp

Issue 2205273003: Add onDrawBitmapLattice(), avoid unnecessary bitmap->image copy (Closed) Base URL: https://skia.googlesource.com/skia.git@copypaste
Patch Set: Add support for SkLiteRecorder Created 4 years, 4 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
Index: src/core/SkLiteDL.cpp
diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp
index d6498897706cd141482821cd84b45821e1ffa118..b8938ba771f5fc62a406d2cf0e13f05fe72b6e09 100644
--- a/src/core/SkLiteDL.cpp
+++ b/src/core/SkLiteDL.cpp
@@ -624,6 +624,15 @@ void SkLiteDL::drawBitmapRect(const SkBitmap& bm, const SkRect* src, const SkRec
const SkPaint* paint, SkCanvas::SrcRectConstraint constraint) {
this->push<DrawImageRect>(0, SkImage::MakeFromBitmap(bm), src, dst, paint, constraint);
}
+void SkLiteDL::drawBitmapLattice(const SkBitmap& bm, const SkCanvas::Lattice& lattice,
+ const SkRect& dst, const SkPaint* paint) {
+ int xs = lattice.fXCount, ys = lattice.fYCount;
reed1 2016/08/16 11:28:47 minor nit: possibly just call drawImageLattice,so
mtklein 2016/08/16 12:36:05 That can be made correct but will wobble the ref c
msarett 2016/08/16 14:45:37 Will leave as is in this CL.
+ size_t bytes = (xs + ys) * sizeof(int);
+ void* pod = this->push<DrawImageLattice>(bytes, SkImage::MakeFromBitmap(bm), xs, ys, dst,
+ paint);
+ copy_v(pod, lattice.fXDivs, xs,
+ lattice.fYDivs, ys);
+}
void SkLiteDL::drawImage(const SkImage* image, SkScalar x, SkScalar y, const SkPaint* paint) {
this->push<DrawImage>(0, sk_ref_sp(image), x,y, paint);
« no previous file with comments | « src/core/SkLiteDL.h ('k') | src/core/SkLiteRecorder.h » ('j') | src/pdf/SkPDFCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698