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

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

Issue 24853002: Make GPU coord transforms automatic (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 3 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/GrBicubicEffect.cpp ('k') | src/gpu/effects/GrConvolutionEffect.cpp » ('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 935e074e03dbb85aba40b9b0ba6eb8c042fb0cb7..daf51414f2943a72050bafeb9f530f03590ea6f3 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -10,15 +10,13 @@
#include "GrTBackendEffectFactory.h"
#include "GrSimpleTextureEffect.h"
#include "gl/GrGLEffect.h"
-#include "gl/GrGLEffectMatrix.h"
#include "SkMatrix.h"
class GrGLConfigConversionEffect : public GrGLEffect {
public:
GrGLConfigConversionEffect(const GrBackendEffectFactory& factory,
const GrDrawEffect& drawEffect)
- : INHERITED (factory)
- , fEffectMatrix(drawEffect.castEffect<GrConfigConversionEffect>().coordsType()) {
+ : INHERITED (factory) {
const GrConfigConversionEffect& effect = drawEffect.castEffect<GrConfigConversionEffect>();
fSwapRedAndBlue = effect.swapsRedAndBlue();
fPMConversion = effect.pmConversion();
@@ -29,11 +27,10 @@ public:
EffectKey key,
const char* outputColor,
const char* inputColor,
+ const TransformedCoordsArray& coords,
const TextureSamplerArray& samplers) SK_OVERRIDE {
- SkString coords;
- GrSLType coordsType = fEffectMatrix.emitCode(builder, key, &coords);
builder->fsCodeAppendf("\t\t%s = ", outputColor);
- builder->fsAppendTextureLookup(samplers[0], coords.c_str(), coordsType);
+ builder->fsAppendTextureLookup(samplers[0], coords[0].c_str(), coords[0].type());
builder->fsCodeAppend(";\n");
if (GrConfigConversionEffect::kNone_PMConversion == fPMConversion) {
SkASSERT(fSwapRedAndBlue);
@@ -73,27 +70,14 @@ public:
builder->fsCodeAppend(modulate.c_str());
}
- void setData(const GrGLUniformManager& uman, const GrDrawEffect& drawEffect) {
- const GrConfigConversionEffect& conv = drawEffect.castEffect<GrConfigConversionEffect>();
- fEffectMatrix.setData(uman, conv.getMatrix(), drawEffect, conv.texture(0));
- }
-
static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) {
const GrConfigConversionEffect& conv = drawEffect.castEffect<GrConfigConversionEffect>();
- EffectKey key = static_cast<EffectKey>(conv.swapsRedAndBlue()) | (conv.pmConversion() << 1);
- key <<= GrGLEffectMatrix::kKeyBits;
- EffectKey matrixKey = GrGLEffectMatrix::GenKey(conv.getMatrix(),
- drawEffect,
- conv.coordsType(),
- conv.texture(0));
- SkASSERT(!(matrixKey & key));
- return matrixKey | key;
+ return static_cast<EffectKey>(conv.swapsRedAndBlue()) | (conv.pmConversion() << 1);
}
private:
bool fSwapRedAndBlue;
GrConfigConversionEffect::PMConversion fPMConversion;
- GrGLEffectMatrix fEffectMatrix;
typedef GrGLEffect INHERITED;
« no previous file with comments | « src/gpu/effects/GrBicubicEffect.cpp ('k') | src/gpu/effects/GrConvolutionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698