diff options
author | Chris Craik <ccraik@google.com> | 2015-02-11 13:17:06 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-02-12 12:30:59 -0800 |
commit | 0519c810a56bded1284fcb2ae40f438878c6585f (patch) | |
tree | d5e0a81ea08b9f3fc9d5e8d78b770a8c77aa4535 /libs/hwui/utils | |
parent | 08fa43fdeb646f56edcd8b33d06ee7d79b203426 (diff) | |
download | frameworks_base-0519c810a56bded1284fcb2ae40f438878c6585f.zip frameworks_base-0519c810a56bded1284fcb2ae40f438878c6585f.tar.gz frameworks_base-0519c810a56bded1284fcb2ae40f438878c6585f.tar.bz2 |
Glop Bitmap and RoundRect clipping support
Change-Id: I4577546a5d2e5f084cc03f39a89db9231b8111ee
Diffstat (limited to 'libs/hwui/utils')
-rw-r--r-- | libs/hwui/utils/Macros.h | 4 | ||||
-rw-r--r-- | libs/hwui/utils/PaintUtils.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libs/hwui/utils/Macros.h b/libs/hwui/utils/Macros.h index fe43fdb..eae73a9 100644 --- a/libs/hwui/utils/Macros.h +++ b/libs/hwui/utils/Macros.h @@ -29,4 +29,8 @@ friend inline int compare_type(const Type& lhs, const Type& rhs) { return lhs.compare(rhs); } \ friend inline hash_t hash_type(const Type& entry) { return entry.hash(); } +#define REQUIRE_COMPATIBLE_LAYOUT(Type) \ + static_assert(std::is_standard_layout<Type>::value, \ + #Type " must have standard layout") + #endif /* MACROS_H */ diff --git a/libs/hwui/utils/PaintUtils.h b/libs/hwui/utils/PaintUtils.h index 679e2bf..1a5cbf8 100644 --- a/libs/hwui/utils/PaintUtils.h +++ b/libs/hwui/utils/PaintUtils.h @@ -37,6 +37,13 @@ public: return resultMode; } + static inline GLenum getFilter(const SkPaint* paint) { + if (!paint || paint->getFilterLevel() != SkPaint::kNone_FilterLevel) { + return GL_LINEAR; + } + return GL_NEAREST; + } + // TODO: move to a method on android:Paint? replace with SkPaint::nothingToDraw()? static inline bool paintWillNotDraw(const SkPaint& paint) { return paint.getAlpha() == 0 |