aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrBicubicEffect.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-30 08:06:27 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-30 13:40:15 +0000
commit40fd7c94c24bb30d888c3d85a79cbb96c7fbf800 (patch)
tree075e886c01de864ba982910f1854f47ba1ae95d8 /src/gpu/effects/GrBicubicEffect.cpp
parent55b72530fedeb58154635531751a8730982fbf2a (diff)
Push GrTextureProxy down to more effects
Change-Id: Ie3f32a88f25af082c25bc6daf3fe24e303e80f9e Reviewed-on: https://skia-review.googlesource.com/7616 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrBicubicEffect.cpp')
-rw-r--r--src/gpu/effects/GrBicubicEffect.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index cf3d2b5e79..cb589959a2 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -7,6 +7,7 @@
#include "GrBicubicEffect.h"
#include "GrInvariantOutput.h"
+#include "GrProxyMove.h"
#include "glsl/GrGLSLColorSpaceXformHelper.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -152,6 +153,31 @@ GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
this->initClassID<GrBicubicEffect>();
}
+GrBicubicEffect::GrBicubicEffect(GrContext* context, sk_sp<GrTextureProxy> proxy,
+ sk_sp<GrColorSpaceXform> colorSpaceXform,
+ const SkMatrix &matrix,
+ const SkShader::TileMode tileModes[2])
+ : INHERITED{context,
+ ModulationFlags(proxy->config()),
+ GR_PROXY_MOVE(proxy),
+ std::move(colorSpaceXform),
+ matrix,
+ GrSamplerParams(tileModes, GrSamplerParams::kNone_FilterMode)}
+ , fDomain(GrTextureDomain::IgnoredDomain()) {
+ this->initClassID<GrBicubicEffect>();
+}
+
+GrBicubicEffect::GrBicubicEffect(GrContext* context, sk_sp<GrTextureProxy> proxy,
+ sk_sp<GrColorSpaceXform> colorSpaceXform,
+ const SkMatrix &matrix,
+ const SkRect& domain)
+ : INHERITED(context, ModulationFlags(proxy->config()), proxy,
+ std::move(colorSpaceXform), matrix,
+ GrSamplerParams(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode))
+ , fDomain(proxy.get(), domain, GrTextureDomain::kClamp_Mode) {
+ this->initClassID<GrBicubicEffect>();
+}
+
GrBicubicEffect::~GrBicubicEffect() {
}
@@ -177,12 +203,12 @@ void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect);
sk_sp<GrFragmentProcessor> GrBicubicEffect::TestCreate(GrProcessorTestData* d) {
- int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
- GrProcessorUnitTest::kAlphaTextureIdx;
- auto colorSpaceXform = GrTest::TestColorXform(d->fRandom);
+ int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
+ : GrProcessorUnitTest::kAlphaTextureIdx;
+ sk_sp<GrColorSpaceXform> colorSpaceXform = GrTest::TestColorXform(d->fRandom);
static const SkShader::TileMode kClampClamp[] =
{ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode };
- return GrBicubicEffect::Make(d->fTextures[texIdx], colorSpaceXform,
+ return GrBicubicEffect::Make(d->context(), d->textureProxy(texIdx), std::move(colorSpaceXform),
SkMatrix::I(), kClampClamp);
}