aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ProcessorTest.cpp
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/ProcessorTest.cpp
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/ProcessorTest.cpp')
-rw-r--r--tests/ProcessorTest.cpp20
1 files changed, 7 insertions, 13 deletions
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);