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

Unified Diff: gm/convexpolyeffect.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 | « no previous file | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/convexpolyeffect.cpp
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index b4206d27080c4eae7ee4ed4f5a5b3e562eee7dd4..9f4c48b4eb741452a583bda24efd17d2fbd6f310 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -13,6 +13,7 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
+#include "GrDefaultGeoProcFactory.h"
#include "GrPathUtils.h"
#include "GrTest.h"
#include "SkColorPriv.h"
@@ -132,23 +133,21 @@ protected:
if (!fp) {
continue;
}
+ drawState->setGeometryProcessor(GrDefaultGeoProcFactory::Create(false))->unref();
drawState->addCoverageProcessor(fp);
drawState->setIdentityViewMatrix();
drawState->setRenderTarget(rt);
drawState->setColor(0xff000000);
- // TODO hack
GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, 0);
SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices());
- //SkPoint verts[4];
SkRect bounds = p.getBounds();
// Make sure any artifacts around the exterior of path are visible by using overly
// conservative bounding geometry.
bounds.outset(5.f, 5.f);
bounds.toQuad(verts);
- //tt.target()->setVertexSourceToArray(verts, 4);
tt.target()->setIndexSourceToBuffer(context->getQuadIndexBuffer());
tt.target()->drawIndexed(kTriangleFan_GrPrimitiveType, 0, 0, 4, 6);
@@ -190,21 +189,19 @@ protected:
}
GrDrawState* drawState = tt.target()->drawState();
+ drawState->setGeometryProcessor(GrDefaultGeoProcFactory::Create(false))->unref();
drawState->addCoverageProcessor(fp);
drawState->setIdentityViewMatrix();
drawState->setRenderTarget(rt);
drawState->setColor(0xff000000);
- // TODO hack
GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, 0);
SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices());
- //SkPoint verts[4];
SkRect bounds = rect;
bounds.outset(5.f, 5.f);
bounds.toQuad(verts);
- //tt.target()->setVertexSourceToArray(verts, 4);
tt.target()->setIndexSourceToBuffer(context->getQuadIndexBuffer());
tt.target()->drawIndexed(kTriangleFan_GrPrimitiveType, 0, 0, 4, 6);
« no previous file with comments | « no previous file | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698