aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrProcessorUnitTest.h3
-rw-r--r--src/gpu/effects/GrBezierEffect.cpp16
-rw-r--r--src/gpu/ops/GrAAConvexPathRenderer.cpp9
-rw-r--r--tests/GLProgramsTest.cpp6
4 files changed, 14 insertions, 20 deletions
diff --git a/include/gpu/GrProcessorUnitTest.h b/include/gpu/GrProcessorUnitTest.h
index 49f26fdb9b..7cec307f28 100644
--- a/include/gpu/GrProcessorUnitTest.h
+++ b/include/gpu/GrProcessorUnitTest.h
@@ -45,12 +45,10 @@ sk_sp<GrFragmentProcessor> MakeChildFP(GrProcessorTestData*);
struct GrProcessorTestData {
GrProcessorTestData(SkRandom* random,
GrContext* context,
- const GrCaps* caps,
const GrRenderTargetContext* renderTargetContext,
GrTexture* textures[2])
: fRandom(random)
, fContext(context)
- , fCaps(caps)
, fRenderTargetContext(renderTargetContext) {
fTextures[0] = textures[0];
fTextures[1] = textures[1];
@@ -60,7 +58,6 @@ struct GrProcessorTestData {
}
SkRandom* fRandom;
GrContext* fContext;
- const GrCaps* fCaps;
const GrRenderTargetContext* fRenderTargetContext;
GrTexture* fTextures[2];
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index cb0e0c5a0c..834b11dc17 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -6,7 +6,7 @@
*/
#include "GrBezierEffect.h"
-
+#include "GrContext.h"
#include "GrShaderCaps.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryProcessor.h"
@@ -265,8 +265,8 @@ sk_sp<GrGeometryProcessor> GrConicEffect::TestCreate(GrProcessorTestData* d) {
static_cast<GrPrimitiveEdgeType>(
d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
gp = GrConicEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom),
- edgeType, *d->fCaps,
- GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool());
+ edgeType, *d->fContext->caps(), GrTest::TestMatrix(d->fRandom),
+ d->fRandom->nextBool());
} while (nullptr == gp);
return gp;
}
@@ -464,10 +464,8 @@ sk_sp<GrGeometryProcessor> GrQuadEffect::TestCreate(GrProcessorTestData* d) {
do {
GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
- gp = GrQuadEffect::Make(GrRandomColor(d->fRandom),
- GrTest::TestMatrix(d->fRandom),
- edgeType, *d->fCaps,
- GrTest::TestMatrix(d->fRandom),
+ gp = GrQuadEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom), edgeType,
+ *d->fContext->caps(), GrTest::TestMatrix(d->fRandom),
d->fRandom->nextBool());
} while (nullptr == gp);
return gp;
@@ -687,8 +685,8 @@ sk_sp<GrGeometryProcessor> GrCubicEffect::TestCreate(GrProcessorTestData* d) {
GrPrimitiveEdgeType edgeType =
static_cast<GrPrimitiveEdgeType>(
d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
- gp = GrCubicEffect::Make(GrRandomColor(d->fRandom),
- GrTest::TestMatrix(d->fRandom), edgeType, *d->fCaps);
+ gp = GrCubicEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom),
+ edgeType, *d->fContext->caps());
} while (nullptr == gp);
return gp;
}
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index e845e5ed4e..a279a8c767 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -656,10 +656,11 @@ GR_DEFINE_GEOMETRY_PROCESSOR_TEST(QuadEdgeEffect);
sk_sp<GrGeometryProcessor> QuadEdgeEffect::TestCreate(GrProcessorTestData* d) {
// Doesn't work without derivative instructions.
- return d->fCaps->shaderCaps()->shaderDerivativeSupport() ?
- QuadEdgeEffect::Make(GrRandomColor(d->fRandom),
- GrTest::TestMatrix(d->fRandom),
- d->fRandom->nextBool()) : nullptr;
+ return d->fContext->caps()->shaderCaps()->shaderDerivativeSupport()
+ ? QuadEdgeEffect::Make(GrRandomColor(d->fRandom),
+ GrTest::TestMatrix(d->fRandom),
+ d->fRandom->nextBool())
+ : nullptr;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 2ac57ff97f..b9f31e613f 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -327,8 +327,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
std::unique_ptr<GrDrawOp> op(GrRandomDrawOp(&random, context));
SkASSERT(op);
- GrProcessorTestData ptd(&random, context, context->caps(),
- renderTargetContext.get(), dummyTextures);
+ GrProcessorTestData ptd(&random, context, renderTargetContext.get(), dummyTextures);
set_random_color_coverage_stages(&grPaint, &ptd, maxStages);
set_random_xpf(&grPaint, &ptd);
bool snapToCenters = set_random_state(&grPaint, &random);
@@ -362,8 +361,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
for (int j = 0; j < 10; ++j) {
std::unique_ptr<GrDrawOp> op(GrRandomDrawOp(&random, context));
SkASSERT(op);
- GrProcessorTestData ptd(&random, context, context->caps(),
- renderTargetContext.get(), dummyTextures);
+ GrProcessorTestData ptd(&random, context, renderTargetContext.get(), dummyTextures);
GrPaint grPaint;
grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));