michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkUnitMapper_DEFINED michael@0: #define SkUnitMapper_DEFINED michael@0: michael@0: #include "SkRefCnt.h" michael@0: #include "SkScalar.h" michael@0: michael@0: #include "SkFlattenable.h" michael@0: michael@0: class SkUnitMapper : public SkFlattenable { michael@0: public: michael@0: SK_DECLARE_INST_COUNT(SkUnitMapper) michael@0: michael@0: SkUnitMapper() {} michael@0: michael@0: /** Given a value in [0..0xFFFF], return a value in the same range. michael@0: */ michael@0: virtual uint16_t mapUnit16(uint16_t x) = 0; michael@0: michael@0: SK_DEFINE_FLATTENABLE_TYPE(SkUnitMapper) michael@0: michael@0: protected: michael@0: SkUnitMapper(SkReadBuffer& rb) : SkFlattenable(rb) {} michael@0: michael@0: private: michael@0: typedef SkFlattenable INHERITED; michael@0: }; michael@0: michael@0: #endif