diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /gfx/skia/skia/src/core/SkEdgeBuilder.h | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/skia/skia/src/core/SkEdgeBuilder.h')
-rw-r--r-- | gfx/skia/skia/src/core/SkEdgeBuilder.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gfx/skia/skia/src/core/SkEdgeBuilder.h b/gfx/skia/skia/src/core/SkEdgeBuilder.h new file mode 100644 index 000000000..59f62870e --- /dev/null +++ b/gfx/skia/skia/src/core/SkEdgeBuilder.h @@ -0,0 +1,60 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +#ifndef SkEdgeBuilder_DEFINED +#define SkEdgeBuilder_DEFINED + +#include "SkChunkAlloc.h" +#include "SkRect.h" +#include "SkTDArray.h" + +struct SkEdge; +class SkEdgeClipper; +class SkPath; + +class SkEdgeBuilder { +public: + SkEdgeBuilder(); + + // returns the number of built edges. The array of those edge pointers + // is returned from edgeList(). + int build(const SkPath& path, const SkIRect* clip, int shiftUp, bool clipToTheRight); + + SkEdge** edgeList() { return fEdgeList; } + +private: + enum Combine { + kNo_Combine, + kPartial_Combine, + kTotal_Combine + }; + + static Combine CombineVertical(const SkEdge* edge, SkEdge* last); + Combine checkVertical(const SkEdge* edge, SkEdge** edgePtr); + + SkChunkAlloc fAlloc; + SkTDArray<SkEdge*> fList; + + /* + * If we're in general mode, we allcoate the pointers in fList, and this + * will point at fList.begin(). If we're in polygon mode, fList will be + * empty, as we will have preallocated room for the pointers in fAlloc's + * block, and fEdgeList will point into that. + */ + SkEdge** fEdgeList; + + int fShiftUp; + +public: + void addLine(const SkPoint pts[]); + void addQuad(const SkPoint pts[]); + void addCubic(const SkPoint pts[]); + void addClipper(SkEdgeClipper*); + + int buildPoly(const SkPath& path, const SkIRect* clip, int shiftUp, bool clipToTheRight); +}; + +#endif |