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

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

Issue 234833003: Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/effects/SkTransparentShader.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 510 }
511 return fCache16; 511 return fCache16;
512 } 512 }
513 513
514 const SkPMColor* SkGradientShaderBase::getCache32() const { 514 const SkPMColor* SkGradientShaderBase::getCache32() const {
515 if (fCache32 == NULL) { 515 if (fCache32 == NULL) {
516 SkImageInfo info; 516 SkImageInfo info;
517 info.fWidth = kCache32Count; 517 info.fWidth = kCache32Count;
518 info.fHeight = 4; // for our 4 dither rows 518 info.fHeight = 4; // for our 4 dither rows
519 info.fAlphaType = kPremul_SkAlphaType; 519 info.fAlphaType = kPremul_SkAlphaType;
520 info.fColorType = kN32_SkColorType; 520 info.fColorType = kPMColor_SkColorType;
521 521
522 if (NULL == fCache32PixelRef) { 522 if (NULL == fCache32PixelRef) {
523 fCache32PixelRef = SkMallocPixelRef::NewAllocate(info, 0, NULL); 523 fCache32PixelRef = SkMallocPixelRef::NewAllocate(info, 0, NULL);
524 } 524 }
525 fCache32 = (SkPMColor*)fCache32PixelRef->getAddr(); 525 fCache32 = (SkPMColor*)fCache32PixelRef->getAddr();
526 if (fColorCount == 2) { 526 if (fColorCount == 2) {
527 Build32bitCache(fCache32, fOrigColors[0], fOrigColors[1], 527 Build32bitCache(fCache32, fOrigColors[0], fOrigColors[1],
528 kCache32Count, fCacheAlpha, fGradFlags); 528 kCache32Count, fCacheAlpha, fGradFlags);
529 } else { 529 } else {
530 Rec* rec = fRecs; 530 Rec* rec = fRecs;
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 (*stops)[i] = stop; 1133 (*stops)[i] = stop;
1134 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1134 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1135 } 1135 }
1136 } 1136 }
1137 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1137 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1138 1138
1139 return outColors; 1139 return outColors;
1140 } 1140 }
1141 1141
1142 #endif 1142 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTransparentShader.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698