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

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

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter Created 6 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 unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.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 "gl/builders/GrGLProgramBuilder.h" 9 #include "gl/builders/GrGLProgramBuilder.h"
10 #include "gl/GrGLProcessor.h" 10 #include "gl/GrGLProcessor.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 GrShaderVar::kAttribute _TypeModifier))) { 66 GrShaderVar::kAttribute _TypeModifier))) {
67 this->addTextureAccess(&fTextureAccess); 67 this->addTextureAccess(&fTextureAccess);
68 } 68 }
69 69
70 bool GrCustomCoordsTextureEffect::onIsEqual(const GrProcessor& other) const { 70 bool GrCustomCoordsTextureEffect::onIsEqual(const GrProcessor& other) const {
71 const GrCustomCoordsTextureEffect& cte = other.cast<GrCustomCoordsTextureEff ect>(); 71 const GrCustomCoordsTextureEffect& cte = other.cast<GrCustomCoordsTextureEff ect>();
72 return fTextureAccess == cte.fTextureAccess; 72 return fTextureAccess == cte.fTextureAccess;
73 } 73 }
74 74
75 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(InvariantOutput* inou t) const { 75 void GrCustomCoordsTextureEffect::onComputeInvariantOutput(InvariantOutput* inou t) const {
76 if (inout->isOpaque() && GrPixelConfigIsOpaque(this->texture(0)->config())) { 76 if (GrPixelConfigIsOpaque(this->texture(0)->config())) {
77 inout->fValidFlags = kA_GrColorComponentFlag; 77 inout->mulByUnknownOpaqueColor();
78 } else { 78 } else {
79 inout->fValidFlags = 0; 79 inout->mulByUnknownColor();
80 } 80 }
81 inout->fIsSingleComponent = false;
82 } 81 }
83 82
84 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory () const { 83 const GrBackendGeometryProcessorFactory& GrCustomCoordsTextureEffect::getFactory () const {
85 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI nstance(); 84 return GrTBackendGeometryProcessorFactory<GrCustomCoordsTextureEffect>::getI nstance();
86 } 85 }
87 86
88 /////////////////////////////////////////////////////////////////////////////// 87 ///////////////////////////////////////////////////////////////////////////////
89 88
90 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCustomCoordsTextureEffect); 89 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCustomCoordsTextureEffect);
91 90
(...skipping 10 matching lines...) Expand all
102 }; 101 };
103 SkShader::TileMode tileModes[] = { 102 SkShader::TileMode tileModes[] = {
104 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 103 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
105 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], 104 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
106 }; 105 };
107 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode : 106 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil erp_FilterMode :
108 GrTextureParams::kNon e_FilterMode); 107 GrTextureParams::kNon e_FilterMode);
109 108
110 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); 109 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params);
111 } 110 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698