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

Unified Diff: include/private/SkTArray.h

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 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 | « include/gpu/effects/GrXfermodeFragmentProcessor.h ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkTArray.h
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h
index 55d4f86aaabf63d9baf9f8a6a9d610175b6a23b8..1fe2c3857c1555c58efe20303709dbde649ee868 100644
--- a/include/private/SkTArray.h
+++ b/include/private/SkTArray.h
@@ -121,6 +121,15 @@ public:
}
/**
+ * Ensures there is enough reserved space for n elements.
+ */
+ void reserve(int n) {
+ if (fCount < n) {
+ this->checkRealloc(n - fCount);
+ }
+ }
+
+ /**
* Resets to a copy of a C array.
*/
void reset(const T* array, int count) {
« no previous file with comments | « include/gpu/effects/GrXfermodeFragmentProcessor.h ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698