OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrDefaultGeoProcFactory.h" | 8 #include "GrDefaultGeoProcFactory.h" |
9 | 9 |
10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
11 #include "gl/GrGLGeometryProcessor.h" | 11 #include "gl/GrGLGeometryProcessor.h" |
12 #include "gl/builders/GrGLProgramBuilder.h" | 12 #include "gl/builders/GrGLProgramBuilder.h" |
13 | 13 |
14 /* | 14 /* |
15 * The default Geometry Processor simply takes position and multiplies it by the
uniform view | 15 * The default Geometry Processor simply takes position and multiplies it by the
uniform view |
16 * matrix. It also leaves coverage untouched. Behind the scenes, we may add per
vertex color or | 16 * matrix. It also leaves coverage untouched. Behind the scenes, we may add per
vertex color or |
17 * local coords. | 17 * local coords. |
18 */ | 18 */ |
19 typedef GrDefaultGeoProcFactory Flag; | |
20 | |
21 class DefaultGeoProc : public GrGeometryProcessor { | 19 class DefaultGeoProc : public GrGeometryProcessor { |
22 public: | 20 public: |
23 static GrGeometryProcessor* Create(uint32_t gpTypeFlags, | 21 static GrGeometryProcessor* Create(uint32_t gpTypeFlags, |
24 GrColor color, | 22 GrColor color, |
25 const SkMatrix& viewMatrix, | 23 const SkMatrix& viewMatrix, |
26 const SkMatrix& localMatrix, | 24 const SkMatrix& localMatrix, |
27 bool localCoordsWillBeRead, | 25 bool localCoordsWillBeRead, |
28 bool coverageWillBeIgnored, | 26 bool coverageWillBeIgnored, |
29 uint8_t coverage) { | 27 uint8_t coverage) { |
30 return SkNEW_ARGS(DefaultGeoProc, (gpTypeFlags, | 28 return SkNEW_ARGS(DefaultGeoProc, (gpTypeFlags, |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 return NULL; | 309 return NULL; |
312 } | 310 } |
313 | 311 |
314 if (localCoords.hasLocalMatrix()) { | 312 if (localCoords.hasLocalMatrix()) { |
315 invert.preConcat(*localCoords.fMatrix); | 313 invert.preConcat(*localCoords.fMatrix); |
316 } | 314 } |
317 | 315 |
318 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); | 316 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); |
319 return Create(color, coverage, inverted); | 317 return Create(color, coverage, inverted); |
320 } | 318 } |
OLD | NEW |