1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/core/SkUnitMapper.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2006 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#ifndef SkUnitMapper_DEFINED 1.14 +#define SkUnitMapper_DEFINED 1.15 + 1.16 +#include "SkRefCnt.h" 1.17 +#include "SkScalar.h" 1.18 + 1.19 +#include "SkFlattenable.h" 1.20 + 1.21 +class SkUnitMapper : public SkFlattenable { 1.22 +public: 1.23 + SK_DECLARE_INST_COUNT(SkUnitMapper) 1.24 + 1.25 + SkUnitMapper() {} 1.26 + 1.27 + /** Given a value in [0..0xFFFF], return a value in the same range. 1.28 + */ 1.29 + virtual uint16_t mapUnit16(uint16_t x) = 0; 1.30 + 1.31 + SK_DEFINE_FLATTENABLE_TYPE(SkUnitMapper) 1.32 + 1.33 +protected: 1.34 + SkUnitMapper(SkReadBuffer& rb) : SkFlattenable(rb) {} 1.35 + 1.36 +private: 1.37 + typedef SkFlattenable INHERITED; 1.38 +}; 1.39 + 1.40 +#endif