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

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

Issue 2370063002: Gradients are serialized (and can be constructed) as SkColor4f + SkColorSpace (Closed)
Patch Set: Widen storage for flags. Shift used bits to be contiguous. Document layout. 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
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkGradientShaderPriv.h
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index 4e6a325c8a5f178392731d127e5f59877c621278..df7ac786f47e3940950af7ebbd4d19caf7a11606 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -84,8 +84,7 @@ public:
}
const SkMatrix* fLocalMatrix;
- const SkColor* fColors;
- const SkColor4f* fColors4f;
+ const SkColor4f* fColors;
sk_sp<SkColorSpace> fColorSpace;
const SkScalar* fPos;
int fCount;
@@ -103,14 +102,14 @@ public:
// fColors and fPos always point into local memory, so they can be safely mutated
//
- SkColor* mutableColors() { return const_cast<SkColor*>(fColors); }
+ SkColor4f* mutableColors() { return const_cast<SkColor4f*>(fColors); }
SkScalar* mutablePos() { return const_cast<SkScalar*>(fPos); }
private:
enum {
kStorageCount = 16
};
- SkColor fColorStorage[kStorageCount];
+ SkColor4f fColorStorage[kStorageCount];
SkScalar fPosStorage[kStorageCount];
SkMatrix fLocalMatrixStorage;
SkAutoMalloc fDynamicStorage;
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698