aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-07-09 10:24:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-09 10:24:36 -0700
commit5f10b5c1b5744106312e24835d235b72fdba5802 (patch)
tree84b17f420f40ff9793f7d24285fa81412102bae7 /src/gpu
parentcc29d26f5742449eb2a2bafa7bbb6ec5ee701aef (diff)
More threading of GrProcessorDataManager
TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1230813003
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrBlurUtils.cpp3
-rw-r--r--src/gpu/GrClipMaskManager.cpp6
-rwxr-xr-xsrc/gpu/GrContext.cpp28
-rw-r--r--src/gpu/GrPaint.cpp12
-rw-r--r--src/gpu/GrPipelineBuilder.h12
-rw-r--r--src/gpu/GrSWMaskHelper.cpp3
-rw-r--r--src/gpu/SkGpuDevice.cpp20
-rw-r--r--src/gpu/effects/Gr1DKernelEffect.h5
-rw-r--r--src/gpu/effects/GrBicubicEffect.cpp15
-rw-r--r--src/gpu/effects/GrBicubicEffect.h35
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.cpp37
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.h13
-rw-r--r--src/gpu/effects/GrConvolutionEffect.cpp13
-rw-r--r--src/gpu/effects/GrConvolutionEffect.h18
-rw-r--r--src/gpu/effects/GrMatrixConvolutionEffect.cpp14
-rw-r--r--src/gpu/effects/GrMatrixConvolutionEffect.h12
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.cpp3
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.h28
-rw-r--r--src/gpu/effects/GrSingleTextureEffect.cpp9
-rw-r--r--src/gpu/effects/GrSingleTextureEffect.h9
-rw-r--r--src/gpu/effects/GrTextureDomain.cpp16
-rw-r--r--src/gpu/effects/GrTextureDomain.h6
22 files changed, 197 insertions, 120 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index caea2b45f5..d273371c10 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -36,7 +36,8 @@ static bool draw_mask(GrDrawContext* drawContext,
matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop);
matrix.postIDiv(mask->width(), mask->height());
- grp->addCoverageProcessor(GrSimpleTextureEffect::Create(mask, matrix,
+ grp->addCoverageProcessor(GrSimpleTextureEffect::Create(grp->getProcessorDataManager(),
+ mask, matrix,
kDevice_GrCoordSet))->unref();
SkMatrix inverse;
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 17a15a32c4..76cfbf6cfc 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -47,7 +47,8 @@ void setup_drawstate_aaclip(GrPipelineBuilder* pipelineBuilder,
SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height());
// This could be a long-lived effect that is cached with the alpha-mask.
pipelineBuilder->addCoverageProcessor(
- GrTextureDomainEffect::Create(result,
+ GrTextureDomainEffect::Create(pipelineBuilder->getProcessorDataManager(),
+ result,
mat,
GrTextureDomain::MakeTexelDomain(result, domainTexels),
GrTextureDomain::kDecal_Mode,
@@ -480,7 +481,8 @@ void GrClipMaskManager::mergeMask(GrPipelineBuilder* pipelineBuilder,
sampleM.setIDiv(srcMask->width(), srcMask->height());
pipelineBuilder->addCoverageProcessor(
- GrTextureDomainEffect::Create(srcMask,
+ GrTextureDomainEffect::Create(pipelineBuilder->getProcessorDataManager(),
+ srcMask,
sampleM,
GrTextureDomain::MakeTexelDomain(srcMask, srcBound),
GrTextureDomain::kDecal_Mode,
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 5cb89345e4..1c60074143 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -382,11 +382,13 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
// allocate a tmp buffer and sw convert the pixels to premul
SkAutoSTMalloc<128 * 128, uint32_t> tmpPixels(0);
+ GrPaint paint;
if (kUnpremul_PixelOpsFlag & pixelOpsFlags) {
if (!GrPixelConfigIs8888(srcConfig)) {
return false;
}
- fp.reset(this->createUPMToPMEffect(texture, swapRAndB, textureMatrix));
+ fp.reset(this->createUPMToPMEffect(paint.getProcessorDataManager(), texture, swapRAndB,
+ textureMatrix));
// handle the unpremul step on the CPU if we couldn't create an effect to do it.
if (!fp) {
size_t tmpRowBytes = 4 * width;
@@ -399,8 +401,10 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
buffer = tmpPixels.get();
}
}
+
if (!fp) {
- fp.reset(GrConfigConversionEffect::Create(texture,
+ fp.reset(GrConfigConversionEffect::Create(paint.getProcessorDataManager(),
+ texture,
swapRAndB,
GrConfigConversionEffect::kNone_PMConversion,
textureMatrix));
@@ -425,7 +429,6 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
return false;
}
- GrPaint paint;
paint.addColorProcessor(fp);
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
@@ -523,9 +526,11 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
textureMatrix.setTranslate(SK_Scalar1 *left, SK_Scalar1 *top);
textureMatrix.postIDiv(src->width(), src->height());
+ GrPaint paint;
SkAutoTUnref<const GrFragmentProcessor> fp;
if (unpremul) {
- fp.reset(this->createPMToUPMEffect(src, swapRAndB, textureMatrix));
+ fp.reset(this->createPMToUPMEffect(paint.getProcessorDataManager(), src, swapRAndB,
+ textureMatrix));
if (fp) {
unpremul = false; // we no longer need to do this on CPU after the read back.
}
@@ -534,7 +539,7 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
// there is no longer any point to using the scratch.
if (fp || flipY || swapRAndB) {
if (!fp) {
- fp.reset(GrConfigConversionEffect::Create(
+ fp.reset(GrConfigConversionEffect::Create(paint.getProcessorDataManager(),
src, swapRAndB, GrConfigConversionEffect::kNone_PMConversion,
textureMatrix));
}
@@ -549,7 +554,6 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
return false;
}
- GrPaint paint;
paint.addColorProcessor(fp);
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
@@ -705,7 +709,8 @@ void test_pm_conversions(GrContext* ctx, int* pmToUPMValue, int* upmToPMValue) {
}
}
-const GrFragmentProcessor* GrContext::createPMToUPMEffect(GrTexture* texture,
+const GrFragmentProcessor* GrContext::createPMToUPMEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
bool swapRAndB,
const SkMatrix& matrix) {
if (!fDidTestPMConversions) {
@@ -715,13 +720,15 @@ const GrFragmentProcessor* GrContext::createPMToUPMEffect(GrTexture* texture,
GrConfigConversionEffect::PMConversion pmToUPM =
static_cast<GrConfigConversionEffect::PMConversion>(fPMToUPMConversion);
if (GrConfigConversionEffect::kNone_PMConversion != pmToUPM) {
- return GrConfigConversionEffect::Create(texture, swapRAndB, pmToUPM, matrix);
+ return GrConfigConversionEffect::Create(procDataManager, texture, swapRAndB, pmToUPM,
+ matrix);
} else {
return NULL;
}
}
-const GrFragmentProcessor* GrContext::createUPMToPMEffect(GrTexture* texture,
+const GrFragmentProcessor* GrContext::createUPMToPMEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
bool swapRAndB,
const SkMatrix& matrix) {
if (!fDidTestPMConversions) {
@@ -731,7 +738,8 @@ const GrFragmentProcessor* GrContext::createUPMToPMEffect(GrTexture* texture,
GrConfigConversionEffect::PMConversion upmToPM =
static_cast<GrConfigConversionEffect::PMConversion>(fUPMToPMConversion);
if (GrConfigConversionEffect::kNone_PMConversion != upmToPM) {
- return GrConfigConversionEffect::Create(texture, swapRAndB, upmToPM, matrix);
+ return GrConfigConversionEffect::Create(procDataManager, texture, swapRAndB, upmToPM,
+ matrix);
} else {
return NULL;
}
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp
index 3c40c96d1b..f1533dd295 100644
--- a/src/gpu/GrPaint.cpp
+++ b/src/gpu/GrPaint.cpp
@@ -24,23 +24,27 @@ void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
}
void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) {
- this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unref();
+ this->addColorProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture,
+ matrix))->unref();
}
void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix) {
- this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unref();
+ this->addCoverageProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture,
+ matrix))->unref();
}
void GrPaint::addColorTextureProcessor(GrTexture* texture,
const SkMatrix& matrix,
const GrTextureParams& params) {
- this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix, params))->unref();
+ this->addColorProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture, matrix,
+ params))->unref();
}
void GrPaint::addCoverageTextureProcessor(GrTexture* texture,
const SkMatrix& matrix,
const GrTextureParams& params) {
- this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix, params))->unref();
+ this->addCoverageProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture, matrix,
+ params))->unref();
}
bool GrPaint::isConstantBlendedColor(GrColor* color) const {
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index df384b3c25..4f9016ba61 100644
--- a/src/gpu/GrPipelineBuilder.h
+++ b/src/gpu/GrPipelineBuilder.h
@@ -84,23 +84,27 @@ public:
* Creates a GrSimpleTextureEffect that uses local coords as texture coordinates.
*/
void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) {
- this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unref();
+ this->addColorProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture,
+ matrix))->unref();
}
void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix) {
- this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unref();
+ this->addCoverageProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture,
+ matrix))->unref();
}
void addColorTextureProcessor(GrTexture* texture,
const SkMatrix& matrix,
const GrTextureParams& params) {
- this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix, params))->unref();
+ this->addColorProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture, matrix,
+ params))->unref();
}
void addCoverageTextureProcessor(GrTexture* texture,
const SkMatrix& matrix,
const GrTextureParams& params) {
- this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix, params))->unref();
+ this->addCoverageProcessor(GrSimpleTextureEffect::Create(&fProcDataManager, texture, matrix,
+ params))->unref();
}
/**
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 9b9865e92b..28071d2f44 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -368,7 +368,8 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture,
maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop));
pipelineBuilder->addCoverageProcessor(
- GrSimpleTextureEffect::Create(texture,
+ GrSimpleTextureEffect::Create(pipelineBuilder->getProcessorDataManager(),
+ texture,
maskMatrix,
GrTextureParams::kNone_FilterMode,
kDevice_GrCoordSet))->unref();
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 028ab561f4..e0658b30f6 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1206,7 +1206,12 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
SkScalarMul(srcRect.fBottom, hInv));
SkRect textureDomain = SkRect::MakeEmpty();
+
+ // Construct a GrPaint by setting the bitmap texture as the first effect and then configuring
+ // the rest from the SkPaint.
+ GrPaint grPaint;
SkAutoTUnref<GrFragmentProcessor> fp;
+
if (needsTextureDomain && !(flags & SkCanvas::kBleed_DrawBitmapRectFlag)) {
// Use a constrained texture domain to avoid color bleeding
SkScalar left, top, right, bottom;
@@ -1226,9 +1231,11 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
}
textureDomain.setLTRB(left, top, right, bottom);
if (bicubic) {
- fp.reset(GrBicubicEffect::Create(texture, SkMatrix::I(), textureDomain));
+ fp.reset(GrBicubicEffect::Create(grPaint.getProcessorDataManager(), texture,
+ SkMatrix::I(), textureDomain));
} else {
- fp.reset(GrTextureDomainEffect::Create(texture,
+ fp.reset(GrTextureDomainEffect::Create(grPaint.getProcessorDataManager(),
+ texture,
SkMatrix::I(),
textureDomain,
GrTextureDomain::kClamp_Mode,
@@ -1237,14 +1244,13 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
} else if (bicubic) {
SkASSERT(GrTextureParams::kNone_FilterMode == params.filterMode());
SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTileModeY() };
- fp.reset(GrBicubicEffect::Create(texture, SkMatrix::I(), tileModes));
+ fp.reset(GrBicubicEffect::Create(grPaint.getProcessorDataManager(), texture, SkMatrix::I(),
+ tileModes));
} else {
- fp.reset(GrSimpleTextureEffect::Create(texture, SkMatrix::I(), params));
+ fp.reset(GrSimpleTextureEffect::Create(grPaint.getProcessorDataManager(), texture,
+ SkMatrix::I(), params));
}
- // Construct a GrPaint by setting the bitmap texture as the first effect and then configuring
- // the rest from the SkPaint.
- GrPaint grPaint;
grPaint.addColorProcessor(fp);
bool alphaOnly = !(kAlpha_8_SkColorType == bitmap.colorType());
GrColor paintColor = (alphaOnly) ? SkColor2GrColorJustAlpha(paint.getColor()) :
diff --git a/src/gpu/effects/Gr1DKernelEffect.h b/src/gpu/effects/Gr1DKernelEffect.h
index a195b7606c..0aec4b1336 100644
--- a/src/gpu/effects/Gr1DKernelEffect.h
+++ b/src/gpu/effects/Gr1DKernelEffect.h
@@ -28,10 +28,11 @@ public:
kY_Direction,
};
- Gr1DKernelEffect(GrTexture* texture,
+ Gr1DKernelEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
Direction direction,
int radius)
- : GrSingleTextureEffect(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
+ : INHERITED(procDataManager, texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture))
, fDirection(direction)
, fRadius(radius) {}
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index c4ceeba866..027a3c7ab3 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -134,22 +134,25 @@ static inline void convert_row_major_scalar_coeffs_to_column_major_floats(float
}
}
-GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
+GrBicubicEffect::GrBicubicEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkScalar coefficients[16],
const SkMatrix &matrix,
const SkShader::TileMode tileModes[2])
- : INHERITED(texture, matrix, GrTextureParams(tileModes, GrTextureParams::kNone_FilterMode))
+ : INHERITED(procDataManager, texture, matrix,
+ GrTextureParams(tileModes, GrTextureParams::kNone_FilterMode))
, fDomain(GrTextureDomain::IgnoredDomain()) {
this->initClassID<GrBicubicEffect>();
convert_row_major_scalar_coeffs_to_column_major_floats(fCoefficients, coefficients);
}
-GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
+GrBicubicEffect::GrBicubicEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkScalar coefficients[16],
const SkMatrix &matrix,
const SkRect& domain)
- : INHERITED(texture, matrix, GrTextureParams(SkShader::kClamp_TileMode,
- GrTextureParams::kNone_FilterMode))
+ : INHERITED(procDataManager, texture, matrix,
+ GrTextureParams(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode))
, fDomain(domain, GrTextureDomain::kClamp_Mode) {
this->initClassID<GrBicubicEffect>();
convert_row_major_scalar_coeffs_to_column_major_floats(fCoefficients, coefficients);
@@ -187,7 +190,7 @@ GrFragmentProcessor* GrBicubicEffect::TestCreate(GrProcessorTestData* d) {
for (int i = 0; i < 16; i++) {
coefficients[i] = d->fRandom->nextSScalar1();
}
- return GrBicubicEffect::Create(d->fTextures[texIdx], coefficients);
+ return GrBicubicEffect::Create(d->fProcDataManager, d->fTextures[texIdx], coefficients);
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index b81c93e0a1..11075f2398 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -36,15 +36,16 @@ public:
/**
* Create a simple filter effect with custom bicubic coefficients and optional domain.
*/
- static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
- const SkRect* domain = NULL) {
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
+ const SkScalar coefficients[16],
+ const SkRect* domain = NULL) {
if (NULL == domain) {
static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode,
SkShader::kClamp_TileMode };
- return Create(tex, coefficients, GrCoordTransform::MakeDivByTextureWHMatrix(tex),
- kTileModes);
+ return Create(procDataManager, tex, coefficients,
+ GrCoordTransform::MakeDivByTextureWHMatrix(tex), kTileModes);
} else {
- return SkNEW_ARGS(GrBicubicEffect, (tex, coefficients,
+ return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, coefficients,
GrCoordTransform::MakeDivByTextureWHMatrix(tex),
*domain));
}
@@ -53,27 +54,29 @@ public:
/**
* Create a Mitchell filter effect with specified texture matrix and x/y tile modes.
*/
- static GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
- SkShader::TileMode tileModes[2]) {
- return Create(tex, gMitchellCoefficients, matrix, tileModes);
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
+ const SkMatrix& matrix,
+ SkShader::TileMode tileModes[2]) {
+ return Create(procDataManager, tex, gMitchellCoefficients, matrix, tileModes);
}
/**
* Create a filter effect with custom bicubic coefficients, the texture matrix, and the x/y
* tilemodes.
*/
- static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
- const SkMatrix& matrix,
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
+ const SkScalar coefficients[16], const SkMatrix& matrix,
const SkShader::TileMode tileModes[2]) {
- return SkNEW_ARGS(GrBicubicEffect, (tex, coefficients, matrix, tileModes));
+ return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, coefficients, matrix, tileModes));
}
/**
* Create a Mitchell filter effect with a texture matrix and a domain.
*/
- static GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
- const SkRect& domain) {
- return SkNEW_ARGS(GrBicubicEffect, (tex, gMitchellCoefficients, matrix, domain));
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
+ const SkMatrix& matrix, const SkRect& domain) {
+ return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, gMitchellCoefficients, matrix,
+ domain));
}
/**
@@ -87,9 +90,9 @@ public:
GrTextureParams::FilterMode* filterMode);
private:
- GrBicubicEffect(GrTexture*, const SkScalar coefficients[16],
+ GrBicubicEffect(GrProcessorDataManager*, GrTexture*, const SkScalar coefficients[16],
const SkMatrix &matrix, const SkShader::TileMode tileModes[2]);
- GrBicubicEffect(GrTexture*, const SkScalar coefficients[16],
+ GrBicubicEffect(GrProcessorDataManager*, GrTexture*, const SkScalar coefficients[16],
const SkMatrix &matrix, const SkRect& domain);
bool onIsEqual(const GrFragmentProcessor&) const override;
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 8b072f627b..4927e29f8a 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -100,11 +100,12 @@ private:
///////////////////////////////////////////////////////////////////////////////
-GrConfigConversionEffect::GrConfigConversionEffect(GrTexture* texture,
+GrConfigConversionEffect::GrConfigConversionEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
bool swapRedAndBlue,
PMConversion pmConversion,
const SkMatrix& matrix)
- : GrSingleTextureEffect(texture, matrix)
+ : INHERITED(procDataManager, texture, matrix)
, fSwapRedAndBlue(swapRedAndBlue)
, fPMConversion(pmConversion) {
this->initClassID<GrConfigConversionEffect>();
@@ -137,7 +138,8 @@ GrFragmentProcessor* GrConfigConversionEffect::TestCreate(GrProcessorTestData* d
swapRB = d->fRandom->nextBool();
}
return SkNEW_ARGS(GrConfigConversionEffect,
- (d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx],
+ (d->fProcDataManager,
+ d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx],
swapRB,
pmConv,
GrTest::TestMatrix(d->fRandom)));
@@ -220,17 +222,22 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
// from readTex to tempTex followed by a PM->UPM draw to readTex and finally read the data.
// We then verify that two reads produced the same values.
+ GrPaint paint1;
+ GrPaint paint2;
+ GrPaint paint3;
SkAutoTUnref<GrFragmentProcessor> pmToUPM1(
SkNEW_ARGS(GrConfigConversionEffect,
- (dataTex, false, *pmToUPMRule, SkMatrix::I())));
+ (paint1.getProcessorDataManager(), dataTex, false, *pmToUPMRule,
+ SkMatrix::I())));
SkAutoTUnref<GrFragmentProcessor> upmToPM(
SkNEW_ARGS(GrConfigConversionEffect,
- (readTex, false, *upmToPMRule, SkMatrix::I())));
+ (paint2.getProcessorDataManager(), readTex, false, *upmToPMRule,
+ SkMatrix::I())));
SkAutoTUnref<GrFragmentProcessor> pmToUPM2(
SkNEW_ARGS(GrConfigConversionEffect,
- (tempTex, false, *pmToUPMRule, SkMatrix::I())));
+ (paint3.getProcessorDataManager(), tempTex, false, *pmToUPMRule,
+ SkMatrix::I())));
- GrPaint paint1;
paint1.addColorProcessor(pmToUPM1);
drawContext->drawNonAARectToRect(readTex->asRenderTarget(),
GrClip::WideOpen(),
@@ -241,7 +248,6 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead);
- GrPaint paint2;
paint2.addColorProcessor(upmToPM);
drawContext->drawNonAARectToRect(tempTex->asRenderTarget(),
GrClip::WideOpen(),
@@ -250,7 +256,6 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
kDstRect,
kSrcRect);
- GrPaint paint3;
paint3.addColorProcessor(pmToUPM2);
drawContext->drawNonAARectToRect(readTex->asRenderTarget(),
GrClip::WideOpen(),
@@ -277,15 +282,16 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
}
}
-const GrFragmentProcessor* GrConfigConversionEffect::Create(GrTexture* texture,
- bool swapRedAndBlue,
- PMConversion pmConversion,
- const SkMatrix& matrix) {
+const GrFragmentProcessor* GrConfigConversionEffect::Create(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
+ bool swapRedAndBlue,
+ PMConversion pmConversion,
+ const SkMatrix& matrix) {
if (!swapRedAndBlue && kNone_PMConversion == pmConversion) {
// If we returned a GrConfigConversionEffect that was equivalent to a GrSimpleTextureEffect
// then we may pollute our texture cache with redundant shaders. So in the case that no
// conversions were requested we instead return a GrSimpleTextureEffect.
- return GrSimpleTextureEffect::Create(texture, matrix);
+ return GrSimpleTextureEffect::Create(procDataManager, texture, matrix);
} else {
if (kRGBA_8888_GrPixelConfig != texture->config() &&
kBGRA_8888_GrPixelConfig != texture->config() &&
@@ -293,7 +299,8 @@ const GrFragmentProcessor* GrConfigConversionEffect::Create(GrTexture* texture,
// The PM conversions assume colors are 0..255
return NULL;
}
- return SkNEW_ARGS(GrConfigConversionEffect, (texture,
+ return SkNEW_ARGS(GrConfigConversionEffect, (procDataManager,
+ texture,
swapRedAndBlue,
pmConversion,
matrix));
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h
index 3b471666f2..f00a284177 100644
--- a/src/gpu/effects/GrConfigConversionEffect.h
+++ b/src/gpu/effects/GrConfigConversionEffect.h
@@ -34,8 +34,8 @@ public:
kPMConversionCnt
};
- static const GrFragmentProcessor* Create(GrTexture*, bool swapRedAndBlue, PMConversion,
- const SkMatrix&);
+ static const GrFragmentProcessor* Create(GrProcessorDataManager*, GrTexture*,
+ bool swapRedAndBlue, PMConversion, const SkMatrix&);
const char* name() const override { return "Config Conversion"; }
@@ -56,10 +56,11 @@ public:
PMConversion* UPMToPMRule);
private:
- GrConfigConversionEffect(GrTexture*,
- bool swapRedAndBlue,
- PMConversion pmConversion,
- const SkMatrix& matrix);
+ GrConfigConversionEffect(GrProcessorDataManager*,
+ GrTexture*,
+ bool swapRedAndBlue,
+ PMConversion pmConversion,
+ const SkMatrix& matrix);
bool onIsEqual(const GrFragmentProcessor&) const override;
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 9f3c6c1170..f5b5e22ce1 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -154,13 +154,14 @@ void GrGLConvolutionEffect::GenKey(const GrProcessor& processor, const GrGLSLCap
///////////////////////////////////////////////////////////////////////////////
-GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
+GrConvolutionEffect::GrConvolutionEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
Direction direction,
int radius,
const float* kernel,
bool useBounds,
float bounds[2])
- : Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
+ : INHERITED(procDataManager, texture, direction, radius), fUseBounds(useBounds) {
this->initClassID<GrConvolutionEffect>();
SkASSERT(radius <= kMaxKernelRadius);
SkASSERT(kernel);
@@ -171,13 +172,14 @@ GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
memcpy(fBounds, bounds, sizeof(fBounds));
}
-GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
+GrConvolutionEffect::GrConvolutionEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
Direction direction,
int radius,
float gaussianSigma,
bool useBounds,
float bounds[2])
- : Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
+ : INHERITED(procDataManager, texture, direction, radius), fUseBounds(useBounds) {
this->initClassID<GrConvolutionEffect>();
SkASSERT(radius <= kMaxKernelRadius);
int width = this->width();
@@ -239,7 +241,8 @@ GrFragmentProcessor* GrConvolutionEffect::TestCreate(GrProcessorTestData* d) {
}
bool useBounds = d->fRandom->nextBool();
- return GrConvolutionEffect::Create(d->fTextures[texIdx],
+ return GrConvolutionEffect::Create(d->fProcDataManager,
+ d->fTextures[texIdx],
dir,
radius,
kernel,
diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h
index b885f19021..066da1975c 100644
--- a/src/gpu/effects/GrConvolutionEffect.h
+++ b/src/gpu/effects/GrConvolutionEffect.h
@@ -21,13 +21,15 @@ class GrConvolutionEffect : public Gr1DKernelEffect {
public:
/// Convolve with an arbitrary user-specified kernel
- static GrFragmentProcessor* Create(GrTexture* tex,
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
+ GrTexture* tex,
Direction dir,
int halfWidth,
const float* kernel,
bool useBounds,
float bounds[2]) {
- return SkNEW_ARGS(GrConvolutionEffect, (tex,
+ return SkNEW_ARGS(GrConvolutionEffect, (procDataManager,
+ tex,
dir,
halfWidth,
kernel,
@@ -36,13 +38,15 @@ public:
}
/// Convolve with a Gaussian kernel
- static GrFragmentProcessor* CreateGaussian(GrTexture* tex,
+ static GrFragmentProcessor* CreateGaussian(GrProcessorDataManager* procDataManager,
+ GrTexture* tex,
Direction dir,
int halfWidth,
float gaussianSigma,
bool useBounds,
float bounds[2]) {
- return SkNEW_ARGS(GrConvolutionEffect, (tex,
+ return SkNEW_ARGS(GrConvolutionEffect, (procDataManager,
+ tex,
dir,
halfWidth,
gaussianSigma,
@@ -81,14 +85,16 @@ protected:
float fBounds[2];
private:
- GrConvolutionEffect(GrTexture*, Direction,
+ GrConvolutionEffect(GrProcessorDataManager*,
+ GrTexture*, Direction,
int halfWidth,
const float* kernel,
bool useBounds,
float bounds[2]);
/// Convolve with a Gaussian kernel
- GrConvolutionEffect(GrTexture*, Direction,
+ GrConvolutionEffect(GrProcessorDataManager*,
+ GrTexture*, Direction,
int halfWidth,
float gaussianSigma,
bool useBounds,
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 0dd83b4632..24e78208d5 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -138,7 +138,8 @@ void GrGLMatrixConvolutionEffect::setData(const GrGLProgramDataManager& pdman,
fDomain.setData(pdman, conv.domain(), texture.origin());
}
-GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
+GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkIRect& bounds,
const SkISize& kernelSize,
const SkScalar* kernel,
@@ -147,7 +148,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture,
const SkIPoint& kernelOffset,
GrTextureDomain::Mode tileMode,
bool convolveAlpha)
- : INHERITED(texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)),
+ : INHERITED(procDataManager, texture, GrCoordTransform::MakeDivByTextureWHMatrix(texture)),
fKernelSize(kernelSize),
fGain(SkScalarToFloat(gain)),
fBias(SkScalarToFloat(bias) / 255.0f),
@@ -187,7 +188,8 @@ bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) cons
// Static function to create a 2D convolution
GrFragmentProcessor*
-GrMatrixConvolutionEffect::CreateGaussian(GrTexture* texture,
+GrMatrixConvolutionEffect::CreateGaussian(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkIRect& bounds,
const SkISize& kernelSize,
SkScalar gain,
@@ -223,7 +225,8 @@ GrMatrixConvolutionEffect::CreateGaussian(GrTexture* texture,
for (int i = 0; i < width * height; ++i) {
kernel[i] *= scale;
}
- return SkNEW_ARGS(GrMatrixConvolutionEffect, (texture,
+ return SkNEW_ARGS(GrMatrixConvolutionEffect, (procDataManager,
+ texture,
bounds,
kernelSize,
kernel,
@@ -257,7 +260,8 @@ GrFragmentProcessor* GrMatrixConvolutionEffect::TestCreate(GrProcessorTestData*
GrTextureDomain::Mode tileMode =
static_cast<GrTextureDomain::Mode>(d->fRandom->nextRangeU(0, 2));
bool convolveAlpha = d->fRandom->nextBool();
- return GrMatrixConvolutionEffect::Create(d->fTextures[texIdx],
+ return GrMatrixConvolutionEffect::Create(d->fProcDataManager,
+ d->fTextures[texIdx],
bounds,
kernelSize,
kernel.get(),
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.h b/src/gpu/effects/GrMatrixConvolutionEffect.h
index 6a340fbbd5..7a95df31b8 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.h
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.h
@@ -18,7 +18,8 @@
class GrMatrixConvolutionEffect : public GrSingleTextureEffect {
public:
- static GrFragmentProcessor* Create(GrTexture* texture,
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkIRect& bounds,
const SkISize& kernelSize,
const SkScalar* kernel,
@@ -27,7 +28,8 @@ public:
const SkIPoint& kernelOffset,
GrTextureDomain::Mode tileMode,
bool convolveAlpha) {
- return SkNEW_ARGS(GrMatrixConvolutionEffect, (texture,
+ return SkNEW_ARGS(GrMatrixConvolutionEffect, (procDataManager,
+ texture,
bounds,
kernelSize,
kernel,
@@ -38,7 +40,8 @@ public:
convolveAlpha));
}
- static GrFragmentProcessor* CreateGaussian(GrTexture* texture,
+ static GrFragmentProcessor* CreateGaussian(GrProcessorDataManager*,
+ GrTexture* texture,
const SkIRect& bounds,
const SkISize& kernelSize,
SkScalar gain,
@@ -67,7 +70,8 @@ public:
GrGLFragmentProcessor* createGLInstance() const override;
private:
- GrMatrixConvolutionEffect(GrTexture*,
+ GrMatrixConvolutionEffect(GrProcessorDataManager*,
+ GrTexture*,
const SkIRect& bounds,
const SkISize& kernelSize,
const SkScalar* kernel,
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 0f6f4032a4..c1b28116d8 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -77,5 +77,6 @@ GrFragmentProcessor* GrSimpleTextureEffect::TestCreate(GrProcessorTestData* d) {
GrCoordSet coordSet = kCoordSets[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kCoordSets))];
const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
- return GrSimpleTextureEffect::Create(d->fTextures[texIdx], matrix, coordSet);
+ return GrSimpleTextureEffect::Create(d->fProcDataManager, d->fTextures[texIdx], matrix,
+ coordSet);
}
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index 79e660f0a3..70d36224a5 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -23,26 +23,30 @@ class GrInvariantOutput;
class GrSimpleTextureEffect : public GrSingleTextureEffect {
public:
/* unfiltered, clamp mode */
- static GrFragmentProcessor* Create(GrTexture* tex,
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
+ GrTexture* tex,
const SkMatrix& matrix,
GrCoordSet coordSet = kLocal_GrCoordSet) {
- return SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, GrTextureParams::kNone_FilterMode,
- coordSet));
+ return SkNEW_ARGS(GrSimpleTextureEffect, (procDataManager, tex, matrix,
+ GrTextureParams::kNone_FilterMode, coordSet));
}
/* clamp mode */
- static GrFragmentProcessor* Create(GrTexture* tex,
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
+ GrTexture* tex,
const SkMatrix& matrix,
GrTextureParams::FilterMode filterMode,
GrCoordSet coordSet = kLocal_GrCoordSet) {
- return SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, filterMode, coordSet));
+ return SkNEW_ARGS(GrSimpleTextureEffect, (procDataManager, tex, matrix, filterMode,
+ coordSet));
}
- static GrFragmentProcessor* Create(GrTexture* tex,
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
+ GrTexture* tex,
const SkMatrix& matrix,
const GrTextureParams& p,
GrCoordSet coordSet = kLocal_GrCoordSet) {
- return SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, p, coordSet));
+ return SkNEW_ARGS(GrSimpleTextureEffect, (procDataManager, tex, matrix, p, coordSet));
}
virtual ~GrSimpleTextureEffect() {}
@@ -54,19 +58,21 @@ public:
GrGLFragmentProcessor* createGLInstance() const override;
private:
- GrSimpleTextureEffect(GrTexture* texture,
+ GrSimpleTextureEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkMatrix& matrix,
GrTextureParams::FilterMode filterMode,
GrCoordSet coordSet)
- : GrSingleTextureEffect(texture, matrix, filterMode, coordSet) {
+ : GrSingleTextureEffect(procDataManager, texture, matrix, filterMode, coordSet) {
this->initClassID<GrSimpleTextureEffect>();
}
- GrSimpleTextureEffect(GrTexture* texture,
+ GrSimpleTextureEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkMatrix& matrix,
const GrTextureParams& params,
GrCoordSet coordSet)
- : GrSingleTextureEffect(texture, matrix, params, coordSet) {
+ : GrSingleTextureEffect(procDataManager, texture, matrix, params, coordSet) {
this->initClassID<GrSimpleTextureEffect>();
}
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index c291735c0d..e4e20a9d2f 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -7,7 +7,8 @@
#include "effects/GrSingleTextureEffect.h"
-GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
+GrSingleTextureEffect::GrSingleTextureEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkMatrix& m,
GrCoordSet coordSet)
: fCoordTransform(coordSet, m, texture, GrTextureParams::kNone_FilterMode)
@@ -16,7 +17,8 @@ GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
this->addTextureAccess(&fTextureAccess);
}
-GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
+GrSingleTextureEffect::GrSingleTextureEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkMatrix& m,
GrTextureParams::FilterMode filterMode,
GrCoordSet coordSet)
@@ -26,7 +28,8 @@ GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
this->addTextureAccess(&fTextureAccess);
}
-GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
+GrSingleTextureEffect::GrSingleTextureEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkMatrix& m,
const GrTextureParams& params,
GrCoordSet coordSet)
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index 9df0cffa5a..cd952c4fcd 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -25,11 +25,14 @@ public:
protected:
/** unfiltered, clamp mode */
- GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoordSet);
+ GrSingleTextureEffect(GrProcessorDataManager*, GrTexture*, const SkMatrix&,
+ GrCoordSet = kLocal_GrCoordSet);
/** clamp mode */
- GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMode filterMode,
+ GrSingleTextureEffect(GrProcessorDataManager*, GrTexture*, const SkMatrix&,
+ GrTextureParams::FilterMode filterMode,
GrCoordSet = kLocal_GrCoordSet);
- GrSingleTextureEffect(GrTexture*,
+ GrSingleTextureEffect(GrProcessorDataManager*,
+ GrTexture*,
const SkMatrix&,
const GrTextureParams&,
GrCoordSet = kLocal_GrCoordSet);
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 31f51aad22..73eb8ff8ef 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -218,7 +218,8 @@ void GrGLTextureDomainEffect::GenKey(const GrProcessor& processor, const GrGLSLC
///////////////////////////////////////////////////////////////////////////////
-GrFragmentProcessor* GrTextureDomainEffect::Create(GrTexture* texture,
+GrFragmentProcessor* GrTextureDomainEffect::Create(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkMatrix& matrix,
const SkRect& domain,
GrTextureDomain::Mode mode,
@@ -227,10 +228,11 @@ GrFragmentProcessor* GrTextureDomainEffect::Create(GrTexture* texture,
static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1};
if (GrTextureDomain::kIgnore_Mode == mode ||
(GrTextureDomain::kClamp_Mode == mode && domain.contains(kFullRect))) {
- return GrSimpleTextureEffect::Create(texture, matrix, filterMode);
+ return GrSimpleTextureEffect::Create(procDataManager, texture, matrix, filterMode);
} else {
- return SkNEW_ARGS(GrTextureDomainEffect, (texture,
+ return SkNEW_ARGS(GrTextureDomainEffect, (procDataManager,
+ texture,
matrix,
domain,
mode,
@@ -239,13 +241,14 @@ GrFragmentProcessor* GrTextureDomainEffect::Create(GrTexture* texture,
}
}
-GrTextureDomainEffect::GrTextureDomainEffect(GrTexture* texture,
+GrTextureDomainEffect::GrTextureDomainEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
const SkMatrix& matrix,
const SkRect& domain,
GrTextureDomain::Mode mode,
GrTextureParams::FilterMode filterMode,
GrCoordSet coordSet)
- : GrSingleTextureEffect(texture, matrix, filterMode, coordSet)
+ : GrSingleTextureEffect(procDataManager, texture, matrix, filterMode, coordSet)
, fTextureDomain(domain, mode) {
SkASSERT(mode != GrTextureDomain::kRepeat_Mode ||
filterMode == GrTextureParams::kNone_FilterMode);
@@ -299,7 +302,8 @@ GrFragmentProcessor* GrTextureDomainEffect::TestCreate(GrProcessorTestData* d) {
const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoordSet;
- return GrTextureDomainEffect::Create(d->fTextures[texIdx],
+ return GrTextureDomainEffect::Create(d->fProcDataManager,
+ d->fTextures[texIdx],
matrix,
domain,
mode,
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index 161058037d..f9de4fa75e 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -157,7 +157,8 @@ protected:
class GrTextureDomainEffect : public GrSingleTextureEffect {
public:
- static GrFragmentProcessor* Create(GrTexture*,
+ static GrFragmentProcessor* Create(GrProcessorDataManager*,
+ GrTexture*,
const SkMatrix&,
const SkRect& domain,
GrTextureDomain::Mode,
@@ -178,7 +179,8 @@ protected:
GrTextureDomain fTextureDomain;
private:
- GrTextureDomainEffect(GrTexture*,
+ GrTextureDomainEffect(GrProcessorDataManager*,
+ GrTexture*,
const SkMatrix&,
const SkRect& domain,
GrTextureDomain::Mode,