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

Unified Diff: src/effects/gradients/SkGradientShaderPriv.h

Issue 761643002: remove one place we read from gpu key in effects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: src/effects/gradients/SkGradientShaderPriv.h
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index 20f8112ecdbce62f920df7fe997879538e45c614..2ec78e727dc3b98eabcc36db80f7c47aee848a56 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -417,15 +417,15 @@ protected:
// Emits the uniform used as the y-coord to texture samples in derived classes. Subclasses
// should call this method from their emitCode().
- void emitUniforms(GrGLFPBuilder* builder, uint32_t baseKey);
+ void emitUniforms(GrGLFPBuilder* builder, const GrGradientEffect&);
// emit code that gets a fragment's color from an expression for t; Has branches for 3 separate
// control flows inside -- 2 color gradients, 3 color symmetric gradients (both using
// native GLSL mix), and 4+ color gradients that use the traditional texture lookup.
void emitColor(GrGLFPBuilder* builder,
+ const GrGradientEffect&,
const char* gradientTValue,
- uint32_t baseKey,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers);
@@ -447,22 +447,6 @@ private:
};
GR_STATIC_ASSERT(kBaseKeyBitCnt <= 32);
- static SkGradientShaderBase::GpuColorType ColorTypeFromKey(uint32_t baseKey){
- if (kTwoColorKey == (baseKey & kColorKeyMask)) {
- return SkGradientShaderBase::kTwo_GpuColorType;
- } else if (kThreeColorKey == (baseKey & kColorKeyMask)) {
- return SkGradientShaderBase::kThree_GpuColorType;
- } else {return SkGradientShaderBase::kTexture_GpuColorType;}
- }
-
- static GrGradientEffect::PremulType PremulTypeFromKey(uint32_t baseKey){
- if (kPremulBeforeInterpKey == (baseKey & kPremulTypeMask)) {
- return GrGradientEffect::kBeforeInterp_PremulType;
- } else {
- return GrGradientEffect::kAfterInterp_PremulType;
- }
- }
-
SkScalar fCachedYCoord;
GrGLProgramDataManager::UniformHandle fFSYUni;
GrGLProgramDataManager::UniformHandle fColorStartUni;

Powered by Google App Engine
This is Rietveld 408576698