diff options
author | Brian Salomon <bsalomon@google.com> | 2017-10-24 12:52:33 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-24 20:43:02 +0000 |
commit | f3569f0f6d312570c7344b345f8b3a03a892f751 (patch) | |
tree | 2da4cd0b0bac2b4b47d6ce91e7db53fa3b5dcad7 /src/gpu/SkGpuDevice_drawTexture.cpp | |
parent | 6dd0d8a2659d5976fdd2b6528f787ac7f0b0005b (diff) |
Add GrColorSpaceInfo and use in place of GrRenderTargetContext in paint conversion.
This moves us closer to making GrAtlasTextContext and related classes usable without a GrRenderTargetContext.
Change-Id: Ife52d69a3f925e23da88043acb4d8dc9f672a025
Reviewed-on: https://skia-review.googlesource.com/63304
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice_drawTexture.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice_drawTexture.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp index ad69413ae0..8d0ed6eabd 100644 --- a/src/gpu/SkGpuDevice_drawTexture.cpp +++ b/src/gpu/SkGpuDevice_drawTexture.cpp @@ -114,7 +114,7 @@ static void draw_texture_affine(const SkPaint& paint, const SkMatrix& ctm, const SkAssertResult(srcRect.intersect(SkRect::MakeIWH(proxy->width(), proxy->height()))); srcToDst.mapRect(&dstRect, srcRect); } - auto csxf = GrColorSpaceXform::Make(colorSpace, rtc->getColorSpace()); + auto csxf = GrColorSpaceXform::Make(colorSpace, rtc->colorSpaceInfo().colorSpace()); GrSamplerState::Filter filter; switch (paint.getFilterQuality()) { case kNone_SkFilterQuality: @@ -160,9 +160,9 @@ void SkGpuDevice::drawTextureMaker(GrTextureMaker* maker, int imageW, int imageH sk_sp<SkColorSpace> cs; // We've done enough checks above to allow us to pass ClampNearest() and not check for // scaling adjustments. - auto proxy = maker->refTextureProxyForParams(GrSamplerState::ClampNearest(), - fRenderTargetContext->getColorSpace(), &cs, - nullptr); + auto proxy = maker->refTextureProxyForParams( + GrSamplerState::ClampNearest(), fRenderTargetContext->colorSpaceInfo().colorSpace(), + &cs, nullptr); if (!proxy) { return; } @@ -284,16 +284,17 @@ void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer, } textureMatrix = &tempMatrix; } - auto fp = producer->createFragmentProcessor(*textureMatrix, clippedSrcRect, constraintMode, - coordsAllInsideSrcRect, filterMode, - fRenderTargetContext->getColorSpace()); + auto fp = producer->createFragmentProcessor( + *textureMatrix, clippedSrcRect, constraintMode, coordsAllInsideSrcRect, filterMode, + fRenderTargetContext->colorSpaceInfo().colorSpace()); if (!fp) { return; } GrPaint grPaint; - if (!SkPaintToGrPaintWithTexture(fContext.get(), fRenderTargetContext.get(), paint, viewMatrix, - std::move(fp), producer->isAlphaOnly(), &grPaint)) { + if (!SkPaintToGrPaintWithTexture(fContext.get(), fRenderTargetContext->colorSpaceInfo(), paint, + viewMatrix, std::move(fp), producer->isAlphaOnly(), + &grPaint)) { return; } GrAA aa = GrBoolToAA(paint.isAntiAlias()); |