Disable optimization of certain bit-shift operations on Visual Studio 2010 only

to address http://code.google.com/p/skia/issues/detail?id=472
Review URL: https://codereview.appspot.com/5607058

git-svn-id: http://skia.googlecode.com/svn/trunk@3137 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
epoger@google.com 2012-02-02 20:41:45 +00:00
parent b02af6edf3
commit 5468c9006e

View File

@ -71,6 +71,12 @@ static inline int repeat_8bits(int x) {
// Mirror
// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
// See http://code.google.com/p/skia/issues/detail?id=472
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", off)
#endif
static inline SkFixed mirror_tileproc(SkFixed x) {
int s = x << 15 >> 31;
return (x ^ s) & 0xFFFF;
@ -99,6 +105,10 @@ static inline int mirror_8bits(int x) {
#endif
}
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#pragma optimize("", on)
#endif
///////////////////////////////////////////////////////////////////////////////
typedef SkFixed (*TileProc)(SkFixed);