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

Unified Diff: src/effects/SkMagnifierImageFilter.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/SkLumaColorFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMagnifierImageFilter.cpp
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index 517e31d2505470c42a1d3b5970c5d1226281b606..cc2d243f1eed7ed1c45193c649e2dabbec99cabc 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -28,18 +28,18 @@
class GrMagnifierEffect : public GrSingleTextureEffect {
public:
- static GrFragmentProcessor* Create(GrTexture* texture,
- const SkRect& bounds,
- float xOffset,
- float yOffset,
- float xInvZoom,
- float yInvZoom,
- float xInvInset,
- float yInvInset) {
- return new GrMagnifierEffect(texture, bounds,
- xOffset, yOffset,
- xInvZoom, yInvZoom,
- xInvInset, yInvInset);
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* texture,
+ const SkRect& bounds,
+ float xOffset,
+ float yOffset,
+ float xInvZoom,
+ float yInvZoom,
+ float xInvInset,
+ float yInvInset) {
+ return sk_sp<GrFragmentProcessor>(new GrMagnifierEffect(texture, bounds,
+ xOffset, yOffset,
+ xInvZoom, yInvZoom,
+ xInvInset, yInvInset));
}
~GrMagnifierEffect() override {};
@@ -192,7 +192,7 @@ GrGLSLFragmentProcessor* GrMagnifierEffect::onCreateGLSLInstance() const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect);
-const GrFragmentProcessor* GrMagnifierEffect::TestCreate(GrProcessorTestData* d) {
+sk_sp<GrFragmentProcessor> GrMagnifierEffect::TestCreate(GrProcessorTestData* d) {
GrTexture* texture = d->fTextures[0];
const int kMaxWidth = 200;
const int kMaxHeight = 200;
@@ -203,7 +203,7 @@ const GrFragmentProcessor* GrMagnifierEffect::TestCreate(GrProcessorTestData* d)
uint32_t y = d->fRandom->nextULessThan(kMaxHeight - height);
uint32_t inset = d->fRandom->nextULessThan(kMaxInset);
- GrFragmentProcessor* effect = GrMagnifierEffect::Create(
+ sk_sp<GrFragmentProcessor> effect(GrMagnifierEffect::Make(
texture,
SkRect::MakeWH(SkIntToScalar(kMaxWidth), SkIntToScalar(kMaxHeight)),
(float) width / texture->width(),
@@ -211,7 +211,7 @@ const GrFragmentProcessor* GrMagnifierEffect::TestCreate(GrProcessorTestData* d)
texture->width() / (float) x,
texture->height() / (float) y,
(float) inset / texture->width(),
- (float) inset / texture->height());
+ (float) inset / texture->height()));
SkASSERT(effect);
return effect;
}
@@ -324,7 +324,7 @@ sk_sp<SkSpecialImage> SkMagnifierImageFilter::onFilterImage(SkSpecialImage* sour
SkIntToScalar(inputTexture->width()) / bounds.width(),
SkIntToScalar(inputTexture->height()) / bounds.height());
// SRGBTODO: Handle sRGB here
- sk_sp<GrFragmentProcessor> fp(GrMagnifierEffect::Create(
+ sk_sp<GrFragmentProcessor> fp(GrMagnifierEffect::Make(
inputTexture.get(),
effectBounds,
fSrcRect.x() / inputTexture->width(),
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698