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

Unified Diff: src/pipe/SkGPipeWrite.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/pipe/SkGPipeRead.cpp ('k') | src/utils/SkUnitMappers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkGPipeWrite.cpp
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index 2948f25d2781f3c956fcfd16e1b22673c6dcabfd..ce58ca6122cc95bde1fbe5446c5435bc85356231 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -17,7 +17,7 @@
#include "SkGPipePriv.h"
#include "SkImageFilter.h"
#include "SkMaskFilter.h"
-#include "SkOrderedWriteBuffer.h"
+#include "SkWriteBuffer.h"
#include "SkPaint.h"
#include "SkPathEffect.h"
#include "SkPictureFlat.h"
@@ -75,7 +75,7 @@ public:
SkASSERT((isCrossProcess && fset != NULL) || (!isCrossProcess && NULL == fset));
if (isCrossProcess) {
this->setNamedFactorySet(fset);
- this->setWriteBufferFlags(SkFlattenableWriteBuffer::kCrossProcess_Flag);
+ this->setWriteBufferFlags(SkWriteBuffer::kCrossProcess_Flag);
}
}
@@ -151,7 +151,7 @@ const SkFlatData* FlattenableHeap::flatToReplace() const {
///////////////////////////////////////////////////////////////////////////////
struct SkFlattenableTraits {
- static void flatten(SkOrderedWriteBuffer& buffer, const SkFlattenable& flattenable) {
+ static void flatten(SkWriteBuffer& buffer, const SkFlattenable& flattenable) {
buffer.writeFlattenable(&flattenable);
}
// No need to define unflatten if we never call it.
@@ -370,11 +370,11 @@ void SkGPipeCanvas::flattenFactoryNames() {
bool SkGPipeCanvas::shuttleBitmap(const SkBitmap& bm, int32_t slot) {
SkASSERT(shouldFlattenBitmaps(fFlags));
- SkOrderedWriteBuffer buffer;
+ SkWriteBuffer buffer;
buffer.setNamedFactoryRecorder(fFactorySet);
buffer.writeBitmap(bm);
this->flattenFactoryNames();
- uint32_t size = buffer.size();
+ uint32_t size = buffer.bytesWritten();
if (this->needOpBytes(size)) {
this->writeOp(kDef_Bitmap_DrawOp, 0, slot);
void* dst = static_cast<void*>(fWriter.reserve(size));
@@ -1146,7 +1146,7 @@ void SkGPipeCanvas::writePaint(const SkPaint& paint) {
this->writeOp(kSetAnnotation_DrawOp, 0, 0);
}
} else {
- SkOrderedWriteBuffer buffer;
+ SkWriteBuffer buffer;
paint.getAnnotation()->writeToBuffer(buffer);
const size_t size = buffer.bytesWritten();
if (this->needOpBytes(size)) {
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | src/utils/SkUnitMappers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698