Index: src/core/SkFlattenableBuffers.cpp |
diff --git a/src/core/SkFlattenableBuffers.cpp b/src/core/SkFlattenableBuffers.cpp |
index 5167c2ebe9067b1a41c0b3785f0ef37f2cb7ac81..dbf66da7ce88bcbe3bf4d3fa61609bd2684c567c 100644 |
--- a/src/core/SkFlattenableBuffers.cpp |
+++ b/src/core/SkFlattenableBuffers.cpp |
@@ -9,6 +9,17 @@ |
#include "SkPaint.h" |
#include "SkTypeface.h" |
+#include "SkColorFilter.h" |
+#include "SkDrawLooper.h" |
+#include "SkImageFilter.h" |
+#include "SkMaskFilter.h" |
+#include "SkPathEffect.h" |
+#include "SkPixelRef.h" |
+#include "SkRasterizer.h" |
+#include "SkShader.h" |
+#include "SkUnitMapper.h" |
+#include "SkXfermode.h" |
+ |
SkFlattenableReadBuffer::SkFlattenableReadBuffer() { |
// Set default values. These should be explicitly set by our client |
// via setFlags() if the buffer came from serialization. |
@@ -34,6 +45,50 @@ void SkFlattenableReadBuffer::readPaint(SkPaint* paint) { |
paint->unflatten(*this); |
} |
+template <typename T> T* SkFlattenableReadBuffer::readFlattenableT() { |
+ return static_cast<T*>(this->readFlattenable(T::GetFlattenableType())); |
+} |
+ |
+SkColorFilter* SkFlattenableReadBuffer::readColorFilter() { |
+ return this->readFlattenableT<SkColorFilter>(); |
+} |
+ |
+SkDrawLooper* SkFlattenableReadBuffer::readDrawLooper() { |
+ return this->readFlattenableT<SkDrawLooper>(); |
+} |
+ |
+SkImageFilter* SkFlattenableReadBuffer::readImageFilter() { |
+ return this->readFlattenableT<SkImageFilter>(); |
+} |
+ |
+SkMaskFilter* SkFlattenableReadBuffer::readMaskFilter() { |
+ return this->readFlattenableT<SkMaskFilter>(); |
+} |
+ |
+SkPathEffect* SkFlattenableReadBuffer::readPathEffect() { |
+ return this->readFlattenableT<SkPathEffect>(); |
+} |
+ |
+SkPixelRef* SkFlattenableReadBuffer::readPixelRef() { |
+ return this->readFlattenableT<SkPixelRef>(); |
+} |
+ |
+SkRasterizer* SkFlattenableReadBuffer::readRasterizer() { |
+ return this->readFlattenableT<SkRasterizer>(); |
+} |
+ |
+SkShader* SkFlattenableReadBuffer::readShader() { |
+ return this->readFlattenableT<SkShader>(); |
+} |
+ |
+SkUnitMapper* SkFlattenableReadBuffer::readUnitMapper() { |
+ return this->readFlattenableT<SkUnitMapper>(); |
+} |
+ |
+SkXfermode* SkFlattenableReadBuffer::readXfermode() { |
+ return this->readFlattenableT<SkXfermode>(); |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
SkFlattenableWriteBuffer::SkFlattenableWriteBuffer() { |