remove tricky asint

Bug: skia:
Change-Id: I8d5f9b29b48273a3648dfe925ff3e9e8d0ee71f3
Reviewed-on: https://skia-review.googlesource.com/c/187060
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2019-01-25 17:05:08 -05:00 committed by Skia Commit-Bot
parent 5d982feca8
commit f6a2348535

View File

@ -359,10 +359,6 @@ void SkPaint::setLooper(sk_sp<SkDrawLooper> looper) { fDrawLooper = std::move(lo
#include "SkStream.h" #include "SkStream.h"
static uintptr_t asint(const void* p) {
return reinterpret_cast<uintptr_t>(p);
}
#ifdef SK_DEBUG #ifdef SK_DEBUG
static void ASSERT_FITS_IN(uint32_t value, int bitCount) { static void ASSERT_FITS_IN(uint32_t value, int bitCount) {
SkASSERT(bitCount > 0 && bitCount <= 32); SkASSERT(bitCount > 0 && bitCount <= 32);
@ -495,12 +491,12 @@ static uint32_t unpack_v68(SkPaint* paint, uint32_t packed, SkSafeRange& safe) {
void SkPaintPriv::Flatten(const SkPaint& paint, SkWriteBuffer& buffer) { void SkPaintPriv::Flatten(const SkPaint& paint, SkWriteBuffer& buffer) {
uint8_t flatFlags = 0; uint8_t flatFlags = 0;
if (asint(paint.getPathEffect()) | if (paint.getPathEffect() ||
asint(paint.getShader()) | paint.getShader() ||
asint(paint.getMaskFilter()) | paint.getMaskFilter() ||
asint(paint.getColorFilter()) | paint.getColorFilter() ||
asint(paint.getLooper()) | paint.getLooper() ||
asint(paint.getImageFilter())) { paint.getImageFilter()) {
flatFlags |= kHasEffects_FlatFlag; flatFlags |= kHasEffects_FlatFlag;
} }