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

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

Issue 287193006: Fix compilation error when building with clang on Linux. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 b += db; 477 b += db;
478 } while (--count != 0); 478 } while (--count != 0);
479 } 479 }
480 } 480 }
481 481
482 static inline int SkFixedToFFFF(SkFixed x) { 482 static inline int SkFixedToFFFF(SkFixed x) {
483 SkASSERT((unsigned)x <= SK_Fixed1); 483 SkASSERT((unsigned)x <= SK_Fixed1);
484 return x - (x >> 16); 484 return x - (x >> 16);
485 } 485 }
486 486
487 static inline U16CPU bitsTo16(unsigned x, const unsigned bits) {
488 SkASSERT(x < (1U << bits));
489 if (6 == bits) {
490 return (x << 10) | (x << 4) | (x >> 2);
491 }
492 if (8 == bits) {
493 return (x << 8) | x;
494 }
495 sk_throw();
496 return 0;
497 }
498
499 const uint16_t* SkGradientShaderBase::GradientShaderCache::getCache16() { 487 const uint16_t* SkGradientShaderBase::GradientShaderCache::getCache16() {
500 SkOnce(&fCache16Inited, &fCache16Mutex, SkGradientShaderBase::GradientShader Cache::initCache16, 488 SkOnce(&fCache16Inited, &fCache16Mutex, SkGradientShaderBase::GradientShader Cache::initCache16,
501 this); 489 this);
502 SkASSERT(fCache16); 490 SkASSERT(fCache16);
503 return fCache16; 491 return fCache16;
504 } 492 }
505 493
506 void SkGradientShaderBase::GradientShaderCache::initCache16(GradientShaderCache* cache) { 494 void SkGradientShaderBase::GradientShaderCache::initCache16(GradientShaderCache* cache) {
507 // double the count for dither entries 495 // double the count for dither entries
508 const int entryCount = kCache16Count * 2; 496 const int entryCount = kCache16Count * 2;
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 (*stops)[i] = stop; 1149 (*stops)[i] = stop;
1162 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1150 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1163 } 1151 }
1164 } 1152 }
1165 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1153 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1166 1154
1167 return outColors; 1155 return outColors;
1168 } 1156 }
1169 1157
1170 #endif 1158 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698