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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 956083002: Revert of Pass clip to context (Closed) Base URL: https://skia.googlesource.com/skia.git@pass_down_rendertarget
Patch Set: Created 5 years, 10 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/SkGpuBlurUtils.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/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index d2ec036ba79add76c51722b41c4ee30ad3e3d9d1..8c46aae757447e97b6a0a69b9f6a98a8d0a05937 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -563,7 +563,6 @@
void apply_morphology_rect(GrContext* context,
GrRenderTarget* rt,
- const GrClip& clip,
GrTexture* texture,
const SkIRect& srcRect,
const SkIRect& dstRect,
@@ -577,13 +576,12 @@
radius,
morphType,
bounds))->unref();
- context->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
+ context->drawNonAARectToRect(rt, paint, SkMatrix::I(), SkRect::Make(dstRect),
SkRect::Make(srcRect));
}
void apply_morphology_rect_no_bounds(GrContext* context,
GrRenderTarget* rt,
- const GrClip& clip,
GrTexture* texture,
const SkIRect& srcRect,
const SkIRect& dstRect,
@@ -595,13 +593,12 @@
direction,
radius,
morphType))->unref();
- context->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
+ context->drawNonAARectToRect(rt, paint, SkMatrix::I(), SkRect::Make(dstRect),
SkRect::Make(srcRect));
}
void apply_morphology_pass(GrContext* context,
GrRenderTarget* rt,
- const GrClip& clip,
GrTexture* texture,
const SkIRect& srcRect,
const SkIRect& dstRect,
@@ -633,16 +630,16 @@
}
if (middleSrcRect.fLeft - middleSrcRect.fRight >= 0) {
// radius covers srcRect; use bounds over entire draw
- apply_morphology_rect(context, rt, clip, texture, srcRect, dstRect, radius,
+ apply_morphology_rect(context, rt, texture, srcRect, dstRect, radius,
morphType, bounds, direction);
} else {
// Draw upper and lower margins with bounds; middle without.
- apply_morphology_rect(context, rt, clip, texture, lowerSrcRect, lowerDstRect, radius,
+ apply_morphology_rect(context, rt,texture, lowerSrcRect, lowerDstRect, radius,
morphType, bounds, direction);
- apply_morphology_rect(context, rt, clip, texture, upperSrcRect, upperDstRect, radius,
+ apply_morphology_rect(context, rt, texture, upperSrcRect, upperDstRect, radius,
morphType, bounds, direction);
- apply_morphology_rect_no_bounds(context, rt, clip, texture, middleSrcRect, middleDstRect,
- radius, morphType, direction);
+ apply_morphology_rect_no_bounds(context, rt, texture, middleSrcRect, middleDstRect, radius,
+ morphType, direction);
}
}
@@ -655,9 +652,8 @@
SkASSERT(srcTexture);
GrContext* context = srcTexture->getContext();
- // setup new clip
- GrClip clip(SkRect::MakeWH(SkIntToScalar(srcTexture->width()),
- SkIntToScalar(srcTexture->height())));
+ GrContext::AutoClip acs(context, SkRect::MakeWH(SkIntToScalar(srcTexture->width()),
+ SkIntToScalar(srcTexture->height())));
SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height());
GrSurfaceDesc desc;
@@ -672,9 +668,8 @@
if (NULL == texture) {
return false;
}
- apply_morphology_pass(context, texture->asRenderTarget(), clip, srcTexture,
- srcRect, dstRect, radius.fWidth, morphType,
- Gr1DKernelEffect::kX_Direction);
+ apply_morphology_pass(context, texture->asRenderTarget(), srcTexture, srcRect, dstRect,
+ radius.fWidth, morphType, Gr1DKernelEffect::kX_Direction);
SkIRect clearRect = SkIRect::MakeXYWH(dstRect.fLeft, dstRect.fBottom,
dstRect.width(), radius.fHeight);
GrColor clearColor = GrMorphologyEffect::kErode_MorphologyType == morphType ?
@@ -689,9 +684,8 @@
if (NULL == texture) {
return false;
}
- apply_morphology_pass(context, texture->asRenderTarget(), clip, srcTexture,
- srcRect, dstRect, radius.fHeight, morphType,
- Gr1DKernelEffect::kY_Direction);
+ apply_morphology_pass(context, texture->asRenderTarget(), srcTexture, srcRect, dstRect,
+ radius.fHeight, morphType, Gr1DKernelEffect::kY_Direction);
srcTexture.reset(texture);
}
SkImageFilter::WrapTexture(srcTexture, rect.width(), rect.height(), dst);
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698