Change GrDefaultGeoProcFactory to a namespace

BUG=skia:

Review URL: https://codereview.chromium.org/1257333002
This commit is contained in:
joshualitt 2015-07-28 10:20:08 -07:00 committed by Commit bot
parent 0d986d877e
commit 7a0d697ed6
3 changed files with 18 additions and 23 deletions

View File

@ -16,8 +16,6 @@
* matrix. It also leaves coverage untouched. Behind the scenes, we may add per vertex color or
* local coords.
*/
typedef GrDefaultGeoProcFactory Flag;
class DefaultGeoProc : public GrGeometryProcessor {
public:
static GrGeometryProcessor* Create(uint32_t gpTypeFlags,

View File

@ -18,8 +18,7 @@ class GrDrawState;
* used in the creation of optimized draw states because adding default GPs to the drawstate can
* interfere with batching due to updating the drawstate.
*/
class GrDefaultGeoProcFactory {
public:
namespace GrDefaultGeoProcFactory {
// Structs for adding vertex attributes
struct PositionAttr {
SkPoint fPosition;
@ -125,31 +124,31 @@ public:
const SkMatrix* fMatrix;
};
static const GrGeometryProcessor* Create(const Color&,
const Coverage&,
const LocalCoords&,
const SkMatrix& viewMatrix = SkMatrix::I());
const GrGeometryProcessor* Create(const Color&,
const Coverage&,
const LocalCoords&,
const SkMatrix& viewMatrix = SkMatrix::I());
/*
* Use this factory to create a GrGeometryProcessor that expects a device space vertex position
* attribute. The view matrix must still be provided to compute correctly transformed
* coordinates for GrFragmentProcessors. It may fail if the view matrix is not invertible.
*/
static const GrGeometryProcessor* CreateForDeviceSpace(const Color&,
const Coverage&,
const LocalCoords&,
const SkMatrix& viewMatrix);
const GrGeometryProcessor* CreateForDeviceSpace(const Color&,
const Coverage&,
const LocalCoords&,
const SkMatrix& viewMatrix);
// TODO deprecate this
static const GrGeometryProcessor* Create(uint32_t gpTypeFlags,
GrColor,
bool localCoordsWillBeRead,
bool coverageWillBeIgnored,
const SkMatrix& viewMatrix = SkMatrix::I(),
const SkMatrix& localMatrix = SkMatrix::I(),
uint8_t coverage = 0xff);
const GrGeometryProcessor* Create(uint32_t gpTypeFlags,
GrColor,
bool localCoordsWillBeRead,
bool coverageWillBeIgnored,
const SkMatrix& viewMatrix = SkMatrix::I(),
const SkMatrix& localMatrix = SkMatrix::I(),
uint8_t coverage = 0xff);
static size_t DefaultVertexStride() { return sizeof(PositionAttr); }
inline size_t DefaultVertexStride() { return sizeof(PositionAttr); }
};
#endif

View File

@ -175,9 +175,7 @@ private:
The vertex attrib order is always pos, color, [local coords].
*/
const GrGeometryProcessor* createRectGP() {
typedef GrDefaultGeoProcFactory::Color Color;
typedef GrDefaultGeoProcFactory::Coverage Coverage;
typedef GrDefaultGeoProcFactory::LocalCoords LocalCoords;
using namespace GrDefaultGeoProcFactory;
Color color(Color::kAttribute_Type);
Coverage coverage(this->coverageIgnored() ? Coverage::kNone_Type : Coverage::kSolid_Type);