gfx/skia/trunk/src/gpu/GrPath.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/gpu/GrPath.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +/*
     1.5 + * Copyright 2012 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef GrPath_DEFINED
    1.12 +#define GrPath_DEFINED
    1.13 +
    1.14 +#include "GrResource.h"
    1.15 +#include "GrResourceCache.h"
    1.16 +#include "SkPath.h"
    1.17 +#include "SkRect.h"
    1.18 +#include "SkStrokeRec.h"
    1.19 +
    1.20 +class GrPath : public GrResource {
    1.21 +public:
    1.22 +    SK_DECLARE_INST_COUNT(GrPath);
    1.23 +
    1.24 +    GrPath(GrGpu* gpu, bool isWrapped, const SkPath& skPath, const SkStrokeRec& stroke)
    1.25 +        : INHERITED(gpu, isWrapped),
    1.26 +          fSkPath(skPath),
    1.27 +          fStroke(stroke),
    1.28 +          fBounds(skPath.getBounds()) {
    1.29 +    }
    1.30 +
    1.31 +    static GrResourceKey ComputeKey(const SkPath& path, const SkStrokeRec& stroke);
    1.32 +
    1.33 +    bool isEqualTo(const SkPath& path, const SkStrokeRec& stroke) {
    1.34 +        return fSkPath == path && fStroke == stroke;
    1.35 +    }
    1.36 +
    1.37 +    const SkRect& getBounds() const { return fBounds; }
    1.38 +
    1.39 +    const SkStrokeRec& getStroke() const { return fStroke; }
    1.40 +
    1.41 +protected:
    1.42 +    SkPath fSkPath;
    1.43 +    SkStrokeRec fStroke;
    1.44 +    SkRect fBounds;
    1.45 +
    1.46 +private:
    1.47 +    typedef GrResource INHERITED;
    1.48 +};
    1.49 +
    1.50 +#endif

mercurial