blob: 46f6eddd709e0238b9b060d2ca6ae5da9ebe9025 [file] [log] [blame]
commit-bot@chromium.org3339ac52014-05-22 02:55:59 +00001
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SkUnitMapper_DEFINED
11#define SkUnitMapper_DEFINED
12
13#include "SkRefCnt.h"
14#include "SkScalar.h"
15
16#include "SkFlattenable.h"
17
18class SkUnitMapper : public SkFlattenable {
19public:
20 SK_DECLARE_INST_COUNT(SkUnitMapper)
21
22 SkUnitMapper() {}
23
24 /** Given a value in [0..0xFFFF], return a value in the same range.
25 */
26 virtual uint16_t mapUnit16(uint16_t x) = 0;
27
28 SK_DEFINE_FLATTENABLE_TYPE(SkUnitMapper)
29
30protected:
31 SkUnitMapper(SkReadBuffer& rb) : SkFlattenable(rb) {}
32
33private:
34 typedef SkFlattenable INHERITED;
35};
36
37#endif