aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDevice.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-05-23 11:22:56 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-23 15:44:46 +0000
commit435071e8ab865e395bec34ef128a412ceb50f063 (patch)
tree8dd4a21eb23161fc6ceb694151b77aa21c81c45e /src/core/SkDevice.cpp
parent557fbbe05ba48bcc20be684d11fe0edfc24c87ba (diff)
color-correct patch
Key work is to correctly convert SkColor corners into linear floats, then interpolate, then (correctly) convert back to SkColors. Bug: skia:6659 Change-Id: Iaf0ab842d7a4f8f3481e609903cec83814e5a749 Reviewed-on: https://skia-review.googlesource.com/17533 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/core/SkDevice.cpp')
-rw-r--r--src/core/SkDevice.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 0b72eeb9e8..e210e3695e 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -125,9 +125,11 @@ void SkBaseDevice::drawDRRect(const SkRRect& outer,
}
void SkBaseDevice::drawPatch(const SkPoint cubics[12], const SkColor colors[4],
- const SkPoint texCoords[4], SkBlendMode bmode, const SkPaint& paint) {
+ const SkPoint texCoords[4], SkBlendMode bmode,
+ bool interpColorsLinearly, const SkPaint& paint) {
SkISize lod = SkPatchUtils::GetLevelOfDetail(cubics, &this->ctm());
- auto vertices = SkPatchUtils::MakeVertices(cubics, colors, texCoords, lod.width(), lod.height());
+ auto vertices = SkPatchUtils::MakeVertices(cubics, colors, texCoords, lod.width(), lod.height(),
+ interpColorsLinearly);
if (vertices) {
this->drawVertices(vertices.get(), bmode, paint);
}