| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkTableColorFilter.h" | 9 #include "SkTableColorFilter.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 if (fFlags & SkTable_ColorFilter::kA_Flag) { | 534 if (fFlags & SkTable_ColorFilter::kA_Flag) { |
| 535 invalidateFlags |= kA_GrColorComponentFlag; | 535 invalidateFlags |= kA_GrColorComponentFlag; |
| 536 } | 536 } |
| 537 inout->invalidateComponents(invalidateFlags, GrInvariantOutput::kWill_ReadIn
put); | 537 inout->invalidateComponents(invalidateFlags, GrInvariantOutput::kWill_ReadIn
put); |
| 538 } | 538 } |
| 539 | 539 |
| 540 /////////////////////////////////////////////////////////////////////////////// | 540 /////////////////////////////////////////////////////////////////////////////// |
| 541 | 541 |
| 542 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect); | 542 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect); |
| 543 | 543 |
| 544 GrFragmentProcessor* ColorTableEffect::TestCreate(GrProcessorTestData* d) { | 544 const GrFragmentProcessor* ColorTableEffect::TestCreate(GrProcessorTestData* d)
{ |
| 545 int flags = 0; | 545 int flags = 0; |
| 546 uint8_t luts[256][4]; | 546 uint8_t luts[256][4]; |
| 547 do { | 547 do { |
| 548 for (int i = 0; i < 4; ++i) { | 548 for (int i = 0; i < 4; ++i) { |
| 549 flags |= d->fRandom->nextBool() ? (1 << i): 0; | 549 flags |= d->fRandom->nextBool() ? (1 << i): 0; |
| 550 } | 550 } |
| 551 } while (!flags); | 551 } while (!flags); |
| 552 for (int i = 0; i < 4; ++i) { | 552 for (int i = 0; i < 4; ++i) { |
| 553 if (flags & (1 << i)) { | 553 if (flags & (1 << i)) { |
| 554 for (int j = 0; j < 256; ++j) { | 554 for (int j = 0; j < 256; ++j) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], | 611 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], |
| 612 const uint8_t tableR[256], | 612 const uint8_t tableR[256], |
| 613 const uint8_t tableG[256], | 613 const uint8_t tableG[256], |
| 614 const uint8_t tableB[256]) { | 614 const uint8_t tableB[256]) { |
| 615 return new SkTable_ColorFilter(tableA, tableR, tableG, tableB); | 615 return new SkTable_ColorFilter(tableA, tableR, tableG, tableB); |
| 616 } | 616 } |
| 617 | 617 |
| 618 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) | 618 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) |
| 619 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) | 619 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) |
| 620 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 620 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |