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

Unified Diff: include/core/SkWriter32.h

Issue 163983002: SkWriter32: throw in the SkTDArray towel. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up scars in SkTDArray. Created 6 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 | « include/core/SkTDArray.h ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkWriter32.h
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h
index 586fe9fb08e585d9db8ddc21eefbbfcc368b04cf..2e7c9563d9f748017a6b4e04adc1ccff1cbab63b 100644
--- a/include/core/SkWriter32.h
+++ b/include/core/SkWriter32.h
@@ -18,7 +18,7 @@
#include "SkRegion.h"
#include "SkScalar.h"
#include "SkStream.h"
-#include "SkTDArray.h"
+#include "SkTemplates.h"
#include "SkTypes.h"
class SkWriter32 : SkNoncopyable {
@@ -30,12 +30,7 @@ public:
* first time an allocation doesn't fit. From then it will use dynamically allocated storage.
* This used to be optional behavior, but pipe now relies on it.
*/
- SkWriter32(void* external = NULL, size_t externalBytes = 0)
- : fData(0)
- , fCapacity(0)
- , fUsed(0)
- , fExternal(0)
- {
+ SkWriter32(void* external = NULL, size_t externalBytes = 0) {
this->reset(external, externalBytes);
}
@@ -238,11 +233,11 @@ public:
private:
void growToAtLeast(size_t size);
- uint8_t* fData; // Points to either fInternal or fExternal.
- size_t fCapacity; // Number of bytes we can write to fData.
- size_t fUsed; // Number of bytes written.
- void* fExternal; // Unmanaged memory block.
- SkTDArray<uint8_t> fInternal; // Managed memory block.
+ uint8_t* fData; // Points to either fInternal or fExternal.
+ size_t fCapacity; // Number of bytes we can write to fData.
+ size_t fUsed; // Number of bytes written.
+ void* fExternal; // Unmanaged memory block.
+ SkAutoTMalloc<uint8_t> fInternal; // Managed memory block.
};
/**
« no previous file with comments | « include/core/SkTDArray.h ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698