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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 715903002: Push creation of default GP to the caller (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: added comment Created 6 years, 1 month 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 | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 2e9c82c8a0bd754854f87594275faca514e27351..74d19bdb0b94dea72f808c2735f13ae6894b29cd 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -8,12 +8,13 @@
#include "GrAAHairLinePathRenderer.h"
#include "GrContext.h"
+#include "GrDefaultGeoProcFactory.h"
#include "GrDrawState.h"
#include "GrDrawTargetCaps.h"
-#include "GrProcessor.h"
#include "GrGpu.h"
#include "GrIndexBuffer.h"
#include "GrPathUtils.h"
+#include "GrProcessor.h"
#include "GrTBackendProcessorFactory.h"
#include "SkGeometry.h"
#include "SkStroke.h"
@@ -642,19 +643,11 @@ void add_line(const SkPoint p[2],
///////////////////////////////////////////////////////////////////////////////
namespace {
-
// position + edge
extern const GrVertexAttrib gHairlineBezierAttribs[] = {
{kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
{kVec4f_GrVertexAttribType, sizeof(SkPoint), kGeometryProcessor_GrVertexAttribBinding}
};
-
-// position + coverage
-extern const GrVertexAttrib gHairlineLineAttribs[] = {
- {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
- {kFloat_GrVertexAttribType, sizeof(SkPoint), kCoverage_GrVertexAttribBinding},
-};
-
};
bool GrAAHairLinePathRenderer::createLineGeom(const SkPath& path,
@@ -669,8 +662,8 @@ bool GrAAHairLinePathRenderer::createLineGeom(const SkPath& path,
int vertCnt = kLineSegNumVertices * lineCnt;
- drawState->setVertexAttribs<gHairlineLineAttribs>(SK_ARRAY_COUNT(gHairlineLineAttribs),
- sizeof(LineVertex));
+ GrDefaultGeoProcFactory::SetAttribs(drawState, GrDefaultGeoProcFactory::kPosition_GPType |
+ GrDefaultGeoProcFactory::kCoverage_GPType);
if (!arg->set(target, vertCnt, 0)) {
return false;
@@ -884,6 +877,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
{
GrDrawState::AutoRestoreEffects are(drawState);
+ drawState->setGeometryProcessor(GrDefaultGeoProcFactory::Create(false))->unref();
target->setIndexSourceToBuffer(fLinesIndexBuffer);
int lines = 0;
while (lines < lineCnt) {
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698