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

Unified Diff: src/effects/SkTableColorFilter.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkTableColorFilter.cpp
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index e87a0537354f000cef90fb0c4bcbfe74fdf8841d..20d11f101bee0037cec54bff30e8cd2ef0727bd8 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -49,7 +49,7 @@ public:
sk_sp<SkColorFilter> makeComposed(sk_sp<SkColorFilter> inner) const override;
#if SK_SUPPORT_GPU
- const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override;
+ sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*) const override;
#endif
void filterSpan(const SkPMColor src[], int count, SkPMColor dst[]) const override;
@@ -343,7 +343,7 @@ sk_sp<SkColorFilter> SkTable_ColorFilter::makeComposed(sk_sp<SkColorFilter> inne
class ColorTableEffect : public GrFragmentProcessor {
public:
- static const GrFragmentProcessor* Create(GrContext* context, SkBitmap bitmap, unsigned flags);
+ static sk_sp<GrFragmentProcessor> Make(GrContext* context, SkBitmap bitmap, unsigned flags);
virtual ~ColorTableEffect();
@@ -459,8 +459,8 @@ void GLColorTableEffect::emitCode(EmitArgs& args) {
}
///////////////////////////////////////////////////////////////////////////////
-const GrFragmentProcessor* ColorTableEffect::Create(GrContext* context, SkBitmap bitmap,
- unsigned flags) {
+sk_sp<GrFragmentProcessor> ColorTableEffect::Make(GrContext* context, SkBitmap bitmap,
+ unsigned flags) {
GrTextureStripAtlas::Desc desc;
desc.fWidth = bitmap.width();
@@ -479,7 +479,7 @@ const GrFragmentProcessor* ColorTableEffect::Create(GrContext* context, SkBitmap
texture.reset(SkRef(atlas->getTexture()));
}
- return new ColorTableEffect(texture, atlas, row, flags);
+ return sk_sp<GrFragmentProcessor>(new ColorTableEffect(texture, atlas, row, flags));
}
ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atlas, int row,
@@ -540,7 +540,7 @@ void ColorTableEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect);
-const GrFragmentProcessor* ColorTableEffect::TestCreate(GrProcessorTestData* d) {
+sk_sp<GrFragmentProcessor> ColorTableEffect::TestCreate(GrProcessorTestData* d) {
int flags = 0;
uint8_t luts[256][4];
do {
@@ -562,16 +562,16 @@ const GrFragmentProcessor* ColorTableEffect::TestCreate(GrProcessorTestData* d)
(flags & (1 << 3)) ? luts[3] : nullptr
));
- const GrFragmentProcessor* fp = filter->asFragmentProcessor(d->fContext);
+ sk_sp<GrFragmentProcessor> fp = filter->asFragmentProcessor(d->fContext);
SkASSERT(fp);
return fp;
}
-const GrFragmentProcessor* SkTable_ColorFilter::asFragmentProcessor(GrContext* context) const {
+sk_sp<GrFragmentProcessor> SkTable_ColorFilter::asFragmentProcessor(GrContext* context) const {
SkBitmap bitmap;
this->asComponentTable(&bitmap);
- return ColorTableEffect::Create(context, bitmap, fFlags);
+ return ColorTableEffect::Make(context, bitmap, fFlags);
}
#endif // SK_SUPPORT_GPU
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698