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

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

Issue 2343253002: Support for color-spaces with multi-stop (texture) gradients (Closed)
Patch Set: Bug fixes Created 4 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 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 aeb1301c7f5b6725f30de62ecf215b52aed74cd1..9df24d2d7994bf7f877231fca0d0539b2a3c914a 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -175,7 +175,13 @@ public:
bool isOpaque() const override;
- void getGradientTableBitmap(SkBitmap*) const;
+ enum class GradientBitmapType : uint8_t {
+ kLegacy = 0,
+ kSRGB = 1,
+ kHalfFloat = 2,
f(malita) 2016/09/21 02:51:35 nit: do we actually care about these values being
Brian Osman 2016/09/21 13:24:18 Nope. Fixed.
+ };
+
+ void getGradientTableBitmap(SkBitmap*, GradientBitmapType bitmapType) const;
enum {
/// Seems like enough for visual accuracy. TODO: if pos[] deserves
@@ -214,6 +220,9 @@ protected:
bool onAsLuminanceColor(SkColor*) const override;
+
+ void initLinearBitmap(SkBitmap* bitmap) const;
+
/*
* Takes in pointers to gradient color and Rec info as colorSrc and recSrc respectively.
* Count is the number of colors in the gradient
@@ -490,6 +499,7 @@ private:
SkScalar fCachedYCoord;
GrGLSLProgramDataManager::UniformHandle fColorsUni;
GrGLSLProgramDataManager::UniformHandle fFSYUni;
+ GrGLSLProgramDataManager::UniformHandle fColorSpaceXformUni;
typedef GrGLSLFragmentProcessor INHERITED;
};
« src/effects/gradients/SkGradientShader.cpp ('K') | « src/effects/gradients/SkGradientShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698