aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-02-07 11:59:16 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-07 21:41:00 +0000
commite88cf6b7aa5deaeaa9dab18ada7d9d11e1e4be12 (patch)
tree9b3eef7407120c74dd9e9a7a38579d57ff52fe39 /src/gpu/SkGpuDevice.cpp
parent0766e9b55e307eb1db9c683a12b8333833d65247 (diff)
Remove asTextureRef from SkSpecialImage & update effects accordingly
This CL also renames SkSpecialImage::asTextureProxy to asTextureProxyRef Change-Id: I5ed8e475bb9688453b825ae4500ed0e8d324b5ac Reviewed-on: https://skia-review.googlesource.com/7995 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index f30057d315..e9d27be0bf 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1178,25 +1178,29 @@ void SkGpuDevice::drawSpecial(const SkDraw& draw,
}
SkASSERT(result->isTextureBacked());
- sk_sp<GrTexture> texture = result->asTextureRef(fContext.get());
- if (!texture) {
+ sk_sp<GrTextureProxy> proxy = result->asTextureProxyRef(fContext.get());
+ if (!proxy) {
return;
}
+ const GrPixelConfig config = proxy->config();
+
SkPaint tmpUnfiltered(paint);
tmpUnfiltered.setImageFilter(nullptr);
sk_sp<GrColorSpaceXform> colorSpaceXform =
GrColorSpaceXform::Make(result->getColorSpace(), fRenderTargetContext->getColorSpace());
- GrPaint grPaint;
- sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(texture.get(),
+ sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(fContext.get(),
+ std::move(proxy),
std::move(colorSpaceXform),
SkMatrix::I()));
- if (GrPixelConfigIsAlphaOnly(texture->config())) {
+ if (GrPixelConfigIsAlphaOnly(config)) {
fp = GrFragmentProcessor::MakeInputPremulAndMulByOutput(std::move(fp));
} else {
fp = GrFragmentProcessor::MulOutputByInputAlpha(std::move(fp));
}
+
+ GrPaint grPaint;
if (!SkPaintToGrPaintReplaceShader(this->context(), fRenderTargetContext.get(), tmpUnfiltered,
std::move(fp), &grPaint)) {
return;