summaryrefslogtreecommitdiffstats
path: root/skia/ext/skia_utils_win.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 21:43:04 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 21:43:04 +0000
commitf2f0a6fe6ea3b0eff50bdbc6ffc8c65b7559912f (patch)
tree87a5bbf67d6a5db8ac56c8fcb9942dfcca3c6866 /skia/ext/skia_utils_win.cc
parentdf3c1ca1d62d9bb67e10b2d514082b8ac7ac0277 (diff)
downloadchromium_src-f2f0a6fe6ea3b0eff50bdbc6ffc8c65b7559912f.zip
chromium_src-f2f0a6fe6ea3b0eff50bdbc6ffc8c65b7559912f.tar.gz
chromium_src-f2f0a6fe6ea3b0eff50bdbc6ffc8c65b7559912f.tar.bz2
Reverting 7318.
Review URL: http://codereview.chromium.org/14903 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/skia_utils_win.cc')
-rw-r--r--skia/ext/skia_utils_win.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/skia/ext/skia_utils_win.cc b/skia/ext/skia_utils_win.cc
index f6c8006..59bef6d 100644
--- a/skia/ext/skia_utils_win.cc
+++ b/skia/ext/skia_utils_win.cc
@@ -2,18 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <windows.h>
+
#include "skia/ext/skia_utils_win.h"
-#include "base/logging.h"
#include "SkRect.h"
#include "SkGradientShader.h"
namespace {
-COMPILE_ASSERT(offsetof(RECT, left) == offsetof(SkIRect, fLeft), o1);
-COMPILE_ASSERT(offsetof(RECT, top) == offsetof(SkIRect, fTop), o2);
-COMPILE_ASSERT(offsetof(RECT, right) == offsetof(SkIRect, fRight), o3);
-COMPILE_ASSERT(offsetof(RECT, bottom) == offsetof(SkIRect, fBottom), o4);
+template <bool>
+struct CompileAssert {
+};
+
+#undef COMPILE_ASSERT
+#define COMPILE_ASSERT(expr, msg) \
+ typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
+
+COMPILE_ASSERT(SK_OFFSETOF(RECT, left) == SK_OFFSETOF(SkIRect, fLeft), o1);
+COMPILE_ASSERT(SK_OFFSETOF(RECT, top) == SK_OFFSETOF(SkIRect, fTop), o2);
+COMPILE_ASSERT(SK_OFFSETOF(RECT, right) == SK_OFFSETOF(SkIRect, fRight), o3);
+COMPILE_ASSERT(SK_OFFSETOF(RECT, bottom) == SK_OFFSETOF(SkIRect, fBottom), o4);
COMPILE_ASSERT(sizeof(RECT().left) == sizeof(SkIRect().fLeft), o5);
COMPILE_ASSERT(sizeof(RECT().top) == sizeof(SkIRect().fTop), o6);
COMPILE_ASSERT(sizeof(RECT().right) == sizeof(SkIRect().fRight), o7);
@@ -48,7 +57,7 @@ COLORREF SkColorToCOLORREF(SkColor color) {
// Currently, Alpha is always 255 or the color is 0 so there is no need to
// demultiply the channels. If this DCHECK() is ever hit, the full
// (SkColorGetX(color) * 255 / a) will have to be added in the conversion.
- DCHECK((0xFF == SkColorGetA(color)) || (0 == color));
+ SkASSERT((0xFF == SkColorGetA(color)) || (0 == color));
#ifndef _MSC_VER
return RGB(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color));
#else