aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-08-18 15:46:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-18 15:46:03 -0700
commit10e3d9bf59bdec92c05367ae0b71e1ce1ee4a690 (patch)
tree970ba1b055b4ff3b07868eedc5a8d963441e6f54 /include/private
parent5fa47f4fd13b3158de4599414c86d17649c2dd1c (diff)
Batched implementation of drawLattice() for GPU
Bechmarks (Nexus 6P): Src=100x100, Dst=250x250, NumRects=9 Android 77.7us Skia (without patch) 57.2us Skia (with patch) 30.9us Src=100x100, Dst=500x500, NumRects=9 Android 77.0us Skia (without patch) 56.9us Skia (with patch) 31.8us Src=100x100, Dst=1000x1000, NumRects=9 Android 180us Skia (without patch) 96.8us Skia (with patch) 70.5us Src=100x100, Dst=250x250, NumRects=15 Android 208us Skia (without patch) 155us Skia (with patch) 38.2us Src=100x100, Dst=500x500, NumRects=15 Android 207us Skia (without patch) 152us Skia (with patch) 38.4us Src=100x100, Dst=1000x1000, NumRects=15 Android 233us Skia (without patch) 156us Skia (with patch) 99.9us BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002 Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d Review-Url: https://codereview.chromium.org/2255963002
Diffstat (limited to 'include/private')
-rw-r--r--include/private/SkTArray.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h
index 1fe2c3857c..1c06bf331a 100644
--- a/include/private/SkTArray.h
+++ b/include/private/SkTArray.h
@@ -238,6 +238,19 @@ public:
}
/**
+ * Version of above that uses the move constructor to set n items.
+ */
+ T* move_back_n(int n, T* t) {
+ SkASSERT(n >= 0);
+ this->checkRealloc(n);
+ for (int i = 0; i < n; ++i) {
+ new (fItemArray + fCount + i) T(std::move(t[i]));
+ }
+ fCount += n;
+ return fItemArray + fCount - n;
+ }
+
+ /**
* Removes the last element. Not safe to call when count() == 0.
*/
void pop_back() {