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

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

Issue 1213613016: More threading of GrShaderDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@GrShaderDataManager
Patch Set: build issue Created 5 years, 5 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/SkLumaColorFilter.cpp ('k') | src/gpu/SkGr.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 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 virtual ~SkTable_ColorFilter() { 45 virtual ~SkTable_ColorFilter() {
46 SkDELETE(fBitmap); 46 SkDELETE(fBitmap);
47 } 47 }
48 48
49 bool asComponentTable(SkBitmap* table) const override; 49 bool asComponentTable(SkBitmap* table) const override;
50 SkColorFilter* newComposed(const SkColorFilter* inner) const override; 50 SkColorFilter* newComposed(const SkColorFilter* inner) const override;
51 51
52 #if SK_SUPPORT_GPU 52 #if SK_SUPPORT_GPU
53 bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) cons t override; 53 bool asFragmentProcessors(GrContext*, GrShaderDataManager*,
54 SkTDArray<GrFragmentProcessor*>*) const override;
54 #endif 55 #endif
55 56
56 void filterSpan(const SkPMColor src[], int count, SkPMColor dst[]) const ove rride; 57 void filterSpan(const SkPMColor src[], int count, SkPMColor dst[]) const ove rride;
57 58
58 SK_TO_STRING_OVERRIDE() 59 SK_TO_STRING_OVERRIDE()
59 60
60 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTable_ColorFilter) 61 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTable_ColorFilter)
61 62
62 enum { 63 enum {
63 kA_Flag = 1 << 0, 64 kA_Flag = 1 << 0,
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 } 570 }
570 } 571 }
571 SkAutoTUnref<SkColorFilter> filter(SkTableColorFilter::CreateARGB( 572 SkAutoTUnref<SkColorFilter> filter(SkTableColorFilter::CreateARGB(
572 (flags & (1 << 0)) ? luts[0] : NULL, 573 (flags & (1 << 0)) ? luts[0] : NULL,
573 (flags & (1 << 1)) ? luts[1] : NULL, 574 (flags & (1 << 1)) ? luts[1] : NULL,
574 (flags & (1 << 2)) ? luts[2] : NULL, 575 (flags & (1 << 2)) ? luts[2] : NULL,
575 (flags & (1 << 3)) ? luts[3] : NULL 576 (flags & (1 << 3)) ? luts[3] : NULL
576 )); 577 ));
577 578
578 SkTDArray<GrFragmentProcessor*> array; 579 SkTDArray<GrFragmentProcessor*> array;
579 if (filter->asFragmentProcessors(context, &array)) { 580 GrPaint grPaint;
581 if (filter->asFragmentProcessors(context, grPaint.getShaderDataManager(), &a rray)) {
580 SkASSERT(1 == array.count()); // TableColorFilter only returns 1 582 SkASSERT(1 == array.count()); // TableColorFilter only returns 1
581 return array[0]; 583 return array[0];
582 } 584 }
583 return NULL; 585 return NULL;
584 } 586 }
585 587
586 bool SkTable_ColorFilter::asFragmentProcessors(GrContext* context, 588 bool SkTable_ColorFilter::asFragmentProcessors(GrContext* context,
589 GrShaderDataManager*,
587 SkTDArray<GrFragmentProcessor*>* array) const { 590 SkTDArray<GrFragmentProcessor*>* array) const {
588 SkBitmap bitmap; 591 SkBitmap bitmap;
589 this->asComponentTable(&bitmap); 592 this->asComponentTable(&bitmap);
590 593
591 GrFragmentProcessor* frag = ColorTableEffect::Create(context, bitmap, fFlags ); 594 GrFragmentProcessor* frag = ColorTableEffect::Create(context, bitmap, fFlags );
592 if (frag) { 595 if (frag) {
593 if (array) { 596 if (array) {
594 *array->append() = frag; 597 *array->append() = frag;
595 } else { 598 } else {
596 frag->unref(); 599 frag->unref();
(...skipping 25 matching lines...) Expand all
622 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], 625 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256],
623 const uint8_t tableR[256], 626 const uint8_t tableR[256],
624 const uint8_t tableG[256], 627 const uint8_t tableG[256],
625 const uint8_t tableB[256]) { 628 const uint8_t tableB[256]) {
626 return SkNEW_ARGS(SkTable_ColorFilter, (tableA, tableR, tableG, tableB)); 629 return SkNEW_ARGS(SkTable_ColorFilter, (tableA, tableR, tableG, tableB));
627 } 630 }
628 631
629 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) 632 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter)
630 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter) 633 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTable_ColorFilter)
631 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 634 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698