Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: src/gpu/effects/GrConfigConversionEffect.cpp

Issue 1230813003: More threading of GrProcessorDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConfigConversionEffect.cpp
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 8b072f627b6fe594830f2c9057e0c600eac51678..4927e29f8a4480514ccc2c050bc5b95845088660 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));
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698