-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SkFlattenable.h"
#include "SkPtrRecorder.h"
-
-SK_DEFINE_INST_COUNT(SkFlattenable)
+#include "SkReadBuffer.h"
///////////////////////////////////////////////////////////////////////////////
-void SkFlattenable::flatten(SkFlattenableWriteBuffer&) const
-{
- /* we don't write anything at the moment, but this allows our subclasses
- to not know that, since we want them to always call INHERITED::flatten()
- in their code.
- */
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
+bool SkFlattenable::NeedsDeepUnflatten(const SkReadBuffer& buffer) {
+ return buffer.isVersionLT(SkReadBuffer::kFlattenCreateProc_Version);
}
+#endif
///////////////////////////////////////////////////////////////////////////////
}
bool SkFlattenable::NameToType(const char name[], SkFlattenable::Type* type) {
- SkASSERT(NULL != type);
+ SkASSERT(type);
InitializeFlattenablesIfNeeded();
#ifdef SK_DEBUG
report_no_entries(__FUNCTION__);