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

Unified Diff: src/gpu/GrBlurUtils.cpp

Issue 1404823005: GrDrawContext now holds GrRenderTarget pointer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix overlength line Created 5 years, 2 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/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBlurUtils.cpp
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index a396c3340dc92580f226f42b30c2f4bf1dec1f5c..5d691fb137abe2fd646d9f3f64db1c93dfd1c7fd 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -26,7 +26,6 @@ static bool clip_bounds_quick_reject(const SkIRect& clipBounds, const SkIRect& r
// is already burnt into the mask this boils down to a rect draw.
// Return true if the mask was successfully drawn.
static bool draw_mask(GrDrawContext* drawContext,
- GrRenderTarget* rt,
const GrClip& clip,
const SkMatrix& viewMatrix,
const SkRect& maskRect,
@@ -43,13 +42,12 @@ static bool draw_mask(GrDrawContext* drawContext,
if (!viewMatrix.invert(&inverse)) {
return false;
}
- drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), maskRect, inverse);
+ drawContext->drawNonAARectWithLocalMatrix(clip, *grp, SkMatrix::I(), maskRect, inverse);
return true;
}
static bool draw_with_mask_filter(GrDrawContext* drawContext,
GrTextureProvider* textureProvider,
- GrRenderTarget* rt,
const GrClip& clipData,
const SkMatrix& viewMatrix,
const SkPath& devPath,
@@ -91,7 +89,7 @@ static bool draw_with_mask_filter(GrDrawContext* drawContext,
SkRect maskRect = SkRect::Make(dstM.fBounds);
- return draw_mask(drawContext, rt, clipData, viewMatrix, maskRect, grp, texture);
+ return draw_mask(drawContext, clipData, viewMatrix, maskRect, grp, texture);
}
// Create a mask of 'devPath' and place the result in 'mask'.
@@ -126,12 +124,12 @@ static GrTexture* create_mask_GPU(GrContext* context,
SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height());
- SkAutoTUnref<GrDrawContext> drawContext(context->drawContext());
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(mask->asRenderTarget()));
if (!drawContext) {
return nullptr;
}
- drawContext->clear(mask->asRenderTarget(), nullptr, 0x0, true);
+ drawContext->clear(nullptr, 0x0, true);
GrPaint tempPaint;
tempPaint.setAntiAlias(doAA);
@@ -144,7 +142,7 @@ static GrTexture* create_mask_GPU(GrContext* context,
// the origin using tempPaint.
SkMatrix translate;
translate.setTranslate(-maskRect->fLeft, -maskRect->fTop);
- drawContext->drawPath(mask->asRenderTarget(), clip, tempPaint, translate, devPath, strokeInfo);
+ drawContext->drawPath(clip, tempPaint, translate, devPath, strokeInfo);
return mask;
}
@@ -247,7 +245,6 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
if (paint.getMaskFilter()->directFilterMaskGPU(context->textureProvider(),
drawContext,
- renderTarget,
&grPaint,
clip,
viewMatrix,
@@ -272,7 +269,6 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
// filterMaskGPU gives us ownership of a ref to the result
SkAutoTUnref<GrTexture> atu(filtered);
if (draw_mask(drawContext,
- renderTarget,
clip,
viewMatrix,
maskRect,
@@ -289,12 +285,12 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
// GPU path fails
SkPaint::Style style = strokeInfo.isHairlineStyle() ? SkPaint::kStroke_Style :
SkPaint::kFill_Style;
- draw_with_mask_filter(drawContext, context->textureProvider(), renderTarget,
+ draw_with_mask_filter(drawContext, context->textureProvider(),
clip, viewMatrix, *devPathPtr,
paint.getMaskFilter(), clipBounds, &grPaint, style);
return;
}
- drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, strokeInfo);
+ drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo);
}
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698