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

Unified Diff: src/core/SkSmallAllocator.h

Issue 1768433003: remove align16 calls in skhader context sizes. will handle this elsewhere as needed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « src/core/SkShader.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSmallAllocator.h
diff --git a/src/core/SkSmallAllocator.h b/src/core/SkSmallAllocator.h
index 63c02eca33eb419d7300b0b56eb1ebf9fc280bf9..22baa898ea21a712a2aa4b596b84ce4114c44b80 100644
--- a/src/core/SkSmallAllocator.h
+++ b/src/core/SkSmallAllocator.h
@@ -71,14 +71,13 @@ public:
* allocation if necessary.
* Unlike createT(), this method will not call the constructor of T.
*/
- template<typename T> void* reserveT(size_t storageRequested = sizeof(T)) {
+ template<typename T> void* reserveT(size_t storageRequired = sizeof(T)) {
SkASSERT(fNumObjects < kMaxObjects);
- SkASSERT(storageRequested >= sizeof(T));
+ SkASSERT(storageRequired >= sizeof(T));
if (kMaxObjects == fNumObjects) {
return nullptr;
}
const size_t storageRemaining = sizeof(fStorage) - fStorageUsed;
- const size_t storageRequired = SkAlign16(storageRequested);
Rec* rec = &fRecs[fNumObjects];
if (storageRequired > storageRemaining) {
// Allocate on the heap. Ideally we want to avoid this situation,
@@ -92,7 +91,6 @@ public:
// There is space in fStorage.
rec->fStorageSize = storageRequired;
rec->fHeapStorage = nullptr;
- SkASSERT(SkIsAlign16(fStorageUsed));
rec->fObj = static_cast<void*>(fStorage.fBytes + fStorageUsed);
fStorageUsed += storageRequired;
}
« no previous file with comments | « src/core/SkShader.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698