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

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

Issue 23018003: Rename GrGLUniformManager to GrGLUniform and ref GrGLUniforms directly Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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/GrSimpleTextureEffect.cpp ('k') | src/gpu/gl/GrGLEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrTextureDomainEffect.cpp
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index eb4001d949dced54e9613900f7baf47726d51013..19e9d844c92dc050ae782e4b14c98e8b6bd9141b 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -23,12 +23,12 @@ public:
const char* inputColor,
const TextureSamplerArray&) SK_OVERRIDE;
- virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVERRIDE;
+ virtual void setData(const GrGLContext&, const GrDrawEffect&) SK_OVERRIDE;
static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&);
private:
- GrGLUniformManager::UniformHandle fNameUni;
+ GrGLUniform* fNameUni;
GrGLEffectMatrix fEffectMatrix;
GrGLfloat fPrevDomain[4];
@@ -38,7 +38,7 @@ private:
GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrBackendEffectFactory& factory,
const GrDrawEffect& drawEffect)
: INHERITED(factory)
- , fNameUni(GrGLUniformManager::kInvalidUniformHandle)
+ , fNameUni(NULL)
, fEffectMatrix(drawEffect.castEffect<GrTextureDomainEffect>().coordsType()) {
fPrevDomain[0] = SK_FloatNaN;
}
@@ -55,7 +55,7 @@ void GrGLTextureDomainEffect::emitCode(GrGLShaderBuilder* builder,
fEffectMatrix.emitCodeMakeFSCoords2D(builder, key, &coords);
const char* domain;
fNameUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType,
- kVec4f_GrSLType, "TexDom", &domain);
+ kVec4f_GrSLType, "TexDom", &domain)->glUniform();
if (GrTextureDomainEffect::kClamp_WrapMode == texDom.wrapMode()) {
builder->fsCodeAppendf("\tvec2 clampCoord = clamp(%s, %s.xy, %s.zw);\n",
@@ -105,7 +105,7 @@ void GrGLTextureDomainEffect::emitCode(GrGLShaderBuilder* builder,
}
}
-void GrGLTextureDomainEffect::setData(const GrGLUniformManager& uman,
+void GrGLTextureDomainEffect::setData(const GrGLContext& context,
const GrDrawEffect& drawEffect) {
const GrTextureDomainEffect& texDom = drawEffect.castEffect<GrTextureDomainEffect>();
const SkRect& domain = texDom.domain();
@@ -125,10 +125,10 @@ void GrGLTextureDomainEffect::setData(const GrGLUniformManager& uman,
SkTSwap(values[1], values[3]);
}
if (0 != memcmp(values, fPrevDomain, 4 * sizeof(GrGLfloat))) {
- uman.set4fv(fNameUni, 0, 1, values);
+ fNameUni->set4fv(context, 0, 1, values);
memcpy(fPrevDomain, values, 4 * sizeof(GrGLfloat));
}
- fEffectMatrix.setData(uman,
+ fEffectMatrix.setData(context,
texDom.getMatrix(),
drawEffect,
texDom.texture(0));
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/gl/GrGLEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698