diff options
author | mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-09 01:01:38 +0000 |
---|---|---|
committer | mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-09 01:01:38 +0000 |
commit | 22f84008b3149fa4ccb8cd3070e223ff6193fea4 (patch) | |
tree | f2c857cd5a9ada9392ef4e2371890ba7b552ae8c /src | |
parent | efb65de8ab9f62244659a0e7792db98bef9a01b0 (diff) |
privatization of SkPerspIter.h
remove obsolete SkRelay.h
git-svn-id: http://skia.googlecode.com/svn/trunk@5025 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPerspIter.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/core/SkPerspIter.h b/src/core/SkPerspIter.h new file mode 100644 index 0000000000..7f6add289c --- /dev/null +++ b/src/core/SkPerspIter.h @@ -0,0 +1,48 @@ + +/* + * Copyright 2006 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +#ifndef SkPerspIter_DEFINED +#define SkPerspIter_DEFINED + +#include "SkMatrix.h" + +class SkPerspIter { +public: + /** Iterate a line through the matrix [x,y] ... [x+count-1, y]. + @param m The matrix we will be iterating a line through + @param x The initial X coordinate to be mapped through the matrix + @param y The initial Y coordinate to be mapped through the matrix + @param count The number of points (x,y) (x+1,y) (x+2,y) ... we will eventually map + */ + SkPerspIter(const SkMatrix& m, SkScalar x, SkScalar y, int count); + + /** Return the buffer of [x,y] fixed point values we will be filling. + This always returns the same value, so it can be saved across calls to + next(). + */ + const SkFixed* getXY() const { return fStorage; } + + /** Return the number of [x,y] pairs that have been filled in the getXY() buffer. + When this returns 0, the iterator is finished. + */ + int next(); + +private: + enum { + kShift = 4, + kCount = (1 << kShift) + }; + const SkMatrix& fMatrix; + SkFixed fStorage[kCount * 2]; + SkFixed fX, fY; + SkScalar fSX, fSY; + int fCount; +}; + +#endif |