Enable tonal color for shadows by default.
This change swaps the sense of the tonal color shadow flag, so tonal color will always be on unless explicitly disabled. Change-Id: I56ce4228022cf59b570cd7461327628cf7fe7173 Reviewed-on: https://skia-review.googlesource.com/73900 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
1e18aa6d7d
commit
53d863c18c
@ -16,8 +16,8 @@ enum SkShadowFlags {
|
|||||||
kTransparentOccluder_ShadowFlag = 0x01,
|
kTransparentOccluder_ShadowFlag = 0x01,
|
||||||
/** Don't try to use analytic shadows. */
|
/** Don't try to use analytic shadows. */
|
||||||
kGeometricOnly_ShadowFlag = 0x02,
|
kGeometricOnly_ShadowFlag = 0x02,
|
||||||
/** Use tonal values when applying color */
|
/** Disable use of tonal values when applying color */
|
||||||
kTonalColor_ShadowFlag = 0x04,
|
kDisableTonalColor_ShadowFlag = 0x04,
|
||||||
/** mask for all shadow flags */
|
/** mask for all shadow flags */
|
||||||
kAll_ShadowFlag = 0x07
|
kAll_ShadowFlag = 0x07
|
||||||
};
|
};
|
||||||
|
@ -112,6 +112,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fTwoPassColor) {
|
if (fTwoPassColor) {
|
||||||
|
flags |= SkShadowFlags::kDisableTonalColor_ShadowFlag;
|
||||||
SkShadowUtils::DrawShadow(canvas, path, zPlaneParams,
|
SkShadowUtils::DrawShadow(canvas, path, zPlaneParams,
|
||||||
lightPos, lightWidth,
|
lightPos, lightWidth,
|
||||||
ambientAlpha, 0, SK_ColorBLACK, flags);
|
ambientAlpha, 0, SK_ColorBLACK, flags);
|
||||||
@ -136,7 +137,6 @@ protected:
|
|||||||
lightPos, lightWidth,
|
lightPos, lightWidth,
|
||||||
0, spotAlpha, SK_ColorBLACK, flags);
|
0, spotAlpha, SK_ColorBLACK, flags);
|
||||||
} else {
|
} else {
|
||||||
flags |= SkShadowFlags::kTonalColor_ShadowFlag;
|
|
||||||
SkShadowUtils::DrawShadow(canvas, path, zPlaneParams,
|
SkShadowUtils::DrawShadow(canvas, path, zPlaneParams,
|
||||||
lightPos, lightWidth,
|
lightPos, lightWidth,
|
||||||
ambientAlpha, spotAlpha, paint.getColor(), flags);
|
ambientAlpha, spotAlpha, paint.getColor(), flags);
|
||||||
|
@ -1047,7 +1047,7 @@ bool GrRenderTargetContext::drawFastShadow(const GrClip& clip,
|
|||||||
SkScalar occluderHeight = rec.fZPlaneParams.fZ;
|
SkScalar occluderHeight = rec.fZPlaneParams.fZ;
|
||||||
GrColor4f color = GrColor4f::FromGrColor(color4ub);
|
GrColor4f color = GrColor4f::FromGrColor(color4ub);
|
||||||
bool transparent = SkToBool(rec.fFlags & SkShadowFlags::kTransparentOccluder_ShadowFlag);
|
bool transparent = SkToBool(rec.fFlags & SkShadowFlags::kTransparentOccluder_ShadowFlag);
|
||||||
bool tonalColor = SkToBool(rec.fFlags & SkShadowFlags::kTonalColor_ShadowFlag);
|
bool tonalColor = !SkToBool(rec.fFlags & SkShadowFlags::kDisableTonalColor_ShadowFlag);
|
||||||
|
|
||||||
if (rec.fAmbientAlpha > 0) {
|
if (rec.fAmbientAlpha > 0) {
|
||||||
SkScalar devSpaceInsetWidth = SkDrawShadowMetrics::AmbientBlurRadius(occluderHeight);
|
SkScalar devSpaceInsetWidth = SkDrawShadowMetrics::AmbientBlurRadius(occluderHeight);
|
||||||
|
@ -519,7 +519,7 @@ void SkBaseDevice::drawShadow(const SkPath& path, const SkDrawShadowRec& rec) {
|
|||||||
bool tiltZPlane = tilted(rec.fZPlaneParams);
|
bool tiltZPlane = tilted(rec.fZPlaneParams);
|
||||||
bool transparent = SkToBool(rec.fFlags & SkShadowFlags::kTransparentOccluder_ShadowFlag);
|
bool transparent = SkToBool(rec.fFlags & SkShadowFlags::kTransparentOccluder_ShadowFlag);
|
||||||
bool uncached = tiltZPlane || path.isVolatile();
|
bool uncached = tiltZPlane || path.isVolatile();
|
||||||
bool useTonalColor = SkToBool(rec.fFlags & kTonalColor_ShadowFlag);
|
bool useTonalColor = !SkToBool(rec.fFlags & kDisableTonalColor_ShadowFlag);
|
||||||
|
|
||||||
SkColor color = rec.fColor;
|
SkColor color = rec.fColor;
|
||||||
SkPoint3 zPlaneParams = rec.fZPlaneParams;
|
SkPoint3 zPlaneParams = rec.fZPlaneParams;
|
||||||
|
Loading…
Reference in New Issue
Block a user