diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-19 21:22:31 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-19 21:22:31 +0000 |
commit | 83d36f001d591d153b3442e9d0f3739ee984469a (patch) | |
tree | 34b782a4665736d8cc2a11f0806f13aa4c765919 /skia/ext/platform_device_win.cc | |
parent | 0026e48d1cf39bac65875fba6f5d38eb550a22f9 (diff) | |
download | chromium_src-83d36f001d591d153b3442e9d0f3739ee984469a.zip chromium_src-83d36f001d591d153b3442e9d0f3739ee984469a.tar.gz chromium_src-83d36f001d591d153b3442e9d0f3739ee984469a.tar.bz2 |
Reverting 7317.
Review URL: http://codereview.chromium.org/15089
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/platform_device_win.cc')
-rw-r--r-- | skia/ext/platform_device_win.cc | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/skia/ext/platform_device_win.cc b/skia/ext/platform_device_win.cc index 8af393d..905e9bf 100644 --- a/skia/ext/platform_device_win.cc +++ b/skia/ext/platform_device_win.cc @@ -4,6 +4,7 @@ #include "skia/ext/platform_device_win.h" +#include "base/logging.h" #include "skia/ext/skia_utils_win.h" #include "SkMatrix.h" #include "SkPath.h" @@ -25,35 +26,35 @@ void PlatformDeviceWin::InitializeDC(HDC context) { // and arcs themselves fully respect the device context's world-to-device // transformation. BOOL res = SetGraphicsMode(context, GM_ADVANCED); - SkASSERT(res != 0); + DCHECK_NE(res, 0); // Enables dithering. res = SetStretchBltMode(context, HALFTONE); - SkASSERT(res != 0); + DCHECK_NE(res, 0); // As per SetStretchBltMode() documentation, SetBrushOrgEx() must be called // right after. res = SetBrushOrgEx(context, 0, 0, NULL); - SkASSERT(res != 0); + DCHECK_NE(res, 0); // Sets up default orientation. res = SetArcDirection(context, AD_CLOCKWISE); - SkASSERT(res != 0); + DCHECK_NE(res, 0); // Sets up default colors. res = SetBkColor(context, RGB(255, 255, 255)); - SkASSERT(res != CLR_INVALID); + DCHECK_NE(res, CLR_INVALID); res = SetTextColor(context, RGB(0, 0, 0)); - SkASSERT(res != CLR_INVALID); + DCHECK_NE(res, CLR_INVALID); res = SetDCBrushColor(context, RGB(255, 255, 255)); - SkASSERT(res != CLR_INVALID); + DCHECK_NE(res, CLR_INVALID); res = SetDCPenColor(context, RGB(0, 0, 0)); - SkASSERT(res != CLR_INVALID); + DCHECK_NE(res, CLR_INVALID); // Sets up default transparency. res = SetBkMode(context, OPAQUE); - SkASSERT(res != 0); + DCHECK_NE(res, 0); res = SetROP2(context, R2_COPYPEN); - SkASSERT(res != 0); + DCHECK_NE(res, 0); } // static @@ -61,21 +62,21 @@ void PlatformDeviceWin::LoadPathToDC(HDC context, const SkPath& path) { switch (path.getFillType()) { case SkPath::kWinding_FillType: { int res = SetPolyFillMode(context, WINDING); - SkASSERT(res != 0); + DCHECK(res != 0); break; } case SkPath::kEvenOdd_FillType: { int res = SetPolyFillMode(context, ALTERNATE); - SkASSERT(res != 0); + DCHECK(res != 0); break; } default: { - SkASSERT(false); + NOTREACHED(); break; } } BOOL res = BeginPath(context); - SkASSERT(res != 0); + DCHECK(res != 0); CubicPaths paths; if (!SkPathToCubicPaths(&paths, path)) @@ -86,6 +87,7 @@ void PlatformDeviceWin::LoadPathToDC(HDC context, const SkPath& path) { ++path) { if (!path->size()) continue; + // DCHECK_EQ(points.size() % 4, 0); points.resize(0); points.reserve(path->size() * 3 / 4 + 1); points.push_back(SkPointToPOINT(path->front().p[0])); @@ -96,14 +98,14 @@ void PlatformDeviceWin::LoadPathToDC(HDC context, const SkPath& path) { points.push_back(SkPointToPOINT(point->p[2])); points.push_back(SkPointToPOINT(point->p[3])); } - SkASSERT((points.size() - 1) % 3 == 0); + DCHECK_EQ((points.size() - 1) % 3, 0); // This is slightly inefficient since all straight line and quadratic lines // are "upgraded" to a cubic line. // TODO(maruel): http://b/1147346 We should use // PolyDraw/PolyBezier/Polyline whenever possible. res = PolyBezier(context, &points.front(), static_cast<DWORD>(points.size())); - SkASSERT(res != 0); + DCHECK_NE(res, 0); if (res == 0) break; } @@ -112,7 +114,7 @@ void PlatformDeviceWin::LoadPathToDC(HDC context, const SkPath& path) { AbortPath(context); } else { res = EndPath(context); - SkASSERT(res != 0); + DCHECK(res != 0); } } @@ -181,7 +183,7 @@ bool PlatformDeviceWin::SkPathToCubicPaths(CubicPaths* paths, break; } } - SkASSERT(current_path); + DCHECK(current_path); if (!current_path) { paths->clear(); return false; @@ -218,9 +220,9 @@ void PlatformDeviceWin::LoadClippingRegionToDC(HDC context, hrgn = PathToRegion(context); } int result = SelectClipRgn(context, hrgn); - SkASSERT(result != ERROR); + DCHECK_NE(result, ERROR); result = DeleteObject(hrgn); - SkASSERT(result != 0); + DCHECK_NE(result, 0); } } // namespace skia |