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

Side by Side Diff: src/effects/gradients/SkGradientShader.cpp

Issue 1553103003: remove 565 effects shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove more hasspan16 checks Created 4 years, 11 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/core/SkPictureShader.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkGradientShaderPriv.h" 8 #include "SkGradientShaderPriv.h"
9 #include "SkLinearGradient.h" 9 #include "SkLinearGradient.h"
10 #include "SkRadialGradient.h" 10 #include "SkRadialGradient.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 fDstToIndexProc = fDstToIndex.getMapXYProc(); 307 fDstToIndexProc = fDstToIndex.getMapXYProc();
308 fDstToIndexClass = (uint8_t)SkShader::Context::ComputeMatrixClass(fDstToInde x); 308 fDstToIndexClass = (uint8_t)SkShader::Context::ComputeMatrixClass(fDstToInde x);
309 309
310 // now convert our colors in to PMColors 310 // now convert our colors in to PMColors
311 unsigned paintAlpha = this->getPaintAlpha(); 311 unsigned paintAlpha = this->getPaintAlpha();
312 312
313 fFlags = this->INHERITED::getFlags(); 313 fFlags = this->INHERITED::getFlags();
314 if (shader.fColorsAreOpaque && paintAlpha == 0xFF) { 314 if (shader.fColorsAreOpaque && paintAlpha == 0xFF) {
315 fFlags |= kOpaqueAlpha_Flag; 315 fFlags |= kOpaqueAlpha_Flag;
316 } 316 }
317 // we can do span16 as long as our individual colors are opaque,
318 // regardless of the paint's alpha
319 if (shader.fColorsAreOpaque) {
320 fFlags |= kHasSpan16_Flag;
321 }
322 } 317 }
323 318
324 SkGradientShaderBase::GradientShaderCache::GradientShaderCache( 319 SkGradientShaderBase::GradientShaderCache::GradientShaderCache(
325 U8CPU alpha, bool dither, const SkGradientShaderBase& shader) 320 U8CPU alpha, bool dither, const SkGradientShaderBase& shader)
326 : fCacheAlpha(alpha) 321 : fCacheAlpha(alpha)
327 , fCacheDither(dither) 322 , fCacheDither(dither)
328 , fShader(shader) 323 , fShader(shader)
329 , fCache16Inited(false) 324 , fCache16Inited(false)
330 , fCache32Inited(false) 325 , fCache32Inited(false)
331 { 326 {
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 (*stops)[i] = stop; 1205 (*stops)[i] = stop;
1211 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1206 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1212 } 1207 }
1213 } 1208 }
1214 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1209 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1215 1210
1216 return outColors; 1211 return outColors;
1217 } 1212 }
1218 1213
1219 #endif 1214 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698