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

Side by Side Diff: src/core/SkFlattenableBuffers.cpp

Issue 26702002: force readbuffer clients to use specialized readFoo for flattenables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkFlattenableBuffers.h" 8 #include "SkFlattenableBuffers.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
(...skipping 16 matching lines...) Expand all
27 void* proc; 27 void* proc;
28 SkASSERT(sizeof(void*) == this->getArrayCount()); 28 SkASSERT(sizeof(void*) == this->getArrayCount());
29 this->readByteArray(&proc); 29 this->readByteArray(&proc);
30 return proc; 30 return proc;
31 } 31 }
32 32
33 void SkFlattenableReadBuffer::readPaint(SkPaint* paint) { 33 void SkFlattenableReadBuffer::readPaint(SkPaint* paint) {
34 paint->unflatten(*this); 34 paint->unflatten(*this);
35 } 35 }
36 36
37 SkFlattenable* SkFlattenableReadBuffer::readEffect(SkEffectType et) {
38 return this->readFlattenable();
39 }
40
37 /////////////////////////////////////////////////////////////////////////////// 41 ///////////////////////////////////////////////////////////////////////////////
38 42
39 SkFlattenableWriteBuffer::SkFlattenableWriteBuffer() { 43 SkFlattenableWriteBuffer::SkFlattenableWriteBuffer() {
40 fFlags = (Flags)0; 44 fFlags = (Flags)0;
41 } 45 }
42 46
43 SkFlattenableWriteBuffer::~SkFlattenableWriteBuffer() { } 47 SkFlattenableWriteBuffer::~SkFlattenableWriteBuffer() { }
44 48
45 void SkFlattenableWriteBuffer::writeFunctionPtr(void* ptr) { 49 void SkFlattenableWriteBuffer::writeFunctionPtr(void* ptr) {
46 void* ptrStorage[] = { ptr }; 50 void* ptrStorage[] = { ptr };
47 this->writeByteArray(ptrStorage, sizeof(void*)); 51 this->writeByteArray(ptrStorage, sizeof(void*));
48 } 52 }
49 53
50 void SkFlattenableWriteBuffer::writePaint(const SkPaint& paint) { 54 void SkFlattenableWriteBuffer::writePaint(const SkPaint& paint) {
51 paint.flatten(*this); 55 paint.flatten(*this);
52 } 56 }
53 57
54 void SkFlattenableWriteBuffer::flattenObject(SkFlattenable* obj, SkFlattenableWr iteBuffer& buffer) { 58 void SkFlattenableWriteBuffer::flattenObject(SkFlattenable* obj, SkFlattenableWr iteBuffer& buffer) {
55 obj->flatten(buffer); 59 obj->flatten(buffer);
56 } 60 }
61
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698