aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetContext.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-07-30 14:36:53 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-30 19:06:48 +0000
commit3ebd354730ea9590bf233deccfc24982ffe48a98 (patch)
treef9cef509dc7ccb769332cbbf740bfdbcead6dac8 /src/gpu/GrRenderTargetContext.cpp
parenta78b6dcb82d2f6c940e9c0a6bc14853f846344d0 (diff)
For TextureOp + Alpha texture, xform paint color to dest color space
This is an unfortunate amount of plumbing for this, but benchmarks confirm that we're better off doing this work in the vertex shader (with a ubyte attribute) than using a float4 attribute. Change-Id: I358d330ee452ea0a89cdd725019c8df2686036a0 Reviewed-on: https://skia-review.googlesource.com/144351 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetContext.cpp')
-rw-r--r--src/gpu/GrRenderTargetContext.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 7d88bc4936..a67e19a9d9 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -764,7 +764,8 @@ void GrRenderTargetContext::drawTexture(const GrClip& clip, sk_sp<GrTextureProxy
const SkRect& srcRect, const SkRect& dstRect, GrAA aa,
SkCanvas::SrcRectConstraint constraint,
const SkMatrix& viewMatrix,
- sk_sp<GrColorSpaceXform> colorSpaceXform) {
+ sk_sp<GrColorSpaceXform> textureColorSpaceXform,
+ sk_sp<GrColorSpaceXform> paintColorSpaceXform) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
@@ -790,7 +791,8 @@ void GrRenderTargetContext::drawTexture(const GrClip& clip, sk_sp<GrTextureProxy
}
this->addDrawOp(clip, GrTextureOp::Make(fContext, std::move(proxy), filter, color,
clippedSrcRect, clippedDstRect, aaType, constraint,
- viewMatrix, std::move(colorSpaceXform)));
+ viewMatrix, std::move(textureColorSpaceXform),
+ std::move(paintColorSpaceXform)));
}
void GrRenderTargetContext::fillRectWithLocalMatrix(const GrClip& clip,