From 52e935d04c59135739c3a68fb6e19d313dc6d5ad Mon Sep 17 00:00:00 2001 From: "brettw@google.com" Date: Fri, 12 Dec 2008 21:01:41 +0000 Subject: New drop of Skia. This is up to CL 121320. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6925 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/sgl/SkGeometry.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'skia/sgl/SkGeometry.cpp') diff --git a/skia/sgl/SkGeometry.cpp b/skia/sgl/SkGeometry.cpp index 3c72f4b..4f22e92 100644 --- a/skia/sgl/SkGeometry.cpp +++ b/skia/sgl/SkGeometry.cpp @@ -1,6 +1,6 @@ /* libs/graphics/sgl/SkGeometry.cpp ** -** Copyright 2006, Google Inc. +** Copyright 2006, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. @@ -260,6 +260,14 @@ static void flatten_double_quad_extrema(SkScalar coords[14]) coords[2] = coords[6] = coords[4]; } +static void force_quad_monotonic_in_y(SkPoint pts[3]) +{ + // zap pts[1].fY to the nearest value + SkScalar ab = SkScalarAbs(pts[0].fY - pts[1].fY); + SkScalar bc = SkScalarAbs(pts[1].fY - pts[2].fY); + pts[1].fY = ab < bc ? pts[0].fY : pts[2].fY; +} + /* Returns 0 for 1 quad, and 1 for two quads, either way the answer is stored in dst[]. Guarantees that the 1/2 quads will be monotonic. */ -- cgit v1.1