Searched refs:SkMinScalar (Results 1 - 25 of 32) sorted by relevance

12

/external/skia/samplecode/
H A DSampleStringArt.cpp42 while (length < (SkScalarHalf(SkMinScalar(this->width(), this->height())) - 10.f))
/external/skia/src/core/
H A DSkRect.cpp109 SkScalar R = SkMinScalar(ar, br); \
111 SkScalar B = SkMinScalar(ab, bb); \
140 fLeft = SkMinScalar(fLeft, left);
141 fTop = SkMinScalar(fTop, top);
H A DSkBlurImageFilter.cpp72 sigma.fX = SkMinScalar(SkScalarAbs(sigma.fX), MAX_SIGMA);
73 sigma.fY = SkMinScalar(SkScalarAbs(sigma.fY), MAX_SIGMA);
H A DSkRRect.cpp34 SkScalar scale = SkMinScalar(fRect.width() / (xRad + xRad), fRect.height() / (yRad + yRad));
78 scale = SkMinScalar(scale, fRect.height() / (topRad + bottomRad));
H A DSkLinearBitmapPipeline_tile.h400 SkScalar answer = SkMinScalar(SkScalarAbs(unbias), fYCap);
H A DSkRecordDraw.cpp500 left = SkMinScalar(left, op.xpos[i]);
H A DSkTextBlob.cpp585 minX = SkMinScalar(x, minX);
H A DSkMatrix.cpp1522 results[0] = SkMinScalar(SkScalarAbs(m[SkMatrix::kMScaleX]),
1554 results[0] = SkMinScalar(a, c);
/external/skia/src/gpu/ops/
H A DGrAAStrokeRectOp.cpp454 inset = SkMinScalar(SK_Scalar1, devOutside.fRight - devInside.fRight);
455 inset = SkMinScalar(inset, devInside.fLeft - devOutside.fLeft);
456 inset = SkMinScalar(inset, devInside.fTop - devOutside.fTop);
458 inset = SK_ScalarHalf * SkMinScalar(inset, devOutside.fBottom - devInside.fBottom);
461 SkMinScalar(inset, devOutsideAssist.fBottom - devInside.fBottom);
466 inset = SkMinScalar(devOutside.width(), SK_Scalar1);
468 SkMinScalar(inset, SkTMax(devOutside.height(), devOutsideAssist.height()));
476 inset = SkMinScalar(devOutside.width(), SK_Scalar1);
478 SkMinScalar(inset, SkTMax(devOutside.height(), devOutsideAssist.height()));
602 SkScalar minDim = SkMinScalar(rec
[all...]
H A DGrAAFillRectOp.cpp63 inset = SkMinScalar(devRect.width(), SK_Scalar1);
64 inset = SK_ScalarHalf * SkMinScalar(inset, devRect.height());
78 inset = SkMinScalar(len1 * rect.width(), SK_Scalar1);
79 inset = SK_ScalarHalf * SkMinScalar(inset, len2 * rect.height());
H A DGrSmallPathRenderer.cpp123 SkScalar minDim = SkMinScalar(bounds.width(), bounds.height());
H A DGrAAConvexTessellator.cpp883 minDot = SkMinScalar(minDot, dot);
H A DGrDashOp.cpp408 startPts[1].fX = SkMinScalar(startPts[0].fX + draw.fIntervals[0] - draw.fPhase,
/external/skia/include/core/
H A DSkRect.h574 fLeft = SkMinScalar(p0.fX, p1.fX);
576 fTop = SkMinScalar(p0.fY, p1.fY);
700 SkScalar R = SkMinScalar(ar, br);
702 SkScalar B = SkMinScalar(ab, bb);
758 fLeft = SkMinScalar(fLeft, r.left());
759 fTop = SkMinScalar(fTop, r.top());
774 fLeft = SkMinScalar(x, fLeft);
776 fTop = SkMinScalar(y, fTop);
268 SkASSERT(fLeft < fRight && fTop < fBottom); SkASSERT(left < right && top < bottom); return fLeft <= left && fTop <= top && fRight >= right && fBottom >= bottom; } bool containsNoEmptyCheck(const SkIRect& r) const { return containsNoEmptyCheck(r.fLeft, r.fTop, r.fRight, r.fBottom); } bool intersect(const SkIRect& r) { return this->intersect(r.fLeft, r.fTop, r.fRight, r.fBottom); } bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b) { if (!a.isEmpty() && !b.isEmpty() && a.fLeft < b.fRight && b.fLeft < a.fRight && a.fTop < b.fBottom && b.fTop < a.fBottom) { fLeft = SkMax32(a.fLeft, b.fLeft); fTop = SkMax32(a.fTop, b.fTop); fRight = SkMin32(a.fRight, b.fRight); fBottom = SkMin32(a.fBottom, b.fBottom); return true; } return false; } bool SK_WARN_UNUSED_RESULT intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b) { SkASSERT(!a.isEmpty() && !b.isEmpty()); if (a.fLeft < b.fRight && b.fLeft < a.fRight && a.fTop < b.fBottom && b.fTop < a.fBottom) { fLeft = SkMax32(a.fLeft, b.fLeft); fTop = SkMax32(a.fTop, b.fTop); fRight = SkMin32(a.fRight, b.fRight); fBottom = SkMin32(a.fBottom, b.fBottom); return true; } return false; } bool intersect(int32_t left, int32_t top, int32_t right, int32_t bottom) { if (left < right && top < bottom && !this->isEmpty() && fLeft < right && left < fRight && fTop < bottom && top < fBottom) { if (fLeft < left) fLeft = left; if (fTop < top) fTop = top; if (fRight > right) fRight = right; if (fBottom > bottom) fBottom = bottom; return true; } return false; } static bool Intersects(const SkIRect& a, const SkIRect& b) { return !a.isEmpty() && !b.isEmpty() && a.fLeft < b.fRight && b.fLeft < a.fRight && a.fTop < b.fBottom && b.fTop < a.fBottom; } static bool IntersectsNoEmptyCheck(const SkIRect& a, const SkIRect& b) { SkASSERT(!a.isEmpty()); SkASSERT(!b.isEmpty()); return a.fLeft < b.fRight && b.fLeft < a.fRight && a.fTop < b.fBottom && b.fTop < a.fBottom; } void join(int32_t left, int32_t top, int32_t right, int32_t bottom); void join(const SkIRect& r) { this->join(r.fLeft, r.fTop, r.fRight, r.fBottom); } void sort(); static const SkIRect& SK_WARN_UNUSED_RESULT EmptyIRect() { static const SkIRect gEmpty = { 0, 0, 0, 0 }; return gEmpty; } }; struct SK_API SkRect { SkScalar fLeft, fTop, fRight, fBottom; static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty() { return SkRect{0, 0, 0, 0}; } static SkRect SK_WARN_UNUSED_RESULT MakeLargest() { SkRect r; r.setLargest(); return r; } static SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h) { SkRect r; r.set(0, 0, w, h); return r; } static SkRect SK_WARN_UNUSED_RESULT MakeIWH(int w, int h) { SkRect r; r.set(0, 0, SkIntToScalar(w), SkIntToScalar(h)); return r; } static SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size) { SkRect r; r.set(0, 0, size.width(), size.height()); return r; } static constexpr SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScalar r, SkScalar b) { return SkRect {l, t, r, b}; } static SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h) { SkRect r; r.set(x, y, x + w, y + h); return r; } SK_ATTR_DEPRECATED(�) static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect) { SkRect r; r.set(SkIntToScalar(irect.fLeft), SkIntToScalar(irect.fTop), SkIntToScalar(irect.fRight), SkIntToScalar(irect.fBottom)); return r; } static SkRect Make(const SkISize& size) { return MakeIWH(size.width(), size.height()); } static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect& irect) { SkRect r; r.set(SkIntToScalar(irect.fLeft), SkIntToScalar(irect.fTop), SkIntToScalar(irect.fRight), SkIntToScalar(irect.fBottom)); return r; } bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; } bool isLargest() const { return SK_ScalarMin == fLeft && SK_ScalarMin == fTop && SK_ScalarMax == fRight && SK_ScalarMax == fBottom; } bool isFinite() const { float accum = 0; accum *= fLeft; accum *= fTop; accum *= fRight; accum *= fBottom; SkASSERT(0 == accum || SkScalarIsNaN(accum)); return !SkScalarIsNaN(accum); } SkScalar x() const { return fLeft; } SkScalar y() const { return fTop; } SkScalar left() const { return fLeft; } SkScalar top() const { return fTop; } SkScalar right() const { return fRight; } SkScalar bottom() const { return fBottom; } SkScalar width() const { return fRight - fLeft; } SkScalar height() const { return fBottom - fTop; } SkScalar centerX() const { return SkScalarHalf(fLeft + fRight); } SkScalar centerY() const { return SkScalarHalf(fTop + fBottom); } friend bool operator==(const SkRect& a, const SkRect& b) { return SkScalarsEqual((SkScalar*)&a, (SkScalar*)&b, 4); } friend bool operator!=(const SkRect& a, const SkRect& b) { return !SkScalarsEqual((SkScalar*)&a, (SkScalar*)&b, 4); } void toQuad(SkPoint quad[4]) const; void setEmpty() { *this = MakeEmpty(); } void set(const SkIRect& src) { fLeft = SkIntToScalar(src.fLeft); fTop = SkIntToScalar(src.fTop); fRight = SkIntToScalar(src.fRight); fBottom = SkIntToScalar(src.fBottom); } void set(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) { fLeft = left; fTop = top; fRight = right; fBottom = bottom; } void setLTRB(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) { this->set(left, top, right, bottom); } void iset(int left, int top, int right, int bottom) { fLeft = SkIntToScalar(left); fTop = SkIntToScalar(top); fRight = SkIntToScalar(right); fBottom = SkIntToScalar(bottom); } void isetWH(int width, int height) { fLeft = fTop = 0; fRight = SkIntToScalar(width); fBottom = SkIntToScalar(height); } void set(const SkPoint pts[], int count) { (void)this->setBoundsCheck(pts, count); } void setBounds(const SkPoint pts[], int count) { (void)this->setBoundsCheck(pts, count); } bool setBoundsCheck(const SkPoint pts[], int count); void set(const SkPoint& p0, const SkPoint& p1) { fLeft = SkMinScalar(p0.fX, p1.fX); fRight = SkMaxScalar(p0.fX, p1.fX); fTop = SkMinScalar(p0.fY, p1.fY); fBottom = SkMaxScalar(p0.fY, p1.fY); } void setXYWH(SkScalar x, SkScalar y, SkScalar width, SkScalar height) { fLeft = x; fTop = y; fRight = x + width; fBottom = y + height; } void setWH(SkScalar width, SkScalar height) { fLeft = 0; fTop = 0; fRight = width; fBottom = height; } void setLargest() { fLeft = fTop = SK_ScalarMin; fRight = fBottom = SK_ScalarMax; } void setLargestInverted() { fLeft = fTop = SK_ScalarMax; fRight = fBottom = SK_ScalarMin; } SkRect makeOffset(SkScalar dx, SkScalar dy) const { return MakeLTRB(fLeft + dx, fTop + dy, fRight + dx, fBottom + dy); } SkRect makeInset(SkScalar dx, SkScalar dy) const { return MakeLTRB(fLeft + dx, fTop + dy, fRight - dx, fBottom - dy); } SkRect makeOutset(SkScalar dx, SkScalar dy) const { return MakeLTRB(fLeft - dx, fTop - dy, fRight + dx, fBottom + dy); } void offset(SkScalar dx, SkScalar dy) { fLeft += dx; fTop += dy; fRight += dx; fBottom += dy; } void offset(const SkPoint& delta) { this->offset(delta.fX, delta.fY); } void offsetTo(SkScalar newX, SkScalar newY) { fRight += newX - fLeft; fBottom += newY - fTop; fLeft = newX; fTop = newY; } void inset(SkScalar dx, SkScalar dy) { fLeft += dx; fTop += dy; fRight -= dx; fBottom -= dy; } void outset(SkScalar dx, SkScalar dy) { this->inset(-dx, -dy); } bool intersect(const SkRect& r); bool intersect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom); bool SK_WARN_UNUSED_RESULT intersect(const SkRect& a, const SkRect& b); private: static bool Intersects(SkScalar al, SkScalar at, SkScalar ar, SkScalar ab, SkScalar bl, SkScalar bt, SkScalar br, SkScalar bb) { SkScalar L = SkMaxScalar(al, bl); SkScalar R = SkMinScalar(ar, br); SkScalar T = SkMaxScalar(at, bt); SkScalar B = SkMinScalar(ab, bb); return L < R && T < B; } public: bool intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) const { return Intersects(fLeft, fTop, fRight, fBottom, left, top, right, bottom); } bool intersects(const SkRect& r) const { return Intersects(fLeft, fTop, fRight, fBottom, r.fLeft, r.fTop, r.fRight, r.fBottom); } static bool Intersects(const SkRect& a, const SkRect& b) { return Intersects(a.fLeft, a.fTop, a.fRight, a.fBottom, b.fLeft, b.fTop, b.fRight, b.fBottom); } void join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom); void join(const SkRect& r) { this->join(r.fLeft, r.fTop, r.fRight, r.fBottom); } void joinNonEmptyArg(const SkRect& r) { SkASSERT(!r.isEmpty()); if (fLeft >= fRight || fTop >= fBottom) { *this = r; } else { this->joinPossiblyEmptyRect(r); } } void joinPossiblyEmptyRect(const SkRect& r) { fLeft = SkMinScalar(fLeft, r.left()); fTop = SkMinScalar(fTop, r.top()); fRight = SkMaxScalar(fRight, r.right()); fBottom = SkMaxScalar(fBottom, r.bottom()); } void growToInclude(SkScalar x, SkScalar y) { fLeft = SkMinScalar(x, fLeft); fRight = SkMaxScalar(x, fRight); fTop = SkMinScalar(y, fTop); fBottom = SkMaxScalar(y, fBottom); } void growToInclude(const SkPoint pts[], int count) { this->growToInclude(pts, sizeof(SkPoint), count); } void growToInclude(const SkPoint pts[], size_t stride, int count) { SkASSERT(count >= 0); SkASSERT(stride >= sizeof(SkPoint)); const SkPoint* end = (const SkPoint*)((intptr_t)pts + count * stride); for (; pts < end; pts = (const SkPoint*)((intptr_t)pts + stride)) { this->growToInclude(pts->fX, pts->fY); } } bool contains(const SkRect& r) const { return !r.isEmpty() && !this->isEmpty() && fLeft <= r.fLeft && fTop <= r.fTop && fRight >= r.fRight && fBottom >= r.fBottom; } bool contains(const SkIRect& r) const { return !r.isEmpty() && !this->isEmpty() && fLeft <= SkIntToScalar(r.fLeft) && fTop <= SkIntToScalar(r.fTop) && fRight >= SkIntToScalar(r.fRight) && fBottom >= SkIntToScalar(r.fBottom); } void round(SkIRect* dst) const { SkASSERT(dst); dst->set(SkScalarRoundToInt(fLeft), SkScalarRoundToInt(fTop), SkScalarRoundToInt(fRight), SkScalarRoundToInt(fBottom)); } void roundOut(SkIRect* dst) const { SkASSERT(dst); dst->set(SkScalarFloorToInt(fLeft), SkScalarFloorToInt(fTop), SkScalarCeilToInt(fRight), SkScalarCeilToInt(fBottom)); } void roundOut(SkRect* dst) const { dst->set(SkScalarFloorToScalar(fLeft), SkScalarFloorToScalar(fTop), SkScalarCeilToScalar(fRight), SkScalarCeilToScalar(fBottom)); } void roundIn(SkIRect* dst) const { SkASSERT(dst); dst->set(SkScalarCeilToInt(fLeft), SkScalarCeilToInt(fTop), SkScalarFloorToInt(fRight), SkScalarFloorToInt(fBottom)); } SkIRect round() const { SkIRect ir; this->round(&ir); return ir; } SkIRect roundOut() const { SkIRect ir; this->roundOut(&ir); return ir; } void sort() { if (fLeft > fRight) argument
H A DSkScalar.h146 static inline SkScalar SkMinScalar(SkScalar a, SkScalar b) { return a < b ? a : b; } function
/external/skia/gm/
H A Dimagefiltersclipped.cpp32 SkScalar radius = SkMinScalar(x, y) * 0.8f;
H A Dimagefilterstransformed.cpp30 SkScalar radius = SkMinScalar(x, y) * 0.8f;
H A Dimagefilterscropexpand.cpp160 SkScalar radius = SkMinScalar(x, y) * 0.8f;
H A Dimagefiltersscaled.cpp31 SkScalar radius = SkMinScalar(x, y) * 4 / 5;
/external/skia/src/effects/
H A DSkMagnifierImageFilter.cpp426 weight = SkMinScalar(SkScalarSquare(dist), SK_Scalar1);
428 SkScalar sqDist = SkMinScalar(SkScalarSquare(x_dist),
430 weight = SkMinScalar(sqDist, SK_Scalar1);
H A DSkAlphaThresholdFilter.cpp58 return SkMinScalar(SkMaxScalar(x, 0), 1);
H A DSkDashPathEffect.cpp226 SkScalar clampedInitialDashLength = SkMinScalar(length, fInitialDashLength);
/external/skia/src/pdf/
H A DSkPDFUtils.cpp106 SkScalar bottom = SkMinScalar(rect.fBottom, rect.fTop);
/external/skia/bench/
H A DPathBench.cpp741 SkScalar rx = SkMinScalar(rect.width(), xIn);
742 SkScalar ry = SkMinScalar(rect.height(), yIn);
/external/skia/src/gpu/text/
H A DGrAtlasTextBlob.h143 fMinMaxScale = SkMinScalar(scaledMin, fMinMaxScale);

Completed in 760 milliseconds

12