Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | |
michael@0 | 2 | /* |
michael@0 | 3 | * Copyright 2011 Google Inc. |
michael@0 | 4 | * |
michael@0 | 5 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 6 | * found in the LICENSE file. |
michael@0 | 7 | */ |
michael@0 | 8 | #ifndef SkEdgeBuilder_DEFINED |
michael@0 | 9 | #define SkEdgeBuilder_DEFINED |
michael@0 | 10 | |
michael@0 | 11 | #include "SkChunkAlloc.h" |
michael@0 | 12 | #include "SkRect.h" |
michael@0 | 13 | #include "SkTDArray.h" |
michael@0 | 14 | |
michael@0 | 15 | struct SkEdge; |
michael@0 | 16 | class SkEdgeClipper; |
michael@0 | 17 | class SkPath; |
michael@0 | 18 | |
michael@0 | 19 | class SkEdgeBuilder { |
michael@0 | 20 | public: |
michael@0 | 21 | SkEdgeBuilder(); |
michael@0 | 22 | |
michael@0 | 23 | // returns the number of built edges. The array of those edge pointers |
michael@0 | 24 | // is returned from edgeList(). |
michael@0 | 25 | int build(const SkPath& path, const SkIRect* clip, int shiftUp); |
michael@0 | 26 | |
michael@0 | 27 | SkEdge** edgeList() { return fEdgeList; } |
michael@0 | 28 | |
michael@0 | 29 | private: |
michael@0 | 30 | SkChunkAlloc fAlloc; |
michael@0 | 31 | SkTDArray<SkEdge*> fList; |
michael@0 | 32 | |
michael@0 | 33 | /* |
michael@0 | 34 | * If we're in general mode, we allcoate the pointers in fList, and this |
michael@0 | 35 | * will point at fList.begin(). If we're in polygon mode, fList will be |
michael@0 | 36 | * empty, as we will have preallocated room for the pointers in fAlloc's |
michael@0 | 37 | * block, and fEdgeList will point into that. |
michael@0 | 38 | */ |
michael@0 | 39 | SkEdge** fEdgeList; |
michael@0 | 40 | |
michael@0 | 41 | int fShiftUp; |
michael@0 | 42 | |
michael@0 | 43 | public: |
michael@0 | 44 | void addLine(const SkPoint pts[]); |
michael@0 | 45 | void addQuad(const SkPoint pts[]); |
michael@0 | 46 | void addCubic(const SkPoint pts[]); |
michael@0 | 47 | void addClipper(SkEdgeClipper*); |
michael@0 | 48 | |
michael@0 | 49 | int buildPoly(const SkPath& path, const SkIRect* clip, int shiftUp); |
michael@0 | 50 | }; |
michael@0 | 51 | |
michael@0 | 52 | #endif |