The expression (1 << 31) is technically undefined.
Fixed the undefined shift referenced by this bug and
a few friends.
R=reed@google.com
BUG=skia:2285
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=
1737363002
Review URL: https://codereview.chromium.org/
1737363002
*/
class SK_API SkCanvas : public SkRefCnt {
enum PrivateSaveLayerFlags {
- kDontClipToLayer_PrivateSaveLayerFlag = 1 << 31,
+ kDontClipToLayer_PrivateSaveLayerFlag = 1U << 31,
};
public:
#define SK_MinS32 -SK_MaxS32
#define SK_MaxU32 0xFFFFFFFF
#define SK_MinU32 0
-#define SK_NaN32 (1 << 31)
+#define SK_NaN32 ((int) (1U << 31))
/** Returns true if the value can be represented with signed 16bits
*/
// make x positive
x = (x ^ sign) - sign;
// set the sign bit as needed
- x |= sign << 31;
+ x |= SkLeftShift(sign, 31);
return x;
}
const GrMatrixConvolutionEffect& m = processor.cast<GrMatrixConvolutionEffect>();
SkASSERT(m.kernelSize().width() <= 0x7FFF && m.kernelSize().height() <= 0xFFFF);
uint32_t key = m.kernelSize().width() << 16 | m.kernelSize().height();
- key |= m.convolveAlpha() ? 1 << 31 : 0;
+ key |= m.convolveAlpha() ? 1U << 31 : 0;
b->add32(key);
b->add32(GrTextureDomain::GLDomain::DomainKey(m.domain()));
}