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

Side by Side Diff: src/gpu/effects/GrSimpleTextureEffect.cpp

Issue 23464082: Revert "Add a requiresVertexShader method to GrGLEffect" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/gl/GrGLEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrSimpleTextureEffect.h" 8 #include "GrSimpleTextureEffect.h"
9 #include "gl/GrGLEffect.h" 9 #include "gl/GrGLEffect.h"
10 #include "gl/GrGLEffectMatrix.h" 10 #include "gl/GrGLEffectMatrix.h"
11 #include "gl/GrGLSL.h" 11 #include "gl/GrGLSL.h"
12 #include "gl/GrGLTexture.h" 12 #include "gl/GrGLTexture.h"
13 #include "GrTBackendEffectFactory.h" 13 #include "GrTBackendEffectFactory.h"
14 #include "GrTexture.h" 14 #include "GrTexture.h"
15 15
16 class GrGLSimpleTextureEffect : public GrGLEffect { 16 class GrGLSimpleTextureEffect : public GrGLEffect {
17 public: 17 public:
18 GrGLSimpleTextureEffect(const GrBackendEffectFactory& factory, const GrDrawE ffect& drawEffect) 18 GrGLSimpleTextureEffect(const GrBackendEffectFactory& factory, const GrDrawE ffect& drawEffect)
19 : INHERITED (factory) { 19 : INHERITED (factory) {
20 GrEffect::CoordsType coordsType = 20 GrEffect::CoordsType coordsType =
21 drawEffect.castEffect<GrSimpleTextureEffect>().coordsType(); 21 drawEffect.castEffect<GrSimpleTextureEffect>().coordsType();
22 if (GrEffect::kCustom_CoordsType != coordsType) { 22 if (GrEffect::kCustom_CoordsType != coordsType) {
23 SkNEW_IN_TLAZY(&fEffectMatrix, GrGLEffectMatrix, (coordsType)); 23 SkNEW_IN_TLAZY(&fEffectMatrix, GrGLEffectMatrix, (coordsType));
24 } 24 }
25 } 25 }
26 26
27 virtual bool requiresVertexShader(const GrDrawEffect& drawEffect) const SK_O VERRIDE {
28 const GrSimpleTextureEffect& ste = drawEffect.castEffect<GrSimpleTexture Effect>();
29 return GrEffect::kCustom_CoordsType == ste.coordsType();
30 }
31
32 virtual void emitCode(GrGLShaderBuilder* builder, 27 virtual void emitCode(GrGLShaderBuilder* builder,
33 const GrDrawEffect& drawEffect, 28 const GrDrawEffect& drawEffect,
34 EffectKey key, 29 EffectKey key,
35 const char* outputColor, 30 const char* outputColor,
36 const char* inputColor, 31 const char* inputColor,
37 const TextureSamplerArray& samplers) SK_OVERRIDE { 32 const TextureSamplerArray& samplers) SK_OVERRIDE {
38 const GrSimpleTextureEffect& ste = drawEffect.castEffect<GrSimpleTexture Effect>(); 33 const GrSimpleTextureEffect& ste = drawEffect.castEffect<GrSimpleTexture Effect>();
39 SkString fsCoordName; 34 SkString fsCoordName;
40 GrSLType fsCoordSLType; 35 GrSLType fsCoordSLType;
41 if (GrEffect::kCustom_CoordsType == ste.coordsType()) { 36 if (GrEffect::kCustom_CoordsType == ste.coordsType()) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 }; 123 };
129 CoordsType coordsType = kCoordsTypes[random->nextULessThan(GR_ARRAY_COUNT(kC oordsTypes))]; 124 CoordsType coordsType = kCoordsTypes[random->nextULessThan(GR_ARRAY_COUNT(kC oordsTypes))];
130 125
131 if (kCustom_CoordsType == coordsType) { 126 if (kCustom_CoordsType == coordsType) {
132 return GrSimpleTextureEffect::CreateWithCustomCoords(textures[texIdx], p arams); 127 return GrSimpleTextureEffect::CreateWithCustomCoords(textures[texIdx], p arams);
133 } else { 128 } else {
134 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); 129 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random);
135 return GrSimpleTextureEffect::Create(textures[texIdx], matrix); 130 return GrSimpleTextureEffect::Create(textures[texIdx], matrix);
136 } 131 }
137 } 132 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/gl/GrGLEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698