aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLightingImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-10-15 08:01:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-15 08:01:49 -0700
commit2e1e51f04985f7c258b96f0decc190456f5dd74d (patch)
treea7c76384e447455ba8fb95575a41696fa5777bcf /src/effects/SkLightingImageFilter.cpp
parent860e8a67190e024b7375e52e270e6bd0a17af86e (diff)
GrDrawContext now holds GrRenderTarget pointer
Diffstat (limited to 'src/effects/SkLightingImageFilter.cpp')
-rw-r--r--src/effects/SkLightingImageFilter.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 32589e1826..4265f6e1e5 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -330,7 +330,6 @@ private:
#if SK_SUPPORT_GPU
void drawRect(GrDrawContext* drawContext,
GrTexture* src,
- GrTexture* dst,
const SkMatrix& matrix,
const GrClip& clip,
const SkRect& dstRect,
@@ -343,7 +342,6 @@ private:
#if SK_SUPPORT_GPU
void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext,
GrTexture* src,
- GrTexture* dst,
const SkMatrix& matrix,
const GrClip& clip,
const SkRect& dstRect,
@@ -353,8 +351,7 @@ void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext,
GrPaint paint;
GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, bounds, boundaryMode);
paint.addColorFragmentProcessor(fp)->unref();
- drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatrix::I(),
- dstRect, srcRect);
+ drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
}
bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy,
@@ -406,24 +403,23 @@ bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy,
SkRect bottom = SkRect::MakeXYWH(1, dstRect.height() - 1, dstRect.width() - 2, 1);
SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height() - 1, 1, 1);
- SkAutoTUnref<GrDrawContext> drawContext(context->drawContext());
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTarget()));
if (!drawContext) {
return false;
}
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, topLeft, kTopLeft_BoundaryMode,
+ this->drawRect(drawContext, srcTexture, matrix, clip, topLeft, kTopLeft_BoundaryMode, bounds);
+ this->drawRect(drawContext, srcTexture, matrix, clip, top, kTop_BoundaryMode, bounds);
+ this->drawRect(drawContext, srcTexture, matrix, clip, topRight, kTopRight_BoundaryMode,
bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, top, kTop_BoundaryMode, bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, topRight, kTopRight_BoundaryMode,
+ this->drawRect(drawContext, srcTexture, matrix, clip, left, kLeft_BoundaryMode, bounds);
+ this->drawRect(drawContext, srcTexture, matrix, clip, interior, kInterior_BoundaryMode,
bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, left, kLeft_BoundaryMode, bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, interior, kInterior_BoundaryMode,
+ this->drawRect(drawContext, srcTexture, matrix, clip, right, kRight_BoundaryMode, bounds);
+ this->drawRect(drawContext, srcTexture, matrix, clip, bottomLeft, kBottomLeft_BoundaryMode,
bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, right, kRight_BoundaryMode, bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, bottomLeft, kBottomLeft_BoundaryMode,
- bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, bottom, kBottom_BoundaryMode, bounds);
- this->drawRect(drawContext, srcTexture, dst, matrix, clip, bottomRight,
+ this->drawRect(drawContext, srcTexture, matrix, clip, bottom, kBottom_BoundaryMode, bounds);
+ this->drawRect(drawContext, srcTexture, matrix, clip, bottomRight,
kBottomRight_BoundaryMode, bounds);
WrapTexture(dst, bounds.width(), bounds.height(), result);
return true;