Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 783763002: Initial CL to move color / coverage off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@no-static-gp
Patch Set: bug fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.h ('k') | src/gpu/GrAADistanceFieldPathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index f7c6e7f6b123e977d9e710b1d5345c19928cfc80..44782dd2797aad2c3b1233b42b929900956e2d89 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -505,8 +505,8 @@ static void create_vertices(const SegmentArray& segments,
class QuadEdgeEffect : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create() {
- return SkNEW(QuadEdgeEffect);
+ static GrGeometryProcessor* Create(GrColor color) {
+ return SkNEW_ARGS(QuadEdgeEffect, (color));
}
virtual ~QuadEdgeEffect() {}
@@ -586,7 +586,7 @@ public:
}
private:
- QuadEdgeEffect() {
+ QuadEdgeEffect(GrColor color) : INHERITED(color) {
this->initClassID<QuadEdgeEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInQuadEdge = &this->addVertexAttrib(GrAttribute("inQuadEdge", kVec4f_GrVertexAttribType));
@@ -605,7 +605,7 @@ private:
GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
- typedef GrFragmentProcessor INHERITED;
+ typedef GrGeometryProcessor INHERITED;
};
GR_DEFINE_GEOMETRY_PROCESSOR_TEST(QuadEdgeEffect);
@@ -615,7 +615,7 @@ GrGeometryProcessor* QuadEdgeEffect::TestCreate(SkRandom* random,
const GrDrawTargetCaps& caps,
GrTexture*[]) {
// Doesn't work without derivative instructions.
- return caps.shaderDerivativeSupport() ? QuadEdgeEffect::Create() : NULL;
+ return caps.shaderDerivativeSupport() ? QuadEdgeEffect::Create(GrRandomColor(random)) : NULL;
}
///////////////////////////////////////////////////////////////////////////////
@@ -631,6 +631,7 @@ bool GrAAConvexPathRenderer::canDrawPath(const GrDrawTarget* target,
bool GrAAConvexPathRenderer::onDrawPath(GrDrawTarget* target,
GrDrawState* drawState,
+ GrColor color,
const SkPath& origPath,
const SkStrokeRec&,
bool antiAlias) {
@@ -678,7 +679,7 @@ bool GrAAConvexPathRenderer::onDrawPath(GrDrawTarget* target,
// Our computed verts should all be within one pixel of the segment control points.
devBounds.outset(SK_Scalar1, SK_Scalar1);
- GrGeometryProcessor* quadProcessor = QuadEdgeEffect::Create();
+ GrGeometryProcessor* quadProcessor = QuadEdgeEffect::Create(color);
drawState->setGeometryProcessor(quadProcessor)->unref();
GrDrawTarget::AutoReleaseGeometry arg(target, vCount, quadProcessor->getVertexStride(), iCount);
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.h ('k') | src/gpu/GrAADistanceFieldPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698