int rootCount = findRoots(i2, q1, roots1);
// OPTIMIZATION: could short circuit here if all roots are < 0 or > 1
#ifndef NDEBUG
- int rootCount2 =
+ int rootCount2 =
#endif
findRoots(i1, q2, roots2);
assert(rootCount == rootCount2);
if (approximately_zero(R)) {/* one triple solution */
*roots++ = -adiv3;
} else { /* one single and one double solution */
-
+
double u = cube_root(-R);
*roots++ = 2 * u - adiv3;
*roots++ = -u - adiv3;
#else
SkASSERT(fVerb == SkPath::kQuad_Verb); // worry about cubics later
SkASSERT(rh.fVerb == SkPath::kQuad_Verb);
- // FIXME: until I can think of something better, project a ray from the
+ // FIXME: until I can think of something better, project a ray from the
// end of the shorter tangent to midway between the end points
// through both curves and use the resulting angle to sort
// FIXME: some of this setup can be moved to set() if it works, or cached if it's expensive
}
this->drawBitmapRectToRect(bitmap, realSrcPtr, dst, paint);
}
-
+
virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
const SkPaint* paint = NULL);
/** Construct a matrix convolution image filter.
@param kernelSize The kernel size in pixels, in each dimension (N by M).
- @param kernel The image processing kernel. Must contain N * M
+ @param kernel The image processing kernel. Must contain N * M
elements, in row order.
@param gain A scale factor applied to each pixel after
convolution. This can be used to normalize the
#include "GrTDArray.h"
-// GrTDefaultFindFunctor implements the default find behavior for
-// GrTHashTable (i.e., return the first resource that matches the
+// GrTDefaultFindFunctor implements the default find behavior for
+// GrTHashTable (i.e., return the first resource that matches the
// provided key)
template <typename T> class GrTDefaultFindFunctor {
public:
if (NULL != elem && Key::EQ(*elem, key) && findFunc(elem)) {
return elem;
- }
+ }
// bsearch for the key in our sorted array
int index = this->searchArray(key);
class GrFindPositivesFunctor {
public:
// only return elements with positive values
- bool operator()(const HashElement* elem) const {
+ bool operator()(const HashElement* elem) const {
return elem->fValue > 0;
}
};
class GrFindNegativesFunctor {
public:
// only return elements with negative values
- bool operator()(const HashElement* elem) const {
+ bool operator()(const HashElement* elem) const {
return elem->fValue < 0;
}
};
GrTHashTable<HashElement, HashKey, 4> cache;
- HashElement negHashElements[10] = {
- { 0, 0 },
+ HashElement negHashElements[10] = {
+ { 0, 0 },
{ 1, -1 },
- { 2, -2 },
- { 3, -3 },
- { 4, -4 },
- { 5, -5 },
- { 6, -6 },
- { 7, -7 },
- { 8, -8 },
+ { 2, -2 },
+ { 3, -3 },
+ { 4, -4 },
+ { 5, -5 },
+ { 6, -6 },
+ { 7, -7 },
+ { 8, -8 },
{ 9, -9 }
};
- HashElement posHashElements[10] = {
- { 0, 0 },
+ HashElement posHashElements[10] = {
+ { 0, 0 },
{ 1, 1 },
- { 2, 2 },
- { 3, 3 },
- { 4, 4 },
- { 5, 5 },
- { 6, 6 },
- { 7, 7 },
- { 8, 8 },
+ { 2, 2 },
+ { 3, 3 },
+ { 4, 4 },
+ { 5, 5 },
+ { 6, 6 },
+ { 7, 7 },
+ { 8, 8 },
{ 9, 9 }
};
}
REPORTER_ASSERT(reporter, 20 == cache.count());
-
+
// test out the find functor to find all the positive values
{
GrFindPositivesFunctor findPos;