| Index: src/effects/SkTableColorFilter.cpp
|
| diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
|
| index 872fdfddc231891325ee7990f76bbb942bf3946e..8bbe43189b1b8abe236d778e7c80cef7aca49bfb 100644
|
| --- a/src/effects/SkTableColorFilter.cpp
|
| +++ b/src/effects/SkTableColorFilter.cpp
|
| @@ -49,7 +49,8 @@ public:
|
| SkColorFilter* newComposed(const SkColorFilter* inner) const override;
|
|
|
| #if SK_SUPPORT_GPU
|
| - const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override;
|
| + const GrFragmentProcessor* asFragmentProcessor(GrContext*,
|
| + GrRenderTarget* dst) const override;
|
| #endif
|
|
|
| void filterSpan(const SkPMColor src[], int count, SkPMColor dst[]) const override;
|
| @@ -342,7 +343,7 @@ SkColorFilter* SkTable_ColorFilter::newComposed(const SkColorFilter* innerFilter
|
|
|
| class ColorTableEffect : public GrFragmentProcessor {
|
| public:
|
| - static const GrFragmentProcessor* Create(GrContext* context, SkBitmap bitmap, unsigned flags);
|
| + static const GrFragmentProcessor* Create(GrContext* context, SkBitmap bitmap, unsigned flags, GrRenderTarget* dst);
|
|
|
| virtual ~ColorTableEffect();
|
|
|
| @@ -360,7 +361,7 @@ private:
|
|
|
| void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
|
|
|
| - ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atlas, int row, unsigned flags);
|
| + ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atlas, int row, unsigned flags, GrRenderTarget* dst);
|
|
|
| GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
|
|
|
| @@ -464,8 +465,7 @@ void GLColorTableEffect::emitCode(EmitArgs& args) {
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| const GrFragmentProcessor* ColorTableEffect::Create(GrContext* context, SkBitmap bitmap,
|
| - unsigned flags) {
|
| -
|
| + unsigned flags, GrRenderTarget* dst) {
|
| GrTextureStripAtlas::Desc desc;
|
| desc.fWidth = bitmap.width();
|
| desc.fHeight = 128;
|
| @@ -482,12 +482,12 @@ const GrFragmentProcessor* ColorTableEffect::Create(GrContext* context, SkBitmap
|
| texture.reset(SkRef(atlas->getTexture()));
|
| }
|
|
|
| - return new ColorTableEffect(texture, atlas, row, flags);
|
| + return new ColorTableEffect(texture, atlas, row, flags, dst);
|
| }
|
|
|
| ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atlas, int row,
|
| - unsigned flags)
|
| - : fTextureAccess(texture, "a")
|
| + unsigned flags, GrRenderTarget* dst)
|
| + : fTextureAccess(texture, "a", GrTextureParams::kNone_FilterMode,SkShader::kClamp_TileMode, dst)
|
| , fFlags(flags)
|
| , fAtlas(atlas)
|
| , fRow(row) {
|
| @@ -565,16 +565,17 @@ const GrFragmentProcessor* ColorTableEffect::TestCreate(GrProcessorTestData* d)
|
| (flags & (1 << 3)) ? luts[3] : nullptr
|
| ));
|
|
|
| - const GrFragmentProcessor* fp = filter->asFragmentProcessor(d->fContext);
|
| + const GrFragmentProcessor* fp = filter->asFragmentProcessor(d->fContext, NULL);
|
| SkASSERT(fp);
|
| return fp;
|
| }
|
|
|
| -const GrFragmentProcessor* SkTable_ColorFilter::asFragmentProcessor(GrContext* context) const {
|
| +const GrFragmentProcessor* SkTable_ColorFilter::asFragmentProcessor(GrContext* context,
|
| + GrRenderTarget* dst) const {
|
| SkBitmap bitmap;
|
| this->asComponentTable(&bitmap);
|
|
|
| - return ColorTableEffect::Create(context, bitmap, fFlags);
|
| + return ColorTableEffect::Create(context, bitmap, fFlags, dst);
|
| }
|
|
|
| #endif // SK_SUPPORT_GPU
|
|
|