Fix color blending for analytic shadows

Change-Id: I74e8c385a87a3f397b2df53679fcfd9120d82954
Reviewed-on: https://skia-review.googlesource.com/15645
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Jim Van Verth 2017-05-05 16:46:05 -04:00 committed by Skia Commit-Bot
parent 6d342285a4
commit 7633477b64
3 changed files with 5 additions and 4 deletions

View File

@ -215,8 +215,7 @@ bool SkAmbientShadowMaskFilterImpl::directFilterRRectMaskGPU(GrContext*,
GrPaint newPaint(paint);
GrColor4f color = newPaint.getColor4f();
color.fRGBA[3] *= fAmbientAlpha;
newPaint.setColor4f(color);
newPaint.setColor4f(color.mulByScalar(fAmbientAlpha));
if (SkToBool(fFlags & SkShadowFlags::kTransparentOccluder_ShadowFlag)) {
// set a large inset to force a fill
devSpaceInsetWidth = ambientRRect.width();

View File

@ -297,8 +297,7 @@ bool SkSpotShadowMaskFilterImpl::directFilterRRectMaskGPU(GrContext*,
}
GrColor4f color = paint.getColor4f();
color.fRGBA[3] *= fSpotAlpha;
paint.setColor4f(color);
paint.setColor4f(color.mulByScalar(fSpotAlpha));
rtContext->drawShadowRRect(clip, std::move(paint), viewMatrix, spotShadowRRect,
devSpaceSpotBlur, insetWidth);

View File

@ -191,6 +191,9 @@ GrGpu* GrGLGpu::Create(GrBackendContext backendContext, const GrContextOptions&
if (!glInterface) {
return nullptr;
}
#ifdef USE_NSIGHT
const_cast<GrContextOptions&>(options).fSuppressPathRendering = true;
#endif
GrGLContext* glContext = GrGLContext::Create(glInterface.get(), options);
if (glContext) {
return new GrGLGpu(glContext, context);