aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-15 12:07:18 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-15 17:18:19 +0000
commitfbcef6eb8abad142daf45418516550f7635b4a52 (patch)
tree1fb2b2a1df72ba87ec05a91bd1cd271e24b5544e /tests
parentbaaf439eb5d08097d794f13800e5bf7ce8885f95 (diff)
Clean up GrResourceProvider usage
The only substantive changes are the removal of GrProxy instantiation in: SkGpuBlurUtils::GaussianBlur GrSimpleTextureEffect::Make* Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc Reviewed-on: https://skia-review.googlesource.com/19965 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/GLProgramsTest.cpp1
-rw-r--r--tests/GrPorterDuffTest.cpp1
-rw-r--r--tests/ImageStorageTest.cpp15
-rw-r--r--tests/IntTextureTest.cpp3
-rw-r--r--tests/OnFlushCallbackTest.cpp7
-rw-r--r--tests/PrimitiveProcessorTest.cpp1
-rw-r--r--tests/ProcessorTest.cpp20
-rw-r--r--tests/ReadPixelsTest.cpp1
-rw-r--r--tests/RectangleTextureTest.cpp1
-rw-r--r--tests/SRGBMipMapTest.cpp3
-rw-r--r--tests/SRGBReadWritePixelsTest.cpp1
-rw-r--r--tests/TessellatingPathRendererTests.cpp1
12 files changed, 17 insertions, 38 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 51259781f2..cc61891dd4 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -18,7 +18,6 @@
#include "GrDrawingManager.h"
#include "GrPipeline.h"
#include "GrRenderTargetContextPriv.h"
-#include "GrResourceProvider.h"
#include "GrTest.h"
#include "GrXferProcessor.h"
#include "SkChecksum.h"
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp
index 8a6e58e5dd..37972d9379 100644
--- a/tests/GrPorterDuffTest.cpp
+++ b/tests/GrPorterDuffTest.cpp
@@ -13,7 +13,6 @@
#include "GrContextOptions.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
-#include "GrResourceProvider.h"
#include "GrTest.h"
#include "GrXferProcessor.h"
#include "effects/GrPorterDuffXferProcessor.h"
diff --git a/tests/ImageStorageTest.cpp b/tests/ImageStorageTest.cpp
index d818b39dc4..f55553c518 100644
--- a/tests/ImageStorageTest.cpp
+++ b/tests/ImageStorageTest.cpp
@@ -12,7 +12,6 @@
#include "GrClip.h"
#include "GrFragmentProcessor.h"
#include "GrRenderTargetContext.h"
-#include "GrResourceProvider.h"
#include "GrTexture.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
@@ -20,23 +19,20 @@
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageStorageLoad, reporter, ctxInfo) {
class TestFP : public GrFragmentProcessor {
public:
- static sk_sp<GrFragmentProcessor> Make(GrResourceProvider* resourceProvider,
- sk_sp<GrTextureProxy> proxy,
+ static sk_sp<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> proxy,
GrSLMemoryModel mm,
GrSLRestrict restrict) {
- return sk_sp<GrFragmentProcessor>(new TestFP(resourceProvider,
- std::move(proxy), mm, restrict));
+ return sk_sp<GrFragmentProcessor>(new TestFP(std::move(proxy), mm, restrict));
}
const char* name() const override { return "Image Load Test FP"; }
private:
- TestFP(GrResourceProvider* resourceProvider,
- sk_sp<GrTextureProxy> proxy, GrSLMemoryModel mm, GrSLRestrict restrict)
+ TestFP(sk_sp<GrTextureProxy> proxy, GrSLMemoryModel mm, GrSLRestrict restrict)
: INHERITED(kNone_OptimizationFlags)
, fImageStorageAccess(std::move(proxy), kRead_GrIOType, mm, restrict) {
this->initClassID<TestFP>();
- this->addImageStorageAccess(resourceProvider, &fImageStorageAccess);
+ this->addImageStorageAccess(&fImageStorageAccess);
}
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
@@ -140,8 +136,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageStorageLoad, reporter, ctxInfo) {
kRGBA_8888_GrPixelConfig, nullptr);
GrPaint paint;
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- paint.addColorFragmentProcessor(TestFP::Make(context->resourceProvider(),
- imageStorageTexture, mm, restrict));
+ paint.addColorFragmentProcessor(TestFP::Make(imageStorageTexture, mm, restrict));
rtContext->drawPaint(GrNoClip(), std::move(paint), SkMatrix::I());
std::unique_ptr<uint32_t[]> readData(new uint32_t[kS * kS]);
SkImageInfo info = SkImageInfo::Make(kS, kS, kRGBA_8888_SkColorType,
diff --git a/tests/IntTextureTest.cpp b/tests/IntTextureTest.cpp
index bfd54ad4f0..415e7ca0c1 100644
--- a/tests/IntTextureTest.cpp
+++ b/tests/IntTextureTest.cpp
@@ -258,8 +258,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(IntTexture, reporter, ctxInfo) {
};
for (auto filter : kNamedFilters) {
- sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(context->resourceProvider(),
- sContext->asTextureProxyRef(),
+ sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(sContext->asTextureProxyRef(),
nullptr,
SkMatrix::I(),
filter.fMode));
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index f8198687cb..f4dd25f3fe 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -416,7 +416,6 @@ private:
// This creates an off-screen rendertarget whose ops which eventually pull from the atlas.
static sk_sp<GrTextureProxy> make_upstream_image(GrContext* context, AtlasObject* object, int start,
sk_sp<GrTextureProxy> fakeAtlas) {
-
sk_sp<GrRenderTargetContext> rtc(context->makeDeferredRenderTargetContext(
SkBackingFit::kApprox,
3*kDrawnTileSize,
@@ -433,8 +432,7 @@ static sk_sp<GrTextureProxy> make_upstream_image(GrContext* context, AtlasObject
// TODO: here is the blocker for deferring creation of the atlas. The TextureSamplers
// created here currently require a hard GrTexture.
- sk_sp<GrFragmentProcessor> fp = GrSimpleTextureEffect::Make(context->resourceProvider(),
- fakeAtlas,
+ sk_sp<GrFragmentProcessor> fp = GrSimpleTextureEffect::Make(fakeAtlas,
nullptr, SkMatrix::I());
GrPaint paint;
@@ -569,8 +567,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(OnFlushCallbackTest, reporter, ctxInfo) {
SkMatrix t = SkMatrix::MakeTrans(-i*3*kDrawnTileSize, 0);
GrPaint paint;
- sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(context->resourceProvider(),
- std::move(proxies[i]),
+ sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(std::move(proxies[i]),
nullptr, t));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
paint.addColorFragmentProcessor(std::move(fp));
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index 66b96f7b93..53ad44816b 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -17,7 +17,6 @@
#include "GrOpFlushState.h"
#include "GrRenderTargetContext.h"
#include "GrRenderTargetContextPriv.h"
-#include "GrResourceProvider.h"
#include "SkString.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryProcessor.h"
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 7f9dff738b..63543647c2 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -54,11 +54,10 @@ public:
static sk_sp<GrFragmentProcessor> Make(sk_sp<GrFragmentProcessor> child) {
return sk_sp<GrFragmentProcessor>(new TestFP(std::move(child)));
}
- static sk_sp<GrFragmentProcessor> Make(GrContext* context,
- const SkTArray<sk_sp<GrTextureProxy>>& proxies,
+ static sk_sp<GrFragmentProcessor> Make(const SkTArray<sk_sp<GrTextureProxy>>& proxies,
const SkTArray<sk_sp<GrBuffer>>& buffers,
const SkTArray<Image>& images) {
- return sk_sp<GrFragmentProcessor>(new TestFP(context, proxies, buffers, images));
+ return sk_sp<GrFragmentProcessor>(new TestFP(proxies, buffers, images));
}
const char* name() const override { return "test"; }
@@ -70,13 +69,12 @@ public:
}
private:
- TestFP(GrContext* context,
- const SkTArray<sk_sp<GrTextureProxy>>& proxies,
+ TestFP(const SkTArray<sk_sp<GrTextureProxy>>& proxies,
const SkTArray<sk_sp<GrBuffer>>& buffers,
const SkTArray<Image>& images)
: INHERITED(kNone_OptimizationFlags), fSamplers(4), fBuffers(4), fImages(4) {
for (const auto& proxy : proxies) {
- this->addTextureSampler(&fSamplers.emplace_back(context->resourceProvider(), proxy));
+ this->addTextureSampler(&fSamplers.emplace_back(proxy));
}
for (const auto& buffer : buffers) {
this->addBufferAccess(&fBuffers.emplace_back(kRGBA_8888_GrPixelConfig, buffer.get()));
@@ -84,7 +82,7 @@ private:
for (const Image& image : images) {
fImages.emplace_back(image.fProxy, image.fIOType,
GrSLMemoryModel::kNone, GrSLRestrict::kNo);
- this->addImageStorageAccess(context->resourceProvider(), &fImages.back());
+ this->addImageStorageAccess(&fImages.back());
}
}
@@ -175,8 +173,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
}
std::unique_ptr<GrLegacyMeshDrawOp> op(TestOp::Make());
GrPaint paint;
- auto fp = TestFP::Make(context,
- std::move(proxies), std::move(buffers), std::move(images));
+ auto fp = TestFP::Make(std::move(proxies), std::move(buffers), std::move(images));
for (int i = 0; i < parentCnt; ++i) {
fp = TestFP::Make(std::move(fp));
}
@@ -262,11 +259,8 @@ static GrColor4f texel_color4f(int i, int j) { return GrColor4f::FromGrColor(tex
void test_draw_op(GrRenderTargetContext* rtc, sk_sp<GrFragmentProcessor> fp,
sk_sp<GrTextureProxy> inputDataProxy) {
- GrResourceProvider* resourceProvider = rtc->resourceProvider();
-
GrPaint paint;
- paint.addColorTextureProcessor(resourceProvider, std::move(inputDataProxy),
- nullptr, SkMatrix::I());
+ paint.addColorTextureProcessor(std::move(inputDataProxy), nullptr, SkMatrix::I());
paint.addColorFragmentProcessor(std::move(fp));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 18a2525922..7b8dc8c6fd 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -18,7 +18,6 @@
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
-#include "GrResourceProvider.h"
#include "SkGr.h"
#endif
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index 9c85ad4522..705f585b7b 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -30,7 +30,6 @@ static void test_basic_draw_as_src(skiatest::Reporter* reporter, GrContext* cont
GrSamplerParams::kMipMap_FilterMode}) {
rtContext->clear(nullptr, 0xDDCCBBAA, true);
sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(
- context->resourceProvider(),
rectProxy,
nullptr,
SkMatrix::I(), filter));
diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
index 33d99f2208..8d035e1589 100644
--- a/tests/SRGBMipMapTest.cpp
+++ b/tests/SRGBMipMapTest.cpp
@@ -11,7 +11,6 @@
#include "GrClip.h"
#include "GrContext.h"
#include "GrRenderTargetContext.h"
-#include "GrResourceProvider.h"
#include "SkCanvas.h"
#include "SkGr.h"
#include "SkSurface.h"
@@ -146,7 +145,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) {
GrPaint paint;
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
GrSamplerParams mipMapParams(SkShader::kRepeat_TileMode, GrSamplerParams::kMipMap_FilterMode);
- paint.addColorTextureProcessor(context->resourceProvider(), std::move(proxy),
+ paint.addColorTextureProcessor(std::move(proxy),
nullptr, SkMatrix::MakeScale(rtS), mipMapParams);
// 1) Draw texture to S32 surface (should generate/use sRGB mips)
diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp
index 9038b29770..a52e96104f 100644
--- a/tests/SRGBReadWritePixelsTest.cpp
+++ b/tests/SRGBReadWritePixelsTest.cpp
@@ -10,7 +10,6 @@
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
-#include "GrResourceProvider.h"
#include "GrSurfaceContext.h"
#include "SkCanvas.h"
#include "SkGr.h"
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index c41e9cf3c5..f9db895002 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -14,6 +14,7 @@
#include "GrContext.h"
#include "SkGradientShader.h"
#include "SkShaderBase.h"
+#include "effects/GrPorterDuffXferProcessor.h"
#include "ops/GrTessellatingPathRenderer.h"
/*