From 65020430448eec8182188044fbe01d9118f5962a Mon Sep 17 00:00:00 2001 From: "dougt%meer.net" Date: Fri, 18 Nov 2005 20:57:25 +0000 Subject: [PATCH] Bug 297683. More WinCE-only GFX fixup. Setting a default palette, act more like windows 95. --- gfx/src/windows/nsDeviceContextWin.cpp | 6 ++++-- gfx/src/windows/nsFontMetricsWin.cpp | 2 +- gfx/src/windows/nsImageWin.cpp | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gfx/src/windows/nsDeviceContextWin.cpp b/gfx/src/windows/nsDeviceContextWin.cpp index 36ff7765fd6..b131e0c5730 100644 --- a/gfx/src/windows/nsDeviceContextWin.cpp +++ b/gfx/src/windows/nsDeviceContextWin.cpp @@ -607,14 +607,16 @@ NS_IMETHODIMP nsDeviceContextWin::GetPaletteInfo(nsPaletteInfo& aPaletteInfo) aPaletteInfo.sizePalette = mPaletteInfo.sizePalette; aPaletteInfo.numReserved = mPaletteInfo.numReserved; -#ifndef WINCE if (NULL == mPaletteInfo.palette) { +#ifndef WINCE HWND hwnd = (HWND)mWidget; HDC hdc = ::GetDC(hwnd); mPaletteInfo.palette = ::CreateHalftonePalette(hdc); ::ReleaseDC(hwnd, hdc); - } +#else + mPaletteInfo.palette = (HPALETTE) GetStockObject(DEFAULT_PALETTE); #endif + } aPaletteInfo.palette = mPaletteInfo.palette; diff --git a/gfx/src/windows/nsFontMetricsWin.cpp b/gfx/src/windows/nsFontMetricsWin.cpp index 4c34a67e057..b2ed5bdaa7d 100644 --- a/gfx/src/windows/nsFontMetricsWin.cpp +++ b/gfx/src/windows/nsFontMetricsWin.cpp @@ -84,7 +84,7 @@ PRBool IsWin95OrWin98() } return gIsWIN95OR98; #else - return PR_FALSE; + return PR_TRUE; #endif } diff --git a/gfx/src/windows/nsImageWin.cpp b/gfx/src/windows/nsImageWin.cpp index c1d9f114c23..b55b2ca4cb6 100644 --- a/gfx/src/windows/nsImageWin.cpp +++ b/gfx/src/windows/nsImageWin.cpp @@ -1406,6 +1406,10 @@ ALPHABLENDPROC nsImageWin::gAlphaBlend = NULL; PRBool nsImageWin::CanAlphaBlend(void) { +#ifdef WINCE + gAlphaBlend = nsnull; + return PR_FALSE; +#else static PRBool alreadyChecked = PR_FALSE; if (!alreadyChecked) { @@ -1424,6 +1428,7 @@ PRBool nsImageWin::CanAlphaBlend(void) } return gAlphaBlend != NULL; +#endif }