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

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

Issue 1428543003: Create GLSL base class for ProgramDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add space Created 5 years, 2 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/GrTextureDomain.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrTextureDomain.cpp
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 93d3afb8c430aeae6599723e8c17ec4a746ae0d1..760fd575072c86ddb15e8fd67ae75eed1a7172ba 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -12,6 +12,7 @@
#include "gl/GrGLContext.h"
#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLProgramDataManager.h"
GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index)
: fIndex(index) {
@@ -142,12 +143,12 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLShaderBuilder* builder,
}
}
-void GrTextureDomain::GLDomain::setData(const GrGLProgramDataManager& pdman,
+void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman,
const GrTextureDomain& textureDomain,
GrSurfaceOrigin textureOrigin) {
SkASSERT(textureDomain.mode() == fMode);
if (kIgnore_Mode != textureDomain.mode()) {
- GrGLfloat values[kPrevDomainCount] = {
+ float values[kPrevDomainCount] = {
SkScalarToFloat(textureDomain.domain().left()),
SkScalarToFloat(textureDomain.domain().top()),
SkScalarToFloat(textureDomain.domain().right()),
@@ -161,9 +162,9 @@ void GrTextureDomain::GLDomain::setData(const GrGLProgramDataManager& pdman,
// of elements so that values = (l, t, r, b).
SkTSwap(values[1], values[3]);
}
- if (0 != memcmp(values, fPrevDomain, kPrevDomainCount * sizeof(GrGLfloat))) {
+ if (0 != memcmp(values, fPrevDomain, kPrevDomainCount * sizeof(float))) {
pdman.set4fv(fDomainUni, 1, values);
- memcpy(fPrevDomain, values, kPrevDomainCount * sizeof(GrGLfloat));
+ memcpy(fPrevDomain, values, kPrevDomainCount * sizeof(float));
}
}
}
@@ -180,7 +181,7 @@ public:
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
protected:
- void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override;
+ void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
private:
GrTextureDomain::GLDomain fGLDomain;
@@ -200,8 +201,8 @@ void GrGLTextureDomainEffect::emitCode(EmitArgs& args) {
args.fInputColor);
}
-void GrGLTextureDomainEffect::onSetData(const GrGLProgramDataManager& pdman,
- const GrProcessor& processor) {
+void GrGLTextureDomainEffect::onSetData(const GrGLSLProgramDataManager& pdman,
+ const GrProcessor& processor) {
const GrTextureDomainEffect& textureDomainEffect = processor.cast<GrTextureDomainEffect>();
const GrTextureDomain& domain = textureDomainEffect.textureDomain();
fGLDomain.setData(pdman, domain, processor.texture(0)->origin());
« no previous file with comments | « src/gpu/effects/GrTextureDomain.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698