Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: include/utils/SkUnitMappers.h

Issue 25430005: Fix for potential typedef issue Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/images/SkImageRef_GlobalPool.h ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 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 SkUnitMappers_DEFINED 10 #ifndef SkUnitMappers_DEFINED
11 #define SkUnitMappers_DEFINED 11 #define SkUnitMappers_DEFINED
12 12
13 #include "SkUnitMapper.h" 13 #include "SkUnitMapper.h"
14 14
15 /** This discretizes the range [0...1) into N discret values. 15 /** This discretizes the range [0...1) into N discret values.
16 */ 16 */
17 class SkDiscreteMapper : public SkUnitMapper { 17 class SkDiscreteMapper : public SkUnitMapper {
18 typedef SkUnitMapper INHERITED;
19
18 public: 20 public:
19 SkDiscreteMapper(int segments); 21 SkDiscreteMapper(int segments);
20 // override from SkUnitMapper 22 // override from SkUnitMapper
21 virtual uint16_t mapUnit16(uint16_t x); 23 virtual uint16_t mapUnit16(uint16_t x);
22 24
23 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscreteMapper) 25 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscreteMapper)
24 26
25 protected: 27 protected:
26 SkDiscreteMapper(SkFlattenableReadBuffer& ); 28 SkDiscreteMapper(SkFlattenableReadBuffer& );
27 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 29 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
28 30
29 private: 31 private:
30 int fSegments; 32 int fSegments;
31 SkFract fScale; // computed from fSegments 33 SkFract fScale; // computed from fSegments
32
33 typedef SkUnitMapper INHERITED;
34 }; 34 };
35 35
36 /** This returns cos(x), to simulate lighting a sphere, where 0 maps to the 36 /** This returns cos(x), to simulate lighting a sphere, where 0 maps to the
37 center of the sphere, and 1 maps to the edge. 37 center of the sphere, and 1 maps to the edge.
38 */ 38 */
39 class SkCosineMapper : public SkUnitMapper { 39 class SkCosineMapper : public SkUnitMapper {
40 typedef SkUnitMapper INHERITED;
41
40 public: 42 public:
41 SkCosineMapper() {} 43 SkCosineMapper() {}
42 // override from SkUnitMapper 44 // override from SkUnitMapper
43 virtual uint16_t mapUnit16(uint16_t x); 45 virtual uint16_t mapUnit16(uint16_t x);
44 46
45 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCosineMapper) 47 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCosineMapper)
46 48
47 protected: 49 protected:
48 SkCosineMapper(SkFlattenableReadBuffer&); 50 SkCosineMapper(SkFlattenableReadBuffer&);
49
50 private:
51
52 typedef SkUnitMapper INHERITED;
53 }; 51 };
54 52
55 #endif 53 #endif
OLDNEW
« no previous file with comments | « include/images/SkImageRef_GlobalPool.h ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698