Remove SkColorTable from SkFlattenable hierarchy.
BUG= R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/27392002 git-svn-id: http://skia.googlecode.com/svn/trunk@11791 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
36c5bdb097
commit
e0e1da34f3
@ -19,7 +19,7 @@
|
||||
SkColorTable holds an array SkPMColors (premultiplied 32-bit colors) used by
|
||||
8-bit bitmaps, where the bitmap bytes are interpreted as indices into the colortable.
|
||||
*/
|
||||
class SkColorTable : public SkFlattenable {
|
||||
class SkColorTable : public SkRefCnt {
|
||||
public:
|
||||
SK_DECLARE_INST_COUNT(SkColorTable)
|
||||
|
||||
@ -75,11 +75,8 @@ public:
|
||||
SkDEBUGCODE(f16BitCacheLockCount -= 1);
|
||||
}
|
||||
|
||||
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorTable)
|
||||
|
||||
protected:
|
||||
explicit SkColorTable(SkFlattenableReadBuffer&);
|
||||
void flatten(SkFlattenableWriteBuffer&) const;
|
||||
void writeToBuffer(SkFlattenableWriteBuffer&) const;
|
||||
|
||||
private:
|
||||
SkPMColor* fColors;
|
||||
@ -91,7 +88,7 @@ private:
|
||||
|
||||
void inval16BitCache();
|
||||
|
||||
typedef SkFlattenable INHERITED;
|
||||
typedef SkRefCnt INHERITED;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -100,7 +100,7 @@ SkColorTable::SkColorTable(SkFlattenableReadBuffer& buffer) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void SkColorTable::flatten(SkFlattenableWriteBuffer& buffer) const {
|
||||
void SkColorTable::writeToBuffer(SkFlattenableWriteBuffer& buffer) const {
|
||||
buffer.writeUInt(fAlphaType);
|
||||
buffer.writeColorArray(fColors, fCount);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ void SkMallocPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
|
||||
buffer.writeByteArray(fStorage, fSize);
|
||||
buffer.writeBool(fCTable != NULL);
|
||||
if (fCTable) {
|
||||
buffer.writeFlattenable(fCTable);
|
||||
fCTable->writeToBuffer(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ SkMallocPixelRef::SkMallocPixelRef(SkFlattenableReadBuffer& buffer)
|
||||
fStorage = sk_malloc_throw(fSize);
|
||||
buffer.readByteArray(fStorage);
|
||||
if (buffer.readBool()) {
|
||||
fCTable = buffer.readFlattenableT<SkColorTable>();
|
||||
fCTable = SkNEW_ARGS(SkColorTable, (buffer));
|
||||
} else {
|
||||
fCTable = NULL;
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "SkColorFilterImageFilter.h"
|
||||
#include "SkColorMatrixFilter.h"
|
||||
#include "SkColorShader.h"
|
||||
#include "SkColorTable.h"
|
||||
#include "SkComposeImageFilter.h"
|
||||
#include "SkComposeShader.h"
|
||||
#include "SkCornerPathEffect.h"
|
||||
@ -70,7 +69,6 @@ void SkFlattenable::InitializeFlattenables() {
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorTable)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposePathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect)
|
||||
|
Loading…
Reference in New Issue
Block a user