blob: a4f7d0cdd9d0916ca468eccad172f7db3de2aae0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GrPathRenderer.h"
GrPathRenderer::GrPathRenderer()
: fPath(NULL)
, fTarget(NULL) {
}
void GrPathRenderer::setPath(GrDrawTarget* target,
const SkPath* path,
GrPathFill fill,
bool antiAlias,
const GrPoint* translate) {
GrAssert(NULL == fPath);
GrAssert(NULL == fTarget);
GrAssert(NULL != target);
fTarget = target;
fPath = path;
fFill = fill;
fAntiAlias = antiAlias;
if (NULL != translate) {
fTranslate = *translate;
} else {
fTranslate.fX = fTranslate.fY = 0;
}
this->pathWasSet();
}
void GrPathRenderer::clearPath() {
this->pathWillClear();
fTarget->resetVertexSource();
fTarget->resetIndexSource();
fTarget = NULL;
fPath = NULL;
}
|