aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkWriter32.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-11 18:22:04 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-11 18:22:04 +0000
commita87b21cd0041bac0d96b6836ac6e71a2dbcd4e10 (patch)
tree53a9f7cdbbe208f897d7aa9cfe0dc5515b3bade1 /include/core/SkWriter32.h
parent61e96cd44624c9faceb625519c1b29775b161f45 (diff)
Reland SkWriter32 growth change with build fixes.
- SkSWriter32 resets itself with its stack block; - Track the full capacity of fInternal (which may be >size after a reset). BUG=skia:2125 R=reed@google.com, iancottrell@chromium.org, iancottrell@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/158953003 git-svn-id: http://skia.googlecode.com/svn/trunk@13412 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkWriter32.h')
-rw-r--r--include/core/SkWriter32.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h
index df1275f7b6..7d8d764e59 100644
--- a/include/core/SkWriter32.h
+++ b/include/core/SkWriter32.h
@@ -67,7 +67,7 @@ public:
size_t offset = fUsed;
size_t totalRequired = fUsed + size;
if (totalRequired > fCapacity) {
- growToAtLeast(totalRequired);
+ this->growToAtLeast(totalRequired);
}
fUsed = totalRequired;
return (uint32_t*)(fData + offset);
@@ -247,7 +247,9 @@ private:
*/
template <size_t SIZE> class SkSWriter32 : public SkWriter32 {
public:
- SkSWriter32() : SkWriter32(fData.fStorage, SIZE) {}
+ SkSWriter32() { this->reset(); }
+
+ void reset() {this->INHERITED::reset(fData.fStorage, SIZE); }
private:
union {
@@ -255,6 +257,8 @@ private:
double fDoubleAlignment;
char fStorage[SIZE];
} fData;
+
+ typedef SkWriter32 INHERITED;
};
#endif