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

Unified Diff: src/core/SkImageFilter.cpp

Issue 936943002: Pass clip to context (Closed) Base URL: https://skia.googlesource.com/skia.git@pass_down_rendertarget
Patch Set: more cleanup 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
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 99a1d135486c1da80132906ba099582f2172225d..969d0b76aeb74a0e40baf1a879e53e9c74562fc8 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -227,7 +227,7 @@ bool SkImageFilter::canFilterImageGPU() const {
}
bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context& ctx,
- SkBitmap* result, SkIPoint* offset) const {
+ const GrClip&, SkBitmap* result, SkIPoint* offset) const {
#if SK_SUPPORT_GPU
SkBitmap input = src;
SkASSERT(fInputCount == 1);
@@ -257,7 +257,9 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
return false;
}
- GrContext::AutoClip acs(context, dstRect);
+ // setup new clip
+ GrClip clip(dstRect);
+
GrFragmentProcessor* fp;
offset->fX = bounds.left();
offset->fY = bounds.top();
@@ -268,7 +270,8 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
SkASSERT(fp);
GrPaint paint;
paint.addColorProcessor(fp)->unref();
- context->drawNonAARectToRect(dst->asRenderTarget(), paint, SkMatrix::I(), dstRect, srcRect);
+ context->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatrix::I(), dstRect,
+ srcRect);
WrapTexture(dst, bounds.width(), bounds.height(), result);
return true;
@@ -382,9 +385,9 @@ bool SkImageFilter::getInputResultGPU(SkImageFilter::Proxy* proxy,
// matrix with no clip and that the matrix, clip, and render target set before this function was
// called are restored before we return to the caller.
GrContext* context = src.getTexture()->getContext();
- GrContext::AutoWideOpenIdentityDraw awoid(context);
+
if (this->canFilterImageGPU()) {
- return this->filterImageGPU(proxy, src, ctx, result, offset);
+ return this->filterImageGPU(proxy, src, ctx, GrClip::WideOpen(), result, offset);
} else {
if (this->filterImage(proxy, src, ctx, result, offset)) {
if (!result->getTexture()) {

Powered by Google App Engine
This is Rietveld 408576698