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

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

Issue 699943003: Move GrInvariantOutput out of GrProcessor and into its own class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanup Created 6 years, 1 month 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
« no previous file with comments | « src/gpu/effects/GrCustomCoordsTextureEffect.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('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 2013 Google Inc. 2 * Copyright 2013 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 "GrCustomCoordsTextureEffect.h" 8 #include "GrCustomCoordsTextureEffect.h"
9 #include "GrInvariantOutput.h"
9 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
10 #include "gl/GrGLProcessor.h" 11 #include "gl/GrGLProcessor.h"
11 #include "gl/GrGLSL.h" 12 #include "gl/GrGLSL.h"
12 #include "gl/GrGLTexture.h" 13 #include "gl/GrGLTexture.h"
13 #include "gl/GrGLGeometryProcessor.h" 14 #include "gl/GrGLGeometryProcessor.h"
14 #include "GrTBackendProcessorFactory.h" 15 #include "GrTBackendProcessorFactory.h"
15 #include "GrTexture.h" 16 #include "GrTexture.h"
16 17
17 class GrGLCustomCoordsTextureEffect : public GrGLGeometryProcessor { 18 class GrGLCustomCoordsTextureEffect : public GrGLGeometryProcessor {
18 public: 19 public:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 , fInTextureCoords(this->addVertexAttrib(GrShaderVar("inTextureCoords", 60 , fInTextureCoords(this->addVertexAttrib(GrShaderVar("inTextureCoords",
60 kVec2f_GrSLType, 61 kVec2f_GrSLType,
61 GrShaderVar::kAttribute _TypeModifier))) { 62 GrShaderVar::kAttribute _TypeModifier))) {
62 this->addTextureAccess(&fTextureAccess); 63 this->addTextureAccess(&fTextureAccess);
63 } 64 }
64 65
65 bool GrCustomCoordsTextureEffect::onIsEqual(const GrGeometryProcessor& other) co nst { 66 bool GrCustomCoordsTextureEffect::onIsEqual(const GrGeometryProcessor& other) co nst {
66 return true; 67 return true;
67 } 68 }
68 69
69 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(InvariantOutput* inou t) const { 70 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(GrInvariantOutput* in out) const {
70 if (GrPixelConfigIsOpaque(this->texture(0)->config())) { 71 if (GrPixelConfigIsOpaque(this->texture(0)->config())) {
71 inout->mulByUnknownOpaqueColor(); 72 inout->mulByUnknownOpaqueColor();
72 } else { 73 } else {
73 inout->mulByUnknownColor(); 74 inout->mulByUnknownColor();
74 } 75 }
75 } 76 }
76 77
77 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory () const { 78 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory () const {
78 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI nstance(); 79 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI nstance();
79 } 80 }
(...skipping 15 matching lines...) Expand all
95 }; 96 };
96 SkShader::TileMode tileModes[] = { 97 SkShader::TileMode tileModes[] = {
97 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 98 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
98 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 99 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
99 }; 100 };
100 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode : 101 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode :
101 GrTextureParams::kNon e_FilterMode); 102 GrTextureParams::kNon e_FilterMode);
102 103
103 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); 104 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params);
104 } 105 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrCustomCoordsTextureEffect.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698