gfx/skia/trunk/src/core/SkPerspIter.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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  */
    10 #ifndef SkPerspIter_DEFINED
    11 #define SkPerspIter_DEFINED
    13 #include "SkMatrix.h"
    15 class SkPerspIter {
    16 public:
    17     /** Iterate a line through the matrix [x,y] ... [x+count-1, y].
    18         @param m    The matrix we will be iterating a line through
    19         @param x    The initial X coordinate to be mapped through the matrix
    20         @param y    The initial Y coordinate to be mapped through the matrix
    21         @param count The number of points (x,y) (x+1,y) (x+2,y) ... we will eventually map
    22     */
    23     SkPerspIter(const SkMatrix& m, SkScalar x, SkScalar y, int count);
    25     /** Return the buffer of [x,y] fixed point values we will be filling.
    26         This always returns the same value, so it can be saved across calls to
    27         next().
    28     */
    29     const SkFixed* getXY() const { return fStorage; }
    31     /** Return the number of [x,y] pairs that have been filled in the getXY() buffer.
    32         When this returns 0, the iterator is finished.
    33     */
    34     int next();
    36 private:
    37     enum {
    38         kShift  = 4,
    39         kCount  = (1 << kShift)
    40     };
    41     const SkMatrix& fMatrix;
    42     SkFixed         fStorage[kCount * 2];
    43     SkFixed         fX, fY;
    44     SkScalar        fSX, fSY;
    45     int             fCount;
    46 };
    48 #endif

mercurial