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

Unified Diff: src/core/SkScalerContext.cpp

Issue 134163010: Refactor read and write buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: whoops, read buffers have .size() Created 6 years, 11 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/SkReadBuffer.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.cpp
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 2a4e9d3d58f599a249f84f066378b83ff933155f..8a333481c5359ce45c4e4ee45c1de11535db0829 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -15,8 +15,8 @@
#include "SkGlyph.h"
#include "SkMaskFilter.h"
#include "SkMaskGamma.h"
-#include "SkOrderedReadBuffer.h"
-#include "SkOrderedWriteBuffer.h"
+#include "SkReadBuffer.h"
+#include "SkWriteBuffer.h"
#include "SkPathEffect.h"
#include "SkRasterizer.h"
#include "SkRasterClip.h"
@@ -73,7 +73,7 @@ static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag,
const void* data = desc->findEntry(tag, &len);
if (data) {
- SkOrderedReadBuffer buffer(data, len);
+ SkReadBuffer buffer(data, len);
obj = buffer.readFlattenable(ft);
SkASSERT(buffer.offset() == buffer.size());
}
@@ -118,7 +118,7 @@ SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkDescriptor* desc)
uint32_t len;
const void* data = desc->findEntry(kAndroidOpts_SkDescriptorTag, &len);
if (data) {
- SkOrderedReadBuffer buffer(data, len);
+ SkReadBuffer buffer(data, len);
fPaintOptionsAndroid.unflatten(buffer);
SkASSERT(buffer.offset() == buffer.size());
}
@@ -147,10 +147,11 @@ SkScalerContext* SkScalerContext::allocNextContext() const {
SkAutoTUnref<SkTypeface> aur(newFace);
uint32_t newFontID = newFace->uniqueID();
- SkOrderedWriteBuffer androidBuffer;
+ SkWriteBuffer androidBuffer;
fPaintOptionsAndroid.flatten(androidBuffer);
- SkAutoDescriptor ad(sizeof(fRec) + androidBuffer.size() + SkDescriptor::ComputeOverhead(2));
+ SkAutoDescriptor ad(sizeof(fRec) + androidBuffer.bytesWritten()
+ + SkDescriptor::ComputeOverhead(2));
SkDescriptor* desc = ad.getDesc();
desc->init();
@@ -158,7 +159,7 @@ SkScalerContext* SkScalerContext::allocNextContext() const {
(SkScalerContext::Rec*)desc->addEntry(kRec_SkDescriptorTag,
sizeof(fRec), &fRec);
androidBuffer.writeToMemory(desc->addEntry(kAndroidOpts_SkDescriptorTag,
- androidBuffer.size(), NULL));
+ androidBuffer.bytesWritten(), NULL));
newRec->fFontID = newFontID;
desc->computeChecksum();
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698