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

Side by Side Diff: src/effects/SkColorFilters.cpp

Issue 1316513002: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Address comments, fix roll(?) Created 5 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 unified diff | Download patch
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkColorMatrixFilter.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 "SkBlitRow.h" 8 #include "SkBlitRow.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 GrInvariantOutput::ReadInput readInput = GrInvariantOutput::kWill_ReadInput; 332 GrInvariantOutput::ReadInput readInput = GrInvariantOutput::kWill_ReadInput;
333 // These could be calculated from the blend equation with template trickery. . 333 // These could be calculated from the blend equation with template trickery. .
334 if (SkXfermode::kZero_Coeff == dstCoeff && 334 if (SkXfermode::kZero_Coeff == dstCoeff &&
335 !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) { 335 !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) {
336 readInput = GrInvariantOutput::kWillNot_ReadInput; 336 readInput = GrInvariantOutput::kWillNot_ReadInput;
337 } 337 }
338 inout->setToOther(result.getValidComponents(), result.getColor(), readInput) ; 338 inout->setToOther(result.getValidComponents(), result.getColor(), readInput) ;
339 } 339 }
340 340
341 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ModeColorFilterEffect); 341 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ModeColorFilterEffect);
342 GrFragmentProcessor* ModeColorFilterEffect::TestCreate(GrProcessorTestData* d) { 342 const GrFragmentProcessor* ModeColorFilterEffect::TestCreate(GrProcessorTestData * d) {
343 SkXfermode::Mode mode = SkXfermode::kDst_Mode; 343 SkXfermode::Mode mode = SkXfermode::kDst_Mode;
344 while (SkXfermode::kDst_Mode == mode) { 344 while (SkXfermode::kDst_Mode == mode) {
345 mode = static_cast<SkXfermode::Mode>(d->fRandom->nextRangeU(0, SkXfermod e::kLastCoeffMode)); 345 mode = static_cast<SkXfermode::Mode>(d->fRandom->nextRangeU(0, SkXfermod e::kLastCoeffMode));
346 } 346 }
347 347
348 // pick a random premul color 348 // pick a random premul color
349 uint8_t alpha = d->fRandom->nextULessThan(256); 349 uint8_t alpha = d->fRandom->nextULessThan(256);
350 GrColor color = GrColorPackRGBA(d->fRandom->nextRangeU(0, alpha), 350 GrColor color = GrColorPackRGBA(d->fRandom->nextRangeU(0, alpha),
351 d->fRandom->nextRangeU(0, alpha), 351 d->fRandom->nextRangeU(0, alpha),
352 d->fRandom->nextRangeU(0, alpha), 352 d->fRandom->nextRangeU(0, alpha),
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 byte_to_scale(SkColorGetG(mul)), 461 byte_to_scale(SkColorGetG(mul)),
462 byte_to_scale(SkColorGetB(mul)), 462 byte_to_scale(SkColorGetB(mul)),
463 1); 463 1);
464 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), 464 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)),
465 SkIntToScalar(SkColorGetG(add)), 465 SkIntToScalar(SkColorGetG(add)),
466 SkIntToScalar(SkColorGetB(add)), 466 SkIntToScalar(SkColorGetB(add)),
467 0); 467 0);
468 return SkColorMatrixFilter::Create(matrix); 468 return SkColorMatrixFilter::Create(matrix);
469 } 469 }
470 470
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698