Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(773)

Unified Diff: skia/ext/skia_utils_win.cc

Issue 14903: Reverting 7318. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/platform_device_win.cc ('k') | skia/ext/vector_canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_win.cc
===================================================================
--- skia/ext/skia_utils_win.cc (revision 7318)
+++ skia/ext/skia_utils_win.cc (working copy)
@@ -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 @@
// 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
« no previous file with comments | « skia/ext/platform_device_win.cc ('k') | skia/ext/vector_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698