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

Unified Diff: src/effects/gradients/SkGradientShader.cpp

Issue 769953002: Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkXfermodeImageFilter.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/SkGradientShader.cpp
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index d7b51440b346ee6d76142a34c041b746c881c402..e70be04697ca0db78fbea8e65172fa7b509cffe7 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -199,56 +199,6 @@ SkGradientShaderBase::SkGradientShaderBase(const Descriptor& desc)
this->initCommon();
}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
-static SkShader::TileMode unpack_mode(uint32_t packed) {
- return (SkShader::TileMode)(packed & 0xF);
-}
-
-static uint32_t unpack_flags(uint32_t packed) {
- return packed >> 4;
-}
-
-SkGradientShaderBase::SkGradientShaderBase(SkReadBuffer& buffer) : INHERITED(buffer) {
- int colorCount = fColorCount = buffer.getArrayCount();
- if (colorCount > kColorStorageCount) {
- size_t allocSize = (sizeof(SkColor) + sizeof(SkScalar) + sizeof(Rec)) * colorCount;
- if (buffer.validateAvailable(allocSize)) {
- fOrigColors = reinterpret_cast<SkColor*>(sk_malloc_throw(allocSize));
- } else {
- fOrigColors = NULL;
- colorCount = fColorCount = 0;
- }
- } else {
- fOrigColors = fStorage;
- }
- buffer.readColorArray(fOrigColors, colorCount);
-
- fOrigPos = (SkScalar*)(fOrigColors + colorCount);
-
- {
- uint32_t packed = buffer.readUInt();
- fGradFlags = SkToU8(unpack_flags(packed));
- fTileMode = unpack_mode(packed);
- }
- fTileProc = gTileProcs[fTileMode];
- fRecs = (Rec*)(fOrigPos + colorCount);
- if (colorCount > 2) {
- Rec* recs = fRecs;
- recs[0].fPos = 0;
- fOrigPos[0] = 0;
- for (int i = 1; i < colorCount; i++) {
- recs[i].fPos = buffer.readInt();
- recs[i].fScale = buffer.readUInt();
- fOrigPos[i] = SkFixedToScalar(recs[i].fPos);
- }
- } else {
- fOrigPos = NULL;
- }
- buffer.readMatrix(&fPtsToUnit);
- this->initCommon();
-}
-#endif
-
SkGradientShaderBase::~SkGradientShaderBase() {
if (fOrigColors != fStorage) {
sk_free(fOrigColors);
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698