aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 20:51:20 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 20:51:20 +0000
commit47059542e7aa153926377456a6c611e55c8e428c (patch)
treea5db22e37f7dc732b5e993c79f48f5f52b51cd9e
parentcb7be694c31f833c00a0dfb3529aaead3a4db62d (diff)
Search and replace change. Some Gr enum value names didn't have a "Gr" in their suffix.
Verbal LGTM from TomH git-svn-id: http://skia.googlecode.com/svn/trunk@4198 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--gm/texdata.cpp4
-rw-r--r--include/gpu/GrPaint.h4
-rw-r--r--include/gpu/GrTypes.h112
-rw-r--r--include/gpu/SkGr.h20
-rw-r--r--src/gpu/GrAAConvexPathRenderer.cpp4
-rw-r--r--src/gpu/GrAAHairLinePathRenderer.cpp6
-rw-r--r--src/gpu/GrClipMaskManager.cpp44
-rw-r--r--src/gpu/GrContext.cpp22
-rw-r--r--src/gpu/GrDefaultPathRenderer.cpp28
-rw-r--r--src/gpu/GrDefaultTextContext.cpp10
-rw-r--r--src/gpu/GrDrawState.h28
-rw-r--r--src/gpu/GrDrawTarget.cpp58
-rw-r--r--src/gpu/GrGpu.h12
-rw-r--r--src/gpu/GrInOrderDrawBuffer.cpp4
-rw-r--r--src/gpu/GrIndexBuffer.h2
-rw-r--r--src/gpu/GrPathRenderer.h2
-rw-r--r--src/gpu/GrSoftwarePathRenderer.cpp10
-rw-r--r--src/gpu/SkGpuDevice.cpp50
-rw-r--r--src/gpu/SkGr.cpp10
-rw-r--r--src/gpu/gl/GrGLProgram.cpp2
-rw-r--r--src/gpu/gl/GrGpuGL.cpp62
-rw-r--r--src/gpu/gl/GrGpuGL.h4
-rw-r--r--src/gpu/gl/GrGpuGL_program.cpp8
23 files changed, 254 insertions, 252 deletions
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index 1fdae69bd3..b62aad067c 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -96,8 +96,8 @@ protected:
GrPaint paint;
paint.reset();
paint.fColor = 0xffffffff;
- paint.fSrcBlendCoeff = kOne_BlendCoeff;
- paint.fDstBlendCoeff = kISA_BlendCoeff;
+ paint.fSrcBlendCoeff = kOne_GrBlendCoeff;
+ paint.fDstBlendCoeff = kISA_GrBlendCoeff;
GrMatrix vm;
if (i) {
vm.setRotate(90 * SK_Scalar1,
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 62ab164275..729f6f060e 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -237,8 +237,8 @@ private:
GrTexture* fMaskTextures[kMaxMasks];
void resetBlend() {
- fSrcBlendCoeff = kOne_BlendCoeff;
- fDstBlendCoeff = kZero_BlendCoeff;
+ fSrcBlendCoeff = kOne_GrBlendCoeff;
+ fDstBlendCoeff = kZero_GrBlendCoeff;
}
void resetOptions() {
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 4b17f9451d..c3f659c6c6 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -203,46 +203,46 @@ typedef int GrVertexLayout;
* Geometric primitives used for drawing.
*/
enum GrPrimitiveType {
- kTriangles_PrimitiveType,
- kTriangleStrip_PrimitiveType,
- kTriangleFan_PrimitiveType,
- kPoints_PrimitiveType,
- kLines_PrimitiveType, // 1 pix wide only
- kLineStrip_PrimitiveType // 1 pix wide only
+ kTriangles_GrPrimitiveType,
+ kTriangleStrip_GrPrimitiveType,
+ kTriangleFan_GrPrimitiveType,
+ kPoints_GrPrimitiveType,
+ kLines_GrPrimitiveType, // 1 pix wide only
+ kLineStrip_GrPrimitiveType // 1 pix wide only
};
static inline bool GrIsPrimTypeLines(GrPrimitiveType type) {
- return kLines_PrimitiveType == type || kLineStrip_PrimitiveType == type;
+ return kLines_GrPrimitiveType == type || kLineStrip_GrPrimitiveType == type;
}
static inline bool GrIsPrimTypeTris(GrPrimitiveType type) {
- return kTriangles_PrimitiveType == type ||
- kTriangleStrip_PrimitiveType == type ||
- kTriangleFan_PrimitiveType == type;
+ return kTriangles_GrPrimitiveType == type ||
+ kTriangleStrip_GrPrimitiveType == type ||
+ kTriangleFan_GrPrimitiveType == type;
}
/**
* Coeffecients for alpha-blending.
*/
enum GrBlendCoeff {
- kInvalid_BlendCoeff = -1,
-
- kZero_BlendCoeff, //<! 0
- kOne_BlendCoeff, //<! 1
- kSC_BlendCoeff, //<! src color
- kISC_BlendCoeff, //<! one minus src color
- kDC_BlendCoeff, //<! dst color
- kIDC_BlendCoeff, //<! one minus dst color
- kSA_BlendCoeff, //<! src alpha
- kISA_BlendCoeff, //<! one minus src alpha
- kDA_BlendCoeff, //<! dst alpha
- kIDA_BlendCoeff, //<! one minus dst alpha
- kConstC_BlendCoeff, //<! constant color
- kIConstC_BlendCoeff, //<! one minus constant color
- kConstA_BlendCoeff, //<! constant color alpha
- kIConstA_BlendCoeff, //<! one minus constant color alpha
-
- kPublicBlendCoeffCount
+ kInvalid_GrBlendCoeff = -1,
+
+ kZero_GrBlendCoeff, //<! 0
+ kOne_GrBlendCoeff, //<! 1
+ kSC_GrBlendCoeff, //<! src color
+ kISC_GrBlendCoeff, //<! one minus src color
+ kDC_GrBlendCoeff, //<! dst color
+ kIDC_GrBlendCoeff, //<! one minus dst color
+ kSA_GrBlendCoeff, //<! src alpha
+ kISA_GrBlendCoeff, //<! one minus src alpha
+ kDA_GrBlendCoeff, //<! dst alpha
+ kIDA_GrBlendCoeff, //<! one minus dst alpha
+ kConstC_GrBlendCoeff, //<! constant color
+ kIConstC_GrBlendCoeff, //<! one minus constant color
+ kConstA_GrBlendCoeff, //<! constant color alpha
+ kIConstA_GrBlendCoeff, //<! one minus constant color alpha
+
+ kPublicGrBlendCoeffCount
};
/**
@@ -528,46 +528,46 @@ static int inline NumPathCmdPoints(GrPathCmd cmd) {
* Path filling rules
*/
enum GrPathFill {
- kWinding_PathFill,
- kEvenOdd_PathFill,
- kInverseWinding_PathFill,
- kInverseEvenOdd_PathFill,
- kHairLine_PathFill,
+ kWinding_GrPathFill,
+ kEvenOdd_GrPathFill,
+ kInverseWinding_GrPathFill,
+ kInverseEvenOdd_GrPathFill,
+ kHairLine_GrPathFill,
- kPathFillCount
+ kGrPathFillCount
};
static inline GrPathFill GrNonInvertedFill(GrPathFill fill) {
static const GrPathFill gNonInvertedFills[] = {
- kWinding_PathFill, // kWinding_PathFill
- kEvenOdd_PathFill, // kEvenOdd_PathFill
- kWinding_PathFill, // kInverseWinding_PathFill
- kEvenOdd_PathFill, // kInverseEvenOdd_PathFill
- kHairLine_PathFill,// kHairLine_PathFill
+ kWinding_GrPathFill, // kWinding_GrPathFill
+ kEvenOdd_GrPathFill, // kEvenOdd_GrPathFill
+ kWinding_GrPathFill, // kInverseWinding_GrPathFill
+ kEvenOdd_GrPathFill, // kInverseEvenOdd_GrPathFill
+ kHairLine_GrPathFill,// kHairLine_GrPathFill
};
- GR_STATIC_ASSERT(0 == kWinding_PathFill);
- GR_STATIC_ASSERT(1 == kEvenOdd_PathFill);
- GR_STATIC_ASSERT(2 == kInverseWinding_PathFill);
- GR_STATIC_ASSERT(3 == kInverseEvenOdd_PathFill);
- GR_STATIC_ASSERT(4 == kHairLine_PathFill);
- GR_STATIC_ASSERT(5 == kPathFillCount);
+ GR_STATIC_ASSERT(0 == kWinding_GrPathFill);
+ GR_STATIC_ASSERT(1 == kEvenOdd_GrPathFill);
+ GR_STATIC_ASSERT(2 == kInverseWinding_GrPathFill);
+ GR_STATIC_ASSERT(3 == kInverseEvenOdd_GrPathFill);
+ GR_STATIC_ASSERT(4 == kHairLine_GrPathFill);
+ GR_STATIC_ASSERT(5 == kGrPathFillCount);
return gNonInvertedFills[fill];
}
static inline bool GrIsFillInverted(GrPathFill fill) {
static const bool gIsFillInverted[] = {
- false, // kWinding_PathFill
- false, // kEvenOdd_PathFill
- true, // kInverseWinding_PathFill
- true, // kInverseEvenOdd_PathFill
- false, // kHairLine_PathFill
+ false, // kWinding_GrPathFill
+ false, // kEvenOdd_GrPathFill
+ true, // kInverseWinding_GrPathFill
+ true, // kInverseEvenOdd_GrPathFill
+ false, // kHairLine_GrPathFill
};
- GR_STATIC_ASSERT(0 == kWinding_PathFill);
- GR_STATIC_ASSERT(1 == kEvenOdd_PathFill);
- GR_STATIC_ASSERT(2 == kInverseWinding_PathFill);
- GR_STATIC_ASSERT(3 == kInverseEvenOdd_PathFill);
- GR_STATIC_ASSERT(4 == kHairLine_PathFill);
- GR_STATIC_ASSERT(5 == kPathFillCount);
+ GR_STATIC_ASSERT(0 == kWinding_GrPathFill);
+ GR_STATIC_ASSERT(1 == kEvenOdd_GrPathFill);
+ GR_STATIC_ASSERT(2 == kInverseWinding_GrPathFill);
+ GR_STATIC_ASSERT(3 == kInverseEvenOdd_GrPathFill);
+ GR_STATIC_ASSERT(4 == kHairLine_GrPathFill);
+ GR_STATIC_ASSERT(5 == kGrPathFillCount);
return gIsFillInverted[fill];
}
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 8780104f10..1a5cc936c3 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -42,16 +42,16 @@ GR_STATIC_ASSERT((int)GrSamplerState::kMirror_WrapMode ==
#define sk_tile_mode_to_grwrap(X) ((GrSamplerState::WrapMode)(X))
-GR_STATIC_ASSERT((int)kZero_BlendCoeff == (int)SkXfermode::kZero_Coeff);
-GR_STATIC_ASSERT((int)kOne_BlendCoeff == (int)SkXfermode::kOne_Coeff);
-GR_STATIC_ASSERT((int)kSC_BlendCoeff == (int)SkXfermode::kSC_Coeff);
-GR_STATIC_ASSERT((int)kISC_BlendCoeff == (int)SkXfermode::kISC_Coeff);
-GR_STATIC_ASSERT((int)kDC_BlendCoeff == (int)SkXfermode::kDC_Coeff);
-GR_STATIC_ASSERT((int)kIDC_BlendCoeff == (int)SkXfermode::kIDC_Coeff);
-GR_STATIC_ASSERT((int)kSA_BlendCoeff == (int)SkXfermode::kSA_Coeff);
-GR_STATIC_ASSERT((int)kISA_BlendCoeff == (int)SkXfermode::kISA_Coeff);
-GR_STATIC_ASSERT((int)kDA_BlendCoeff == (int)SkXfermode::kDA_Coeff);
-GR_STATIC_ASSERT((int)kIDA_BlendCoeff == (int)SkXfermode::kIDA_Coeff);
+GR_STATIC_ASSERT((int)kZero_GrBlendCoeff == (int)SkXfermode::kZero_Coeff);
+GR_STATIC_ASSERT((int)kOne_GrBlendCoeff == (int)SkXfermode::kOne_Coeff);
+GR_STATIC_ASSERT((int)kSC_GrBlendCoeff == (int)SkXfermode::kSC_Coeff);
+GR_STATIC_ASSERT((int)kISC_GrBlendCoeff == (int)SkXfermode::kISC_Coeff);
+GR_STATIC_ASSERT((int)kDC_GrBlendCoeff == (int)SkXfermode::kDC_Coeff);
+GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff);
+GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff);
+GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff);
+GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff);
+GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff);
#define sk_blend_to_grblend(X) ((GrBlendCoeff)(X))
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index ca7ecdcb4a..74b26085f0 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -435,7 +435,7 @@ bool GrAAConvexPathRenderer::canDrawPath(const SkPath& path,
const GrDrawTarget* target,
bool antiAlias) const {
if (!target->getCaps().fShaderDerivativeSupport || !antiAlias ||
- kHairLine_PathFill == fill || GrIsFillInverted(fill) ||
+ kHairLine_GrPathFill == fill || GrIsFillInverted(fill) ||
!path.isConvex()) {
return false;
} else {
@@ -511,7 +511,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath,
create_vertices(segments, fanPt, verts, idxs);
drawState->setVertexEdgeType(GrDrawState::kQuad_EdgeType);
- target->drawIndexed(kTriangles_PrimitiveType,
+ target->drawIndexed(kTriangles_GrPrimitiveType,
0, // start vertex
0, // start index
vCount,
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 701bf3a08d..3893b9d701 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -578,7 +578,7 @@ bool GrAAHairLinePathRenderer::canDrawPath(const SkPath& path,
GrPathFill fill,
const GrDrawTarget* target,
bool antiAlias) const {
- if (fill != kHairLine_PathFill || !antiAlias) {
+ if (fill != kHairLine_GrPathFill || !antiAlias) {
return false;
}
@@ -635,7 +635,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
while (lines < lineCnt) {
int n = GrMin(lineCnt - lines, nBufLines);
drawState->setVertexEdgeType(GrDrawState::kHairLine_EdgeType);
- target->drawIndexed(kTriangles_PrimitiveType,
+ target->drawIndexed(kTriangles_GrPrimitiveType,
kVertsPerLineSeg*lines, // startV
0, // startI
kVertsPerLineSeg*n, // vCount
@@ -648,7 +648,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
while (quads < quadCnt) {
int n = GrMin(quadCnt - quads, kNumQuadsInIdxBuffer);
drawState->setVertexEdgeType(GrDrawState::kHairQuad_EdgeType);
- target->drawIndexed(kTriangles_PrimitiveType,
+ target->drawIndexed(kTriangles_GrPrimitiveType,
4 * lineCnt + kVertsPerQuad*quads, // startV
0, // startI
kVertsPerQuad*n, // vCount
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index e31b5f3466..c0272bbd5d 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -102,7 +102,7 @@ bool GrClipMaskManager::useSWOnlyPath(GrGpu* gpu, const GrClip& clipIn) {
// that need to be checked here
if (clipIn.getDoAA(i)) {
// Antialiased rects are converted to paths and then drawn with
- // kEvenOdd_PathFill.
+ // kEvenOdd_GrPathFill.
// TODO: wrap GrContext::fillAARect in a helper class and
// draw AA rects directly rather than converting to paths
@@ -110,7 +110,7 @@ bool GrClipMaskManager::useSWOnlyPath(GrGpu* gpu, const GrClip& clipIn) {
temp.addRect(clipIn.getRect(i));
if (path_needs_SW_renderer(this->getContext(), gpu, temp,
- kEvenOdd_PathFill, true)) {
+ kEvenOdd_GrPathFill, true)) {
useSW = true;
}
}
@@ -361,22 +361,22 @@ void setup_boolean_blendcoeffs(GrDrawState* drawState, SkRegion::Op op) {
switch (op) {
case SkRegion::kReplace_Op:
- drawState->setBlendFunc(kOne_BlendCoeff, kZero_BlendCoeff);
+ drawState->setBlendFunc(kOne_GrBlendCoeff, kZero_GrBlendCoeff);
break;
case SkRegion::kIntersect_Op:
- drawState->setBlendFunc(kDC_BlendCoeff, kZero_BlendCoeff);
+ drawState->setBlendFunc(kDC_GrBlendCoeff, kZero_GrBlendCoeff);
break;
case SkRegion::kUnion_Op:
- drawState->setBlendFunc(kOne_BlendCoeff, kISC_BlendCoeff);
+ drawState->setBlendFunc(kOne_GrBlendCoeff, kISC_GrBlendCoeff);
break;
case SkRegion::kXOR_Op:
- drawState->setBlendFunc(kIDC_BlendCoeff, kISC_BlendCoeff);
+ drawState->setBlendFunc(kIDC_GrBlendCoeff, kISC_GrBlendCoeff);
break;
case SkRegion::kDifference_Op:
- drawState->setBlendFunc(kZero_BlendCoeff, kISC_BlendCoeff);
+ drawState->setBlendFunc(kZero_GrBlendCoeff, kISC_GrBlendCoeff);
break;
case SkRegion::kReverseDifference_Op:
- drawState->setBlendFunc(kIDC_BlendCoeff, kZero_BlendCoeff);
+ drawState->setBlendFunc(kIDC_GrBlendCoeff, kZero_GrBlendCoeff);
break;
default:
GrAssert(false);
@@ -419,7 +419,7 @@ bool GrClipMaskManager::drawClipShape(GrGpu* gpu,
temp.addRect(clipIn.getRect(index));
return draw_path(this->getContext(), gpu, temp,
- kEvenOdd_PathFill, clipIn.getDoAA(index));
+ kEvenOdd_GrPathFill, clipIn.getDoAA(index));
} else {
gpu->drawSimpleRect(clipIn.getRect(index), NULL, 0);
}
@@ -771,7 +771,7 @@ bool GrClipMaskManager::createStencilClipMask(GrGpu* gpu,
const SkPath* clipPath = NULL;
if (kRect_ClipType == clipCopy.getElementType(c)) {
canRenderDirectToStencil = true;
- fill = kEvenOdd_PathFill;
+ fill = kEvenOdd_GrPathFill;
fillInverted = false;
// there is no point in intersecting a screen filling
// rectangle.
@@ -960,18 +960,18 @@ namespace {
GrPathFill invert_fill(GrPathFill fill) {
static const GrPathFill gInvertedFillTable[] = {
- kInverseWinding_PathFill, // kWinding_PathFill
- kInverseEvenOdd_PathFill, // kEvenOdd_PathFill
- kWinding_PathFill, // kInverseWinding_PathFill
- kEvenOdd_PathFill, // kInverseEvenOdd_PathFill
- kHairLine_PathFill, // kHairLine_PathFill
+ kInverseWinding_GrPathFill, // kWinding_GrPathFill
+ kInverseEvenOdd_GrPathFill, // kEvenOdd_GrPathFill
+ kWinding_GrPathFill, // kInverseWinding_GrPathFill
+ kEvenOdd_GrPathFill, // kInverseEvenOdd_GrPathFill
+ kHairLine_GrPathFill, // kHairLine_GrPathFill
};
- GR_STATIC_ASSERT(0 == kWinding_PathFill);
- GR_STATIC_ASSERT(1 == kEvenOdd_PathFill);
- GR_STATIC_ASSERT(2 == kInverseWinding_PathFill);
- GR_STATIC_ASSERT(3 == kInverseEvenOdd_PathFill);
- GR_STATIC_ASSERT(4 == kHairLine_PathFill);
- GR_STATIC_ASSERT(5 == kPathFillCount);
+ GR_STATIC_ASSERT(0 == kWinding_GrPathFill);
+ GR_STATIC_ASSERT(1 == kEvenOdd_GrPathFill);
+ GR_STATIC_ASSERT(2 == kInverseWinding_GrPathFill);
+ GR_STATIC_ASSERT(3 == kInverseEvenOdd_GrPathFill);
+ GR_STATIC_ASSERT(4 == kHairLine_GrPathFill);
+ GR_STATIC_ASSERT(5 == kGrPathFillCount);
return gInvertedFillTable[fill];
}
@@ -1038,7 +1038,7 @@ bool GrClipMaskManager::createSoftwareClipMask(GrGpu* gpu,
temp.addRect(clipIn.getRect(i));
helper.draw(temp, SkRegion::kReplace_Op,
- kInverseEvenOdd_PathFill, clipIn.getDoAA(i),
+ kInverseEvenOdd_GrPathFill, clipIn.getDoAA(i),
0x00000000);
} else {
GrAssert(kPath_ClipType == clipIn.getElementType(i));
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index bbca09ac58..1c55ecf627 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -394,7 +394,7 @@ GrContext::TextureCacheEntry GrContext::createAndLockTexture(
texture->height(),
2*sizeof(GrPoint));
verts[1].setIRectFan(0, 0, 1, 1, 2*sizeof(GrPoint));
- fGpu->drawNonIndexed(kTriangleFan_PrimitiveType,
+ fGpu->drawNonIndexed(kTriangleFan_GrPrimitiveType,
0, 4);
entry.set(fTextureCache->createAndLock(resourceKey, texture));
}
@@ -800,7 +800,7 @@ void GrContext::fillAARect(GrDrawTarget* target,
target->setIndexSourceToBuffer(indexBuffer);
- target->drawIndexed(kTriangles_PrimitiveType, 0,
+ target->drawIndexed(kTriangles_GrPrimitiveType, 0,
0, 8, this->aaFillRectIndexCount());
}
@@ -874,7 +874,7 @@ void GrContext::strokeAARect(GrDrawTarget* target,
}
target->setIndexSourceToBuffer(indexBuffer);
- target->drawIndexed(kTriangles_PrimitiveType,
+ target->drawIndexed(kTriangles_GrPrimitiveType,
0, 0, 16, aaStrokeRectIndexCount());
}
@@ -1002,12 +1002,12 @@ void GrContext::drawRect(const GrPaint& paint,
if (width > 0) {
vertCount = 10;
- primType = kTriangleStrip_PrimitiveType;
+ primType = kTriangleStrip_GrPrimitiveType;
setStrokeRectStrip(vertex, rect, width);
} else {
// hairline
vertCount = 5;
- primType = kLineStrip_PrimitiveType;
+ primType = kLineStrip_GrPrimitiveType;
vertex[0].set(rect.fLeft, rect.fTop);
vertex[1].set(rect.fRight, rect.fTop);
vertex[2].set(rect.fRight, rect.fBottom);
@@ -1046,7 +1046,7 @@ void GrContext::drawRect(const GrPaint& paint,
drawState->preConcatViewMatrix(m);
drawState->preConcatSamplerMatrices(stageMask, m);
- target->drawNonIndexed(kTriangleFan_PrimitiveType, 0, 4);
+ target->drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, 4);
#else
target->drawSimpleRect(rect, matrix, stageMask);
#endif
@@ -1105,7 +1105,7 @@ void GrContext::drawRectToRect(const GrPaint& paint,
return;
}
target->setVertexSourceToBuffer(layout, sqVB);
- target->drawNonIndexed(kTriangleFan_PrimitiveType, 0, 4);
+ target->drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, 4);
#else
GrDrawTarget* target;
@@ -1250,7 +1250,7 @@ void GrContext::drawOval(const GrPaint& paint,
SkPath path;
path.addOval(rect);
GrPathFill fill = (strokeWidth == 0) ?
- kHairLine_PathFill : kWinding_PathFill;
+ kHairLine_GrPathFill : kWinding_GrPathFill;
this->internalDrawPath(paint, path, fill, NULL);
return;
}
@@ -1309,7 +1309,7 @@ void GrContext::drawOval(const GrPaint& paint,
}
drawState->setVertexEdgeType(GrDrawState::kCircle_EdgeType);
- target->drawNonIndexed(kTriangleStrip_PrimitiveType, 0, 4);
+ target->drawNonIndexed(kTriangleStrip_GrPrimitiveType, 0, 4);
}
void GrContext::drawPath(const GrPaint& paint, const SkPath& path,
@@ -1327,7 +1327,7 @@ void GrContext::drawPath(const GrPaint& paint, const SkPath& path,
if (translate) {
ovalRect.offset(*translate);
}
- SkScalar width = (fill == kHairLine_PathFill) ? 0 : -SK_Scalar1;
+ SkScalar width = (fill == kHairLine_GrPathFill) ? 0 : -SK_Scalar1;
this->drawOval(paint, ovalRect, width);
return;
}
@@ -1740,7 +1740,7 @@ void GrContext::internalWriteRenderTargetPixels(GrRenderTarget* target,
return;
}
((GrPoint*)geo.vertices())->setIRectFan(0, 0, width, height);
- fGpu->drawNonIndexed(kTriangleFan_PrimitiveType, 0, VCOUNT);
+ fGpu->drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, VCOUNT);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index e0f36a3b85..feb6a998e6 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -154,7 +154,7 @@ static inline bool single_pass_path(const SkPath& path, GrPathFill fill) {
#if STENCIL_OFF
return true;
#else
- if (kEvenOdd_PathFill == fill || kWinding_PathFill == fill) {
+ if (kEvenOdd_GrPathFill == fill || kWinding_GrPathFill == fill) {
return path.isConvex();
}
return false;
@@ -174,7 +174,7 @@ static inline void append_countour_edge_indices(GrPathFill fillType,
// when drawing lines we're appending line segments along
// the contour. When applying the other fill rules we're
// drawing triangle fans around fanCenterIdx.
- if (kHairLine_PathFill != fillType) {
+ if (kHairLine_GrPathFill != fillType) {
*((*indices)++) = fanCenterIdx;
}
*((*indices)++) = edgeV0Idx;
@@ -217,19 +217,19 @@ bool GrDefaultPathRenderer::createGeom(const SkPath& path,
bool indexed = contourCnt > 1;
int maxIdxs = 0;
- if (kHairLine_PathFill == fill) {
+ if (kHairLine_GrPathFill == fill) {
if (indexed) {
maxIdxs = 2 * maxPts;
- *primType = kLines_PrimitiveType;
+ *primType = kLines_GrPrimitiveType;
} else {
- *primType = kLineStrip_PrimitiveType;
+ *primType = kLineStrip_GrPrimitiveType;
}
} else {
if (indexed) {
maxIdxs = 3 * maxPts;
- *primType = kTriangles_PrimitiveType;
+ *primType = kTriangles_GrPrimitiveType;
} else {
- *primType = kTriangleFan_PrimitiveType;
+ *primType = kTriangleFan_GrPrimitiveType;
}
}
@@ -371,7 +371,7 @@ bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
bool reverse = false;
bool lastPassIsBounds;
- if (kHairLine_PathFill == fill) {
+ if (kHairLine_GrPathFill == fill) {
passCount = 1;
if (stencilOnly) {
passes[0] = &gDirectToStencil;
@@ -392,10 +392,10 @@ bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
lastPassIsBounds = false;
} else {
switch (fill) {
- case kInverseEvenOdd_PathFill:
+ case kInverseEvenOdd_GrPathFill:
reverse = true;
// fallthrough
- case kEvenOdd_PathFill:
+ case kEvenOdd_GrPathFill:
passes[0] = &gEOStencilPass;
if (stencilOnly) {
passCount = 1;
@@ -412,10 +412,10 @@ bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
drawFace[0] = drawFace[1] = GrDrawState::kBoth_DrawFace;
break;
- case kInverseWinding_PathFill:
+ case kInverseWinding_GrPathFill:
reverse = true;
// fallthrough
- case kWinding_PathFill:
+ case kWinding_GrPathFill:
if (fSeparateStencil) {
if (fStencilWrapOps) {
passes[0] = &gWindStencilSeparateWithWrap;
@@ -540,7 +540,7 @@ bool GrDefaultPathRenderer::onDrawPath(const SkPath& path,
void GrDefaultPathRenderer::drawPathToStencil(const SkPath& path,
GrPathFill fill,
GrDrawTarget* target) {
- GrAssert(kInverseEvenOdd_PathFill != fill);
- GrAssert(kInverseWinding_PathFill != fill);
+ GrAssert(kInverseEvenOdd_GrPathFill != fill);
+ GrAssert(kInverseWinding_GrPathFill != fill);
this->internalDrawPath(path, fill, NULL, target, 0, true);
}
diff --git a/src/gpu/GrDefaultTextContext.cpp b/src/gpu/GrDefaultTextContext.cpp
index 8bc4c6874e..d3d4e523a0 100644
--- a/src/gpu/GrDefaultTextContext.cpp
+++ b/src/gpu/GrDefaultTextContext.cpp
@@ -37,14 +37,14 @@ void GrDefaultTextContext::flushGlyphs() {
drawState->setTexture(kGlyphMaskStage, fCurrTexture);
if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) {
- if (kOne_BlendCoeff != fGrPaint.fSrcBlendCoeff ||
- kISA_BlendCoeff != fGrPaint.fDstBlendCoeff ||
+ if (kOne_GrBlendCoeff != fGrPaint.fSrcBlendCoeff ||
+ kISA_GrBlendCoeff != fGrPaint.fDstBlendCoeff ||
fGrPaint.hasTexture()) {
GrPrintf("LCD Text will not draw correctly.\n");
}
// setup blend so that we get mask * paintColor + (1-mask)*dstColor
drawState->setBlendConstant(fGrPaint.fColor);
- drawState->setBlendFunc(kConstC_BlendCoeff, kISC_BlendCoeff);
+ drawState->setBlendFunc(kConstC_GrBlendCoeff, kISC_GrBlendCoeff);
// don't modulate by the paint's color in the frag since we're
// already doing it via the blend const.
drawState->setColor(0xffffffff);
@@ -56,7 +56,7 @@ void GrDefaultTextContext::flushGlyphs() {
fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer());
int nGlyphs = fCurrVertex / 4;
- fDrawTarget->drawIndexedInstances(kTriangles_PrimitiveType,
+ fDrawTarget->drawIndexedInstances(kTriangles_GrPrimitiveType,
nGlyphs,
4, 6);
fVertices = NULL;
@@ -232,7 +232,7 @@ void GrDefaultTextContext::drawPackedGlyph(GrGlyph::PackedID packed,
GrPoint translate;
translate.set(GrFixedToScalar(vx - GrIntToFixed(glyph->fBounds.fLeft)),
GrFixedToScalar(vy - GrIntToFixed(glyph->fBounds.fTop)));
- fContext->drawPath(fGrPaint, *glyph->fPath, kWinding_PathFill,
+ fContext->drawPath(fGrPaint, *glyph->fPath, kWinding_GrPathFill,
&translate);
return;
}
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 23d05bc5da..e56b98fcd1 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -82,8 +82,8 @@ public:
fCoverage = 0xffffffff;
fFirstCoverageStage = kNumStages;
fColorFilterMode = SkXfermode::kDst_Mode;
- fSrcBlend = kOne_BlendCoeff;
- fDstBlend = kZero_BlendCoeff;
+ fSrcBlend = kOne_GrBlendCoeff;
+ fDstBlend = kZero_GrBlendCoeff;
fViewMatrix.reset();
fBehaviorBits = 0;
@@ -289,10 +289,10 @@ public:
fDstBlend = dstCoeff;
#if GR_DEBUG
switch (dstCoeff) {
- case kDC_BlendCoeff:
- case kIDC_BlendCoeff:
- case kDA_BlendCoeff:
- case kIDA_BlendCoeff:
+ case kDC_GrBlendCoeff:
+ case kIDC_GrBlendCoeff:
+ case kDA_GrBlendCoeff:
+ case kIDA_GrBlendCoeff:
GrPrintf("Unexpected dst blend coeff. Won't work correctly with"
"coverage stages.\n");
break;
@@ -300,10 +300,10 @@ public:
break;
}
switch (srcCoeff) {
- case kSC_BlendCoeff:
- case kISC_BlendCoeff:
- case kSA_BlendCoeff:
- case kISA_BlendCoeff:
+ case kSC_GrBlendCoeff:
+ case kISC_GrBlendCoeff:
+ case kSA_GrBlendCoeff:
+ case kISA_GrBlendCoeff:
GrPrintf("Unexpected src blend coeff. Won't work correctly with"
"coverage stages.\n");
break;
@@ -325,10 +325,10 @@ public:
/**
* Sets the blending function constant referenced by the following blending
* coeffecients:
- * kConstC_BlendCoeff
- * kIConstC_BlendCoeff
- * kConstA_BlendCoeff
- * kIConstA_BlendCoeff
+ * kConstC_GrBlendCoeff
+ * kIConstC_GrBlendCoeff
+ * kConstA_GrBlendCoeff
+ * kIConstA_GrBlendCoeff
*
* @param constant the constant to set
*/
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 2f7bf84a75..bc373ba1f5 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -788,8 +788,8 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
return false;
}
if (GrPixelConfigIsUnpremultiplied(drawState.getRenderTarget()->config())) {
- if (kOne_BlendCoeff != drawState.getSrcBlendCoeff() ||
- kZero_BlendCoeff != drawState.getDstBlendCoeff()) {
+ if (kOne_GrBlendCoeff != drawState.getSrcBlendCoeff() ||
+ kZero_GrBlendCoeff != drawState.getDstBlendCoeff()) {
return false;
}
}
@@ -847,9 +847,9 @@ bool GrDrawTarget::canTweakAlphaForCoverage() const {
* coeffecient in terms of S' and D.
*/
GrBlendCoeff dstCoeff = this->getDrawState().getDstBlendCoeff();
- return kOne_BlendCoeff == dstCoeff ||
- kISA_BlendCoeff == dstCoeff ||
- kISC_BlendCoeff == dstCoeff;
+ return kOne_GrBlendCoeff == dstCoeff ||
+ kISA_GrBlendCoeff == dstCoeff ||
+ kISC_GrBlendCoeff == dstCoeff;
}
bool GrDrawTarget::srcAlphaWillBeOne(GrVertexLayout layout) const {
@@ -915,32 +915,32 @@ GrDrawTarget::getBlendOpts(bool forceCoverage,
*dstCoeff = drawState.getDstBlendCoeff();
// We don't ever expect source coeffecients to reference the source
- GrAssert(kSA_BlendCoeff != *srcCoeff &&
- kISA_BlendCoeff != *srcCoeff &&
- kSC_BlendCoeff != *srcCoeff &&
- kISC_BlendCoeff != *srcCoeff);
+ GrAssert(kSA_GrBlendCoeff != *srcCoeff &&
+ kISA_GrBlendCoeff != *srcCoeff &&
+ kSC_GrBlendCoeff != *srcCoeff &&
+ kISC_GrBlendCoeff != *srcCoeff);
// same for dst
- GrAssert(kDA_BlendCoeff != *dstCoeff &&
- kIDA_BlendCoeff != *dstCoeff &&
- kDC_BlendCoeff != *dstCoeff &&
- kIDC_BlendCoeff != *dstCoeff);
+ GrAssert(kDA_GrBlendCoeff != *dstCoeff &&
+ kIDA_GrBlendCoeff != *dstCoeff &&
+ kDC_GrBlendCoeff != *dstCoeff &&
+ kIDC_GrBlendCoeff != *dstCoeff);
if (drawState.isColorWriteDisabled()) {
- *srcCoeff = kZero_BlendCoeff;
- *dstCoeff = kOne_BlendCoeff;
+ *srcCoeff = kZero_GrBlendCoeff;
+ *dstCoeff = kOne_GrBlendCoeff;
}
bool srcAIsOne = this->srcAlphaWillBeOne(layout);
- bool dstCoeffIsOne = kOne_BlendCoeff == *dstCoeff ||
- (kSA_BlendCoeff == *dstCoeff && srcAIsOne);
- bool dstCoeffIsZero = kZero_BlendCoeff == *dstCoeff ||
- (kISA_BlendCoeff == *dstCoeff && srcAIsOne);
+ bool dstCoeffIsOne = kOne_GrBlendCoeff == *dstCoeff ||
+ (kSA_GrBlendCoeff == *dstCoeff && srcAIsOne);
+ bool dstCoeffIsZero = kZero_GrBlendCoeff == *dstCoeff ||
+ (kISA_GrBlendCoeff == *dstCoeff && srcAIsOne);
// When coeffs are (0,1) there is no reason to draw at all, unless
// stenciling is enabled. Having color writes disabled is effectively
// (0,1). The same applies when coverage is known to be 0.
- if ((kZero_BlendCoeff == *srcCoeff && dstCoeffIsOne) ||
+ if ((kZero_GrBlendCoeff == *srcCoeff && dstCoeffIsOne) ||
(!(layout & kCoverage_VertexLayoutBit) &&
0 == drawState.getCoverage())) {
if (drawState.getStencil().doesWrite()) {
@@ -969,15 +969,15 @@ GrDrawTarget::getBlendOpts(bool forceCoverage,
// has to read at all. If not, we'll disable blending.
if (!hasCoverage) {
if (dstCoeffIsZero) {
- if (kOne_BlendCoeff == *srcCoeff) {
+ if (kOne_GrBlendCoeff == *srcCoeff) {
// if there is no coverage and coeffs are (1,0) then we
// won't need to read the dst at all, it gets replaced by src
return kDisableBlend_BlendOptFlag;
- } else if (kZero_BlendCoeff == *srcCoeff) {
+ } else if (kZero_GrBlendCoeff == *srcCoeff) {
// if the op is "clear" then we don't need to emit a color
// or blend, just write transparent black into the dst.
- *srcCoeff = kOne_BlendCoeff;
- *dstCoeff = kZero_BlendCoeff;
+ *srcCoeff = kOne_GrBlendCoeff;
+ *dstCoeff = kZero_GrBlendCoeff;
return kDisableBlend_BlendOptFlag |
kEmitTransBlack_BlendOptFlag;
}
@@ -989,24 +989,24 @@ GrDrawTarget::getBlendOpts(bool forceCoverage,
return kCoverageAsAlpha_BlendOptFlag;
}
if (dstCoeffIsZero) {
- if (kZero_BlendCoeff == *srcCoeff) {
+ if (kZero_GrBlendCoeff == *srcCoeff) {
// the source color is not included in the blend
// the dst coeff is effectively zero so blend works out to:
// (c)(0)D + (1-c)D = (1-c)D.
- *dstCoeff = kISA_BlendCoeff;
+ *dstCoeff = kISA_GrBlendCoeff;
return kEmitCoverage_BlendOptFlag;
} else if (srcAIsOne) {
// the dst coeff is effectively zero so blend works out to:
// cS + (c)(0)D + (1-c)D = cS + (1-c)D.
// If Sa is 1 then we can replace Sa with c
// and set dst coeff to 1-Sa.
- *dstCoeff = kISA_BlendCoeff;
+ *dstCoeff = kISA_GrBlendCoeff;
return kCoverageAsAlpha_BlendOptFlag;
}
} else if (dstCoeffIsOne) {
// the dst coeff is effectively one so blend works out to:
// cS + (c)(1)D + (1-c)D = cS + D.
- *dstCoeff = kOne_BlendCoeff;
+ *dstCoeff = kOne_GrBlendCoeff;
return kCoverageAsAlpha_BlendOptFlag;
}
}
@@ -1081,7 +1081,7 @@ void GrDrawTarget::drawRect(const GrRect& rect,
SetRectVertices(rect, matrix, srcRects,
srcMatrices, layout, geo.vertices());
- drawNonIndexed(kTriangleFan_PrimitiveType, 0, 4);
+ drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, 4);
}
GrVertexLayout GrDrawTarget::GetRectVertexLayout(StageMask stageMask,
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index baca8248ff..d39ace0bf0 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -35,12 +35,12 @@ public:
enum ExtendedBlendCoeffs {
// source 2 refers to second output color when
// using dual source blending.
- kS2C_BlendCoeff = kPublicBlendCoeffCount,
- kIS2C_BlendCoeff,
- kS2A_BlendCoeff,
- kIS2A_BlendCoeff,
+ kS2C_GrBlendCoeff = kPublicGrBlendCoeffCount,
+ kIS2C_GrBlendCoeff,
+ kS2A_GrBlendCoeff,
+ kIS2A_GrBlendCoeff,
- kTotalBlendCoeffCount
+ kTotalGrBlendCoeffCount
};
/**
@@ -133,7 +133,7 @@ public:
* Returns an index buffer that can be used to render quads.
* Six indices per quad: 0, 1, 2, 0, 2, 3, etc.
* The max number of quads can be queried using GrIndexBuffer::maxQuads().
- * Draw with kTriangles_PrimitiveType
+ * Draw with kTriangles_GrPrimitiveType
* @ return the quad index buffer
*/
const GrIndexBuffer* getQuadIndexBuffer() const;
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 7b3b04f75b..7abe9413c7 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -156,7 +156,7 @@ void GrInOrderDrawBuffer::drawRect(const GrRect& rect,
Draw& lastDraw = fDraws.back();
GrAssert(lastDraw.fIndexBuffer == fQuadIndexBuffer);
- GrAssert(kTriangles_PrimitiveType == lastDraw.fPrimitiveType);
+ GrAssert(kTriangles_GrPrimitiveType == lastDraw.fPrimitiveType);
GrAssert(0 == lastDraw.fVertexCount % 4);
GrAssert(0 == lastDraw.fIndexCount % 6);
GrAssert(0 == lastDraw.fStartIndex);
@@ -183,7 +183,7 @@ void GrInOrderDrawBuffer::drawRect(const GrRect& rect,
}
if (!appendToPreviousDraw) {
this->setIndexSourceToBuffer(fQuadIndexBuffer);
- this->drawIndexed(kTriangles_PrimitiveType, 0, 0, 4, 6);
+ this->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 4, 6);
fCurrQuad = 1;
fLastRectVertexLayout = layout;
}
diff --git a/src/gpu/GrIndexBuffer.h b/src/gpu/GrIndexBuffer.h
index faa5018d32..a7e7a57c97 100644
--- a/src/gpu/GrIndexBuffer.h
+++ b/src/gpu/GrIndexBuffer.h
@@ -17,7 +17,7 @@ class GrIndexBuffer : public GrGeometryBuffer {
public:
/**
* Retrieves the maximum number of quads that could be rendered
- * from the index buffer (using kTriangles_PrimitiveType).
+ * from the index buffer (using kTriangles_GrPrimitiveType).
* @return the maximum number of quads using full size of index buffer.
*/
int maxQuads() const {
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index ff9fdbbc05..4439f6c3ca 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -120,7 +120,7 @@ public:
/**
* Draws the path to the stencil buffer. Assume the writable stencil bits
* are already initialized to zero. Fill will always be either
- * kWinding_PathFill or kEvenOdd_PathFill.
+ * kWinding_GrPathFill or kEvenOdd_GrPathFill.
*
* Only called if requiresStencilPass returns true for the same combo of
* target, path, and fill. Never called with an inverse fill.
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 817f55a86d..99209c6395 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -37,13 +37,13 @@ namespace {
////////////////////////////////////////////////////////////////////////////////
SkPath::FillType gr_fill_to_sk_fill(GrPathFill fill) {
switch (fill) {
- case kWinding_PathFill:
+ case kWinding_GrPathFill:
return SkPath::kWinding_FillType;
- case kEvenOdd_PathFill:
+ case kEvenOdd_GrPathFill:
return SkPath::kEvenOdd_FillType;
- case kInverseWinding_PathFill:
+ case kInverseWinding_GrPathFill:
return SkPath::kInverseWinding_FillType;
- case kInverseEvenOdd_PathFill:
+ case kInverseEvenOdd_GrPathFill:
return SkPath::kInverseEvenOdd_FillType;
default:
GrCrash("Unexpected fill.");
@@ -141,7 +141,7 @@ void GrSWMaskHelper::draw(const SkPath& clientPath, SkRegion::Op op,
SkPaint paint;
SkPath tmpPath;
const SkPath* pathToDraw = &clientPath;
- if (kHairLine_PathFill == fill) {
+ if (kHairLine_GrPathFill == fill) {
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(SK_Scalar1);
} else {
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7d9b4d9061..b0ff43a545 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -618,9 +618,9 @@ void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
// must be in SkCanvas::PointMode order
static const GrPrimitiveType gPointMode2PrimtiveType[] = {
- kPoints_PrimitiveType,
- kLines_PrimitiveType,
- kLineStrip_PrimitiveType
+ kPoints_GrPrimitiveType,
+ kLines_GrPrimitiveType,
+ kLineStrip_GrPrimitiveType
};
void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
@@ -722,16 +722,16 @@ namespace {
GrPathFill skToGrFillType(SkPath::FillType fillType) {
switch (fillType) {
case SkPath::kWinding_FillType:
- return kWinding_PathFill;
+ return kWinding_GrPathFill;
case SkPath::kEvenOdd_FillType:
- return kEvenOdd_PathFill;
+ return kEvenOdd_GrPathFill;
case SkPath::kInverseWinding_FillType:
- return kInverseWinding_PathFill;
+ return kInverseWinding_GrPathFill;
case SkPath::kInverseEvenOdd_FillType:
- return kInverseEvenOdd_PathFill;
+ return kInverseEvenOdd_GrPathFill;
default:
SkDebugf("Unsupported path fill type\n");
- return kHairLine_PathFill;
+ return kHairLine_GrPathFill;
}
}
@@ -830,8 +830,8 @@ bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path,
// code path may not be taken. So we use a dst blend coeff of ISA. We
// could special case AA draws to a dst surface with known alpha=0 to
// use a zero dst coeff when dual source blending isn't available.
- tempPaint.fSrcBlendCoeff = kOne_BlendCoeff;
- tempPaint.fDstBlendCoeff = kISC_BlendCoeff;
+ tempPaint.fSrcBlendCoeff = kOne_GrBlendCoeff;
+ tempPaint.fDstBlendCoeff = kISC_GrBlendCoeff;
}
// Draw hard shadow to pathTexture with path topleft at origin 0,0.
context->drawPath(tempPaint, path, pathFillType, &offset);
@@ -856,18 +856,18 @@ bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path,
paint.setTexture(0, pathTexture);
if (SkMaskFilter::kInner_BlurType == blurType) {
// inner: dst = dst * src
- paint.fSrcBlendCoeff = kDC_BlendCoeff;
- paint.fDstBlendCoeff = kZero_BlendCoeff;
+ paint.fSrcBlendCoeff = kDC_GrBlendCoeff;
+ paint.fDstBlendCoeff = kZero_GrBlendCoeff;
} else if (SkMaskFilter::kSolid_BlurType == blurType) {
// solid: dst = src + dst - src * dst
// = (1 - dst) * src + 1 * dst
- paint.fSrcBlendCoeff = kIDC_BlendCoeff;
- paint.fDstBlendCoeff = kOne_BlendCoeff;
+ paint.fSrcBlendCoeff = kIDC_GrBlendCoeff;
+ paint.fDstBlendCoeff = kOne_GrBlendCoeff;
} else if (SkMaskFilter::kOuter_BlurType == blurType) {
// outer: dst = dst * (1 - src)
// = 0 * src + (1 - src) * dst
- paint.fSrcBlendCoeff = kZero_BlendCoeff;
- paint.fDstBlendCoeff = kISC_BlendCoeff;
+ paint.fSrcBlendCoeff = kZero_GrBlendCoeff;
+ paint.fDstBlendCoeff = kISC_GrBlendCoeff;
}
context->drawRect(paint, srcRect);
}
@@ -1038,7 +1038,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
// transform the path into device space
pathPtr->transform(*draw.fMatrix, devPathPtr);
GrPathFill pathFillType = doFill ?
- skToGrFillType(devPathPtr->getFillType()) : kHairLine_PathFill;
+ skToGrFillType(devPathPtr->getFillType()) : kHairLine_GrPathFill;
if (!drawWithGPUMaskFilter(fContext, *devPathPtr, paint.getMaskFilter(),
*draw.fMatrix, *draw.fClip, draw.fBounder,
&grPaint, pathFillType)) {
@@ -1051,21 +1051,21 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
return;
}
- GrPathFill fill = kHairLine_PathFill;
+ GrPathFill fill = kHairLine_GrPathFill;
if (doFill) {
switch (pathPtr->getFillType()) {
case SkPath::kWinding_FillType:
- fill = kWinding_PathFill;
+ fill = kWinding_GrPathFill;
break;
case SkPath::kEvenOdd_FillType:
- fill = kEvenOdd_PathFill;
+ fill = kEvenOdd_GrPathFill;
break;
case SkPath::kInverseWinding_FillType:
- fill = kInverseWinding_PathFill;
+ fill = kInverseWinding_GrPathFill;
break;
case SkPath::kInverseEvenOdd_FillType:
- fill = kInverseEvenOdd_PathFill;
+ fill = kInverseEvenOdd_GrPathFill;
break;
default:
SkDebugf("Unsupported path fill type\n");
@@ -1613,9 +1613,9 @@ bool SkGpuDevice::filterImage(SkImageFilter* filter, const SkBitmap& src,
// must be in SkCanvas::VertexMode order
static const GrPrimitiveType gVertexMode2PrimitiveType[] = {
- kTriangles_PrimitiveType,
- kTriangleStrip_PrimitiveType,
- kTriangleFan_PrimitiveType,
+ kTriangles_GrPrimitiveType,
+ kTriangleStrip_GrPrimitiveType,
+ kTriangleFan_GrPrimitiveType,
};
void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 92a3aff932..00a0282887 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -179,16 +179,16 @@ bool SkGrClipIterator::getDoAA() const {
GrPathFill SkGrClipIterator::getPathFill() const {
switch (fCurr->fPath->getFillType()) {
case SkPath::kWinding_FillType:
- return kWinding_PathFill;
+ return kWinding_GrPathFill;
case SkPath::kEvenOdd_FillType:
- return kEvenOdd_PathFill;
+ return kEvenOdd_GrPathFill;
case SkPath::kInverseWinding_FillType:
- return kInverseWinding_PathFill;
+ return kInverseWinding_GrPathFill;
case SkPath::kInverseEvenOdd_FillType:
- return kInverseEvenOdd_PathFill;
+ return kInverseEvenOdd_GrPathFill;
default:
GrCrash("Unsupported path fill in clip.");
- return kWinding_PathFill; // suppress warning
+ return kWinding_GrPathFill; // suppress warning
}
}
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index b1d6d4fbf5..3202d39e9b 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -112,7 +112,7 @@ void GrGLProgram::overrideBlend(GrBlendCoeff* srcCoeff,
case ProgramDesc::kCoverage_DualSrcOutput:
case ProgramDesc::kCoverageISA_DualSrcOutput:
case ProgramDesc::kCoverageISC_DualSrcOutput:
- *dstCoeff = (GrBlendCoeff)GrGpu::kIS2C_BlendCoeff;
+ *dstCoeff = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff;
break;
default:
GrCrash("Unexpected dual source blend output");
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 82a65fd451..d5c0bd2ed6 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -83,30 +83,32 @@ bool GrGpuGL::BlendCoeffReferencesConstant(GrBlendCoeff coeff) {
false,
};
return gCoeffReferencesBlendConst[coeff];
- GR_STATIC_ASSERT(kTotalBlendCoeffCount == GR_ARRAY_COUNT(gCoeffReferencesBlendConst));
-
- GR_STATIC_ASSERT(0 == kZero_BlendCoeff);
- GR_STATIC_ASSERT(1 == kOne_BlendCoeff);
- GR_STATIC_ASSERT(2 == kSC_BlendCoeff);
- GR_STATIC_ASSERT(3 == kISC_BlendCoeff);
- GR_STATIC_ASSERT(4 == kDC_BlendCoeff);
- GR_STATIC_ASSERT(5 == kIDC_BlendCoeff);
- GR_STATIC_ASSERT(6 == kSA_BlendCoeff);
- GR_STATIC_ASSERT(7 == kISA_BlendCoeff);
- GR_STATIC_ASSERT(8 == kDA_BlendCoeff);
- GR_STATIC_ASSERT(9 == kIDA_BlendCoeff);
- GR_STATIC_ASSERT(10 == kConstC_BlendCoeff);
- GR_STATIC_ASSERT(11 == kIConstC_BlendCoeff);
- GR_STATIC_ASSERT(12 == kConstA_BlendCoeff);
- GR_STATIC_ASSERT(13 == kIConstA_BlendCoeff);
-
- GR_STATIC_ASSERT(14 == kS2C_BlendCoeff);
- GR_STATIC_ASSERT(15 == kIS2C_BlendCoeff);
- GR_STATIC_ASSERT(16 == kS2A_BlendCoeff);
- GR_STATIC_ASSERT(17 == kIS2A_BlendCoeff);
+ GR_STATIC_ASSERT(kTotalGrBlendCoeffCount ==
+ GR_ARRAY_COUNT(gCoeffReferencesBlendConst));
+
+ GR_STATIC_ASSERT(0 == kZero_GrBlendCoeff);
+ GR_STATIC_ASSERT(1 == kOne_GrBlendCoeff);
+ GR_STATIC_ASSERT(2 == kSC_GrBlendCoeff);
+ GR_STATIC_ASSERT(3 == kISC_GrBlendCoeff);
+ GR_STATIC_ASSERT(4 == kDC_GrBlendCoeff);
+ GR_STATIC_ASSERT(5 == kIDC_GrBlendCoeff);
+ GR_STATIC_ASSERT(6 == kSA_GrBlendCoeff);
+ GR_STATIC_ASSERT(7 == kISA_GrBlendCoeff);
+ GR_STATIC_ASSERT(8 == kDA_GrBlendCoeff);
+ GR_STATIC_ASSERT(9 == kIDA_GrBlendCoeff);
+ GR_STATIC_ASSERT(10 == kConstC_GrBlendCoeff);
+ GR_STATIC_ASSERT(11 == kIConstC_GrBlendCoeff);
+ GR_STATIC_ASSERT(12 == kConstA_GrBlendCoeff);
+ GR_STATIC_ASSERT(13 == kIConstA_GrBlendCoeff);
+
+ GR_STATIC_ASSERT(14 == kS2C_GrBlendCoeff);
+ GR_STATIC_ASSERT(15 == kIS2C_GrBlendCoeff);
+ GR_STATIC_ASSERT(16 == kS2A_GrBlendCoeff);
+ GR_STATIC_ASSERT(17 == kIS2A_GrBlendCoeff);
// assertion for gXfermodeCoeff2Blend have to be in GrGpu scope
- GR_STATIC_ASSERT(kTotalBlendCoeffCount == GR_ARRAY_COUNT(gXfermodeCoeff2Blend));
+ GR_STATIC_ASSERT(kTotalGrBlendCoeffCount ==
+ GR_ARRAY_COUNT(gXfermodeCoeff2Blend));
}
///////////////////////////////////////////////////////////////////////////////
@@ -2005,19 +2007,19 @@ void GrGpuGL::flushBlend(GrPrimitiveType type,
GL_CALL(Enable(GR_GL_BLEND));
fHWBlendState.fEnabled = kYes_TriState;
}
- if (kSA_BlendCoeff != fHWBlendState.fSrcCoeff ||
- kISA_BlendCoeff != fHWBlendState.fDstCoeff) {
- GL_CALL(BlendFunc(gXfermodeCoeff2Blend[kSA_BlendCoeff],
- gXfermodeCoeff2Blend[kISA_BlendCoeff]));
- fHWBlendState.fSrcCoeff = kSA_BlendCoeff;
- fHWBlendState.fDstCoeff = kISA_BlendCoeff;
+ if (kSA_GrBlendCoeff != fHWBlendState.fSrcCoeff ||
+ kISA_GrBlendCoeff != fHWBlendState.fDstCoeff) {
+ GL_CALL(BlendFunc(gXfermodeCoeff2Blend[kSA_GrBlendCoeff],
+ gXfermodeCoeff2Blend[kISA_GrBlendCoeff]));
+ fHWBlendState.fSrcCoeff = kSA_GrBlendCoeff;
+ fHWBlendState.fDstCoeff = kISA_GrBlendCoeff;
}
} else {
// any optimization to disable blending should
// have already been applied and tweaked the coeffs
// to (1, 0).
- bool blendOff = kOne_BlendCoeff == srcCoeff &&
- kZero_BlendCoeff == dstCoeff;
+ bool blendOff = kOne_GrBlendCoeff == srcCoeff &&
+ kZero_GrBlendCoeff == dstCoeff;
if (blendOff) {
if (kNo_TriState != fHWBlendState.fEnabled) {
GL_CALL(Disable(GR_GL_BLEND));
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index df729a74ff..290617099d 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -331,8 +331,8 @@ private:
TriState fEnabled;
void invalidate() {
- fSrcCoeff = kInvalid_BlendCoeff;
- fDstCoeff = kInvalid_BlendCoeff;
+ fSrcCoeff = kInvalid_GrBlendCoeff;
+ fDstCoeff = kInvalid_GrBlendCoeff;
fConstColorValid = false;
fEnabled = kUnknown_TriState;
}
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 581a22a68f..d8299ff382 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -657,7 +657,7 @@ void GrGpuGL::buildProgram(GrPrimitiveType type,
// Must initialize all fields or cache will have false negatives!
desc.fVertexLayout = this->getVertexLayout();
- desc.fEmitsPointSize = kPoints_PrimitiveType == type;
+ desc.fEmitsPointSize = kPoints_GrPrimitiveType == type;
bool requiresAttributeColors =
!skipColor && SkToBool(desc.fVertexLayout & kColor_VertexLayoutBit);
@@ -847,16 +847,16 @@ void GrGpuGL::buildProgram(GrPrimitiveType type,
if (this->getCaps().fDualSourceBlendingSupport &&
!(blendOpts & (kEmitCoverage_BlendOptFlag |
kCoverageAsAlpha_BlendOptFlag))) {
- if (kZero_BlendCoeff == dstCoeff) {
+ if (kZero_GrBlendCoeff == dstCoeff) {
// write the coverage value to second color
desc.fDualSrcOutput = ProgramDesc::kCoverage_DualSrcOutput;
desc.fFirstCoverageStage = firstCoverageStage;
- } else if (kSA_BlendCoeff == dstCoeff) {
+ } else if (kSA_GrBlendCoeff == dstCoeff) {
// SA dst coeff becomes 1-(1-SA)*coverage when dst is partially
// cover
desc.fDualSrcOutput = ProgramDesc::kCoverageISA_DualSrcOutput;
desc.fFirstCoverageStage = firstCoverageStage;
- } else if (kSC_BlendCoeff == dstCoeff) {
+ } else if (kSC_GrBlendCoeff == dstCoeff) {
// SA dst coeff becomes 1-(1-SA)*coverage when dst is partially
// cover
desc.fDualSrcOutput = ProgramDesc::kCoverageISC_DualSrcOutput;