From 42c2115fc32e43c252284082a6e2473cef76e401 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Wed, 13 Jun 2018 15:28:19 -0600 Subject: ccpr: Initialize the atlas size more intelligently Rather than always starting the atlas at 1024 x 1024, begin with the first pow2 dimensions whose area is theoretically large enough to contain the pending paths. Bug: skia: Change-Id: I263e77ff6a697e865f6b3b62b9df7002225f9544 Reviewed-on: https://skia-review.googlesource.com/133660 Commit-Queue: Chris Dalton Reviewed-by: Brian Salomon Reviewed-by: Robert Phillips --- include/core/SkTypes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/core') diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index 008391fea4..eeba9e0a78 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -237,6 +237,10 @@ template constexpr const T& SkTMax(const T& a, const T& b) { return (b < a) ? a : b; } +template constexpr const T& SkTClamp(const T& x, const T& lo, const T& hi) { + return (x < lo) ? lo : SkTMin(x, hi); +} + static inline int32_t SkFastMin32(int32_t value, int32_t max) { if (value > max) { value = max; -- cgit v1.2.3