| OLD | NEW |
| 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" |
| 11 | 11 |
| 12 #include "SkColorFilter.h" | 12 #include "SkColorFilter.h" |
| 13 #include "SkDrawLooper.h" | 13 #include "SkDrawLooper.h" |
| 14 #include "SkImageFilter.h" | 14 #include "SkImageFilter.h" |
| 15 #include "SkMaskFilter.h" | 15 #include "SkMaskFilter.h" |
| 16 #include "SkPathEffect.h" | 16 #include "SkPathEffect.h" |
| 17 #include "SkPixelRef.h" | 17 #include "SkPixelRef.h" |
| 18 #include "SkRasterizer.h" | 18 #include "SkRasterizer.h" |
| 19 #include "SkShader.h" | 19 #include "SkShader.h" |
| 20 #include "SkUnitMapper.h" | 20 #include "SkUnitMapper.h" |
| 21 #include "SkXfermode.h" | 21 #include "SkXfermode.h" |
| 22 | 22 |
| 23 SkFlattenableReadBuffer::SkFlattenableReadBuffer() { | 23 SkFlattenableReadBuffer::SkFlattenableReadBuffer() { |
| 24 // Set default values. These should be explicitly set by our client | 24 // Set default values. These should be explicitly set by our client |
| 25 // via setFlags() if the buffer came from serialization. | 25 // via setFlags() if the buffer came from serialization. |
| 26 fFlags = 0; | 26 fFlags = 0; |
| 27 #ifdef SK_SCALAR_IS_FLOAT | 27 // TODO: remove this flag, since we're always floats (now) |
| 28 fFlags |= kScalarIsFloat_Flag; | 28 fFlags |= kScalarIsFloat_Flag; |
| 29 #endif | |
| 30 if (8 == sizeof(void*)) { | 29 if (8 == sizeof(void*)) { |
| 31 fFlags |= kPtrIs64Bit_Flag; | 30 fFlags |= kPtrIs64Bit_Flag; |
| 32 } | 31 } |
| 33 } | 32 } |
| 34 | 33 |
| 35 SkFlattenableReadBuffer::~SkFlattenableReadBuffer() { } | 34 SkFlattenableReadBuffer::~SkFlattenableReadBuffer() { } |
| 36 | 35 |
| 37 void* SkFlattenableReadBuffer::readFunctionPtr() { | 36 void* SkFlattenableReadBuffer::readFunctionPtr() { |
| 38 void* proc; | 37 void* proc; |
| 39 SkASSERT(sizeof(void*) == this->getArrayCount()); | 38 SkASSERT(sizeof(void*) == this->getArrayCount()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 106 } |
| 108 | 107 |
| 109 void SkFlattenableWriteBuffer::writePaint(const SkPaint& paint) { | 108 void SkFlattenableWriteBuffer::writePaint(const SkPaint& paint) { |
| 110 paint.flatten(*this); | 109 paint.flatten(*this); |
| 111 } | 110 } |
| 112 | 111 |
| 113 void SkFlattenableWriteBuffer::flattenObject(const SkFlattenable* obj, | 112 void SkFlattenableWriteBuffer::flattenObject(const SkFlattenable* obj, |
| 114 SkFlattenableWriteBuffer& buffer) { | 113 SkFlattenableWriteBuffer& buffer) { |
| 115 obj->flatten(buffer); | 114 obj->flatten(buffer); |
| 116 } | 115 } |
| OLD | NEW |