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

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

Issue 631183003: Revert of gl programs rewrite (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « include/gpu/GrTypes.h ('k') | src/gpu/GrDrawState.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 "SkBlitRow.h" 8 #include "SkBlitRow.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 399
400 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ModeColorFilterEffect); 400 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ModeColorFilterEffect);
401 GrFragmentProcessor* ModeColorFilterEffect::TestCreate(SkRandom* rand, 401 GrFragmentProcessor* ModeColorFilterEffect::TestCreate(SkRandom* rand,
402 GrContext*, 402 GrContext*,
403 const GrDrawTargetCaps&, 403 const GrDrawTargetCaps&,
404 GrTexture*[]) { 404 GrTexture*[]) {
405 SkXfermode::Mode mode = SkXfermode::kDst_Mode; 405 SkXfermode::Mode mode = SkXfermode::kDst_Mode;
406 while (SkXfermode::kDst_Mode == mode) { 406 while (SkXfermode::kDst_Mode == mode) {
407 mode = static_cast<SkXfermode::Mode>(rand->nextRangeU(0, SkXfermode::kLa stCoeffMode)); 407 mode = static_cast<SkXfermode::Mode>(rand->nextRangeU(0, SkXfermode::kLa stCoeffMode));
408 } 408 }
409 409 GrColor color = rand->nextU();
410 // pick a random premul color
411 uint8_t alpha = rand->nextULessThan(256);
412 GrColor color = GrColorPackRGBA(rand->nextRangeU(0, alpha),
413 rand->nextRangeU(0, alpha),
414 rand->nextRangeU(0, alpha),
415 alpha);
416 return ModeColorFilterEffect::Create(color, mode); 410 return ModeColorFilterEffect::Create(color, mode);
417 } 411 }
418 412
419 GrFragmentProcessor* SkModeColorFilter::asFragmentProcessor(GrContext*) const { 413 GrFragmentProcessor* SkModeColorFilter::asFragmentProcessor(GrContext*) const {
420 if (SkXfermode::kDst_Mode != fMode) { 414 if (SkXfermode::kDst_Mode != fMode) {
421 return ModeColorFilterEffect::Create(SkColor2GrColor(fColor), fMode); 415 return ModeColorFilterEffect::Create(SkColor2GrColor(fColor), fMode);
422 } 416 }
423 return NULL; 417 return NULL;
424 } 418 }
425 419
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), 546 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)),
553 SkIntToScalar(SkColorGetG(add)), 547 SkIntToScalar(SkColorGetG(add)),
554 SkIntToScalar(SkColorGetB(add)), 548 SkIntToScalar(SkColorGetB(add)),
555 0); 549 0);
556 return SkColorMatrixFilter::Create(matrix); 550 return SkColorMatrixFilter::Create(matrix);
557 } 551 }
558 552
559 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter) 553 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter)
560 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter) 554 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkModeColorFilter)
561 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 555 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698