| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 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 | 8 |
| 9 | 9 |
| 10 #ifndef SkUnitMapper_DEFINED | 10 #ifndef SkUnitMapper_DEFINED |
| 11 #define SkUnitMapper_DEFINED | 11 #define SkUnitMapper_DEFINED |
| 12 | 12 |
| 13 #include "SkRefCnt.h" | 13 #include "SkRefCnt.h" |
| 14 #include "SkScalar.h" | 14 #include "SkScalar.h" |
| 15 | 15 |
| 16 #include "SkFlattenable.h" | 16 #include "SkFlattenable.h" |
| 17 | 17 |
| 18 class SkUnitMapper : public SkFlattenable { | 18 class SkUnitMapper : public SkFlattenable { |
| 19 public: | 19 public: |
| 20 SK_DECLARE_INST_COUNT(SkUnitMapper) | 20 SK_DECLARE_INST_COUNT(SkUnitMapper) |
| 21 | 21 |
| 22 SkUnitMapper() {} | 22 SkUnitMapper() {} |
| 23 | 23 |
| 24 /** Given a value in [0..0xFFFF], return a value in the same range. | 24 /** Given a value in [0..0xFFFF], return a value in the same range. |
| 25 */ | 25 */ |
| 26 virtual uint16_t mapUnit16(uint16_t x) = 0; | 26 virtual uint16_t mapUnit16(uint16_t x) = 0; |
| 27 | 27 |
| 28 SK_DEFINE_FLATTENABLE_TYPE(SkUnitMapper) |
| 29 |
| 28 protected: | 30 protected: |
| 29 SkUnitMapper(SkFlattenableReadBuffer& rb) : SkFlattenable(rb) {} | 31 SkUnitMapper(SkFlattenableReadBuffer& rb) : SkFlattenable(rb) {} |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 typedef SkFlattenable INHERITED; | 34 typedef SkFlattenable INHERITED; |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 #endif | 37 #endif |
| OLD | NEW |