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

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

Issue 759653004: Update invariant output computation for various texture effects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/effects/SkAlphaThresholdFilter.cpp ('k') | src/gpu/effects/GrSingleTextureEffect.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 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 "GrInvariantOutput.h"
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 kVec2f_GrSLType, 61 kVec2f_GrSLType,
62 GrShaderVar::kAttribute _TypeModifier))) { 62 GrShaderVar::kAttribute _TypeModifier))) {
63 this->addTextureAccess(&fTextureAccess); 63 this->addTextureAccess(&fTextureAccess);
64 } 64 }
65 65
66 bool GrCustomCoordsTextureEffect::onIsEqual(const GrGeometryProcessor& other) co nst { 66 bool GrCustomCoordsTextureEffect::onIsEqual(const GrGeometryProcessor& other) co nst {
67 return true; 67 return true;
68 } 68 }
69 69
70 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(GrInvariantOutput* in out) const { 70 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(GrInvariantOutput* in out) const {
71 if (GrPixelConfigIsOpaque(this->texture(0)->config())) { 71 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) {
72 inout->mulByUnknownAlpha();
73 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) {
72 inout->mulByUnknownOpaqueColor(); 74 inout->mulByUnknownOpaqueColor();
73 } else { 75 } else {
74 inout->mulByUnknownColor(); 76 inout->mulByUnknownColor();
75 } 77 }
76 } 78 }
77 79
78 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory () const { 80 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory () const {
79 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI nstance(); 81 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI nstance();
80 } 82 }
81 83
(...skipping 14 matching lines...) Expand all
96 }; 98 };
97 SkShader::TileMode tileModes[] = { 99 SkShader::TileMode tileModes[] = {
98 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 100 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
99 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 101 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
100 }; 102 };
101 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode : 103 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode :
102 GrTextureParams::kNon e_FilterMode); 104 GrTextureParams::kNon e_FilterMode);
103 105
104 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); 106 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params);
105 } 107 }
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/gpu/effects/GrSingleTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698