in debug, printf goes to OutputDebugString. Adding AlphaBlend stub from Brad Lassey

This commit is contained in:
dougt%meer.net 2005-11-18 21:07:19 +00:00
Родитель 6502043044
Коммит 4c14780f68
10 изменённых файлов: 247 добавлений и 1262 удалений

Двоичные данные
build/wince/shunt/build/shunt.vcb

Двоичный файл не отображается.

Просмотреть файл

@ -3,40 +3,81 @@
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: shunt - Win32 (WCE ARMV4) SmartPhone--------------------
</h3>
<h3>Command Lines</h3>
Signing c:\builds\minimo\mozilla\build\wince\shunt\build\ARMV4SmartPhone\shunt.dll
Warning: This file is signed, but not timestamped.
Succeeded
<h3>Results</h3>
shunt.dll - 0 error(s), 0 warning(s)
<h3>
--------------------Configuration: shunt - Win32 (WCE ARMV4) Debug--------------------
</h3>
<h3>Command Lines</h3>
Signing c:\builds\minimo\mozilla\build\wince\shunt\build\ARMV4Dbg\shunt.dll
Warning: This file is signed, but not timestamped.
Succeeded
<h3>Results</h3>
shunt.dll - 0 error(s), 0 warning(s)
<h3>
--------------------Configuration: shunt - Win32 (WCE emulator) Release--------------------
</h3>
<h3>Command Lines</h3>
Signing c:\builds\minimo\mozilla\build\wince\shunt\build\emulatorRel\shunt.dll
Warning: This file is signed, but not timestamped.
Succeeded
Creating temporary file "c:\DOCUME~1\dougt\LOCALS~1\Temp\RSP4A5.tmp" with contents
[
/nologo /W3 /Zi /Od /I "../include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D _WIN32_WCE=420 /D "WIN32_PLATFORM_PSPC=400" /D UNDER_CE=420 /D "UNICODE" /D "_UNICODE" /D "SHUNT_EXPORTS" /D "MOZCE_SHUNT_EXPORTS" /Fo"ARMV4Dbg/" /Fd"ARMV4Dbg/" /MC /c
"c:\builds\minimo\mozilla\build\wince\shunt\a2w.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\assert.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\clipboard.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\direct.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\errno.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\io.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\mbstring.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\nclog.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\process.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\signal.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\stat.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\stdio.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\stdlib.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\string.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\time.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\w2a.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\win32.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\win32A.cpp"
"c:\builds\minimo\mozilla\build\wince\shunt\win32W.cpp"
]
Creating command line "clarm.exe @c:\DOCUME~1\dougt\LOCALS~1\Temp\RSP4A5.tmp"
Creating temporary file "c:\DOCUME~1\dougt\LOCALS~1\Temp\RSP4A6.tmp" with contents
[
commctrl.lib coredll.lib ole32.lib uuid.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /incremental:yes /pdb:"ARMV4Dbg/shunt.pdb" /debug /nodefaultlib:"libc.lib /nodefaultlib:libcd.lib /nodefaultlib:libcmt.lib /nodefaultlib:libcmtd.lib /nodefaultlib:msvcrt.lib /nodefaultlib:msvcrtd.lib" /out:"ARMV4Dbg/shunt.dll" /implib:"ARMV4Dbg/shunt.lib" /subsystem:windowsce,4.20 /align:"4096" /MACHINE:ARM
.\ARMV4Dbg\a2w.obj
.\ARMV4Dbg\assert.obj
.\ARMV4Dbg\clipboard.obj
.\ARMV4Dbg\direct.obj
.\ARMV4Dbg\errno.obj
.\ARMV4Dbg\io.obj
.\ARMV4Dbg\mbstring.obj
.\ARMV4Dbg\nclog.obj
.\ARMV4Dbg\process.obj
.\ARMV4Dbg\signal.obj
.\ARMV4Dbg\stat.obj
.\ARMV4Dbg\stdio.obj
.\ARMV4Dbg\stdlib.obj
.\ARMV4Dbg\string.obj
.\ARMV4Dbg\time.obj
.\ARMV4Dbg\w2a.obj
.\ARMV4Dbg\win32.obj
.\ARMV4Dbg\win32A.obj
.\ARMV4Dbg\win32W.obj
]
Creating command line "link.exe @c:\DOCUME~1\dougt\LOCALS~1\Temp\RSP4A6.tmp"
<h3>Output Window</h3>
Compiling...
a2w.cpp
assert.cpp
clipboard.cpp
direct.cpp
errno.cpp
io.cpp
mbstring.cpp
nclog.cpp
process.cpp
signal.cpp
stat.cpp
stdio.cpp
stdlib.cpp
string.cpp
time.cpp
w2a.cpp
win32.cpp
win32A.cpp
win32W.cpp
Generating Code...
Linking...
Creating library ARMV4Dbg/shunt.lib and object ARMV4Dbg/shunt.exp
@ -48,23 +89,6 @@ shunt.dll - 0 error(s), 0 warning(s)
--------------------Configuration: shunt - Win32 (WCE ARMV4) Release--------------------
</h3>
<h3>Command Lines</h3>
Signing c:\builds\minimo\mozilla\build\wince\shunt\build\ARMV4Rel\shunt.dll
Warning: This file is signed, but not timestamped.
Succeeded
<h3>Results</h3>
shunt.dll - 0 error(s), 0 warning(s)
<h3>
--------------------Configuration: shunt - Win32 (WCE emulator) Debug--------------------
</h3>
<h3>Command Lines</h3>
Signing c:\builds\minimo\mozilla\build\wince\shunt\build\emulatorDbg\shunt.dll
Warning: This file is signed, but not timestamped.
Succeeded

Двоичные данные
build/wince/shunt/build/shunt.vco

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -337,7 +337,7 @@ typedef long off_t;
#define _S_IFREG 0100000 /* stat, is a normal file */
#define _S_IREAD 0000400 /* stat, can read */
#define _S_IWRITE 0000200 /* stat, can write */
#define _S_IEXEC 0000100
#define _S_IEXEC 0000100
struct mozce_stat
{
@ -449,18 +449,6 @@ typedef struct mozce_OUTLINETEXTMETRIC
#define MM_TEXT 1
#endif
typedef struct _BLENDFUNCTION
{
BYTE BlendOp;
BYTE BlendFlags;
BYTE SourceConstantAlpha;
BYTE AlphaFormat;
} BLENDFUNCTION, *PBLENDFUNCTION, *LPBLENDFUNCTION;
#define AC_SRC_OVER 0
#ifndef SM_CYVTHUMB
#define SM_CYVTHUMB 9
#endif
@ -518,5 +506,36 @@ typedef struct mozce_MAT2 {
mozce_FIXED eM21;
mozce_FIXED eM22;
} mozce_MAT2;
typedef struct _BLENDFUNCTION
{
BYTE BlendOp;
BYTE BlendFlags;
BYTE SourceConstantAlpha;
BYTE AlphaFormat;
}BLENDFUNCTION,*PBLENDFUNCTION;
//
// currentlly defined blend function
//
#define AC_SRC_OVER 0x00
//
// alpha format flags
//
#define AC_SRC_ALPHA 0x01
struct color{
unsigned char Red;
unsigned char Green;
unsigned char Blue;
double Alpha;
};
#endif

Просмотреть файл

@ -695,7 +695,11 @@
#undef OleSetClipboard
#endif
#define OleSetClipboard mozce_OleSetClipboard
#ifdef AlphaBlend
#undef AlphaBlend
#endif
#define AlphaBlend mozce_AlphaBlend
// From win32a.cpp
@ -1157,7 +1161,8 @@
#endif
#define FindNextFile FindNextFileW
#if 0
#ifdef GetProp
#undef GetProp
@ -1173,7 +1178,8 @@
#undef RemoveProp
#endif
#define RemoveProp mozce_RemovePropA
#endif
// From win32w.cpp
@ -1296,6 +1302,20 @@ extern "C" {
MOZCE_SHUNT_API size_t mozce_strftime(char *strDest, size_t maxsize, const char *format, const struct tm *timeptr);
// from win32.cpp
MOZCE_SHUNT_API BOOL mozce_AlphaBlend( HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of upper-left corner
int nYOriginDest, // y-coord of upper-left corner
int nWidthDest, // destination width
int nHeightDest, // destination height
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of upper-left corner
int nYOriginSrc, // y-coord of upper-left corner
int nWidthSrc, // source width
int nHeightSrc, // source height
BLENDFUNCTION blendFunction // alpha-blending function
);
MOZCE_SHUNT_API struct lconv * mozce_localeconv(void);

Просмотреть файл

@ -51,7 +51,7 @@ extern "C" {
** Right now, bail with a default implementation.
*/
// #define LOG_CALLS
#define LOG_CALLS
MOZCE_SHUNT_API unsigned char* mozce_mbsinc(const unsigned char* inCurrent)
{

Просмотреть файл

@ -193,7 +193,24 @@ MOZCE_SHUNT_API char* mozce_getcwd(char* buff, size_t size)
MOZCE_SHUNT_API int mozce_printf(const char * format, ...)
{
nclograw(format, strlen(format));
#ifdef DEBUG
#define MAX_CHARS_IN_VARIABLE_STRING 1024
char buf[MAX_CHARS_IN_VARIABLE_STRING];
TCHAR tBuf[MAX_CHARS_IN_VARIABLE_STRING];
va_list ptr;
va_start(ptr,format);
vsprintf(buf,format,ptr);
mbstowcs(tBuf, buf, MAX_CHARS_IN_VARIABLE_STRING);
OutputDebugString(tBuf);
return 1;
#endif
return 0;
}

Просмотреть файл

@ -904,6 +904,11 @@ MOZCE_SHUNT_API void mozce_GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFile
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b)) ? (a) : (b))
#endif
MOZCE_SHUNT_API DWORD mozce_GetFullPathName(const char* lpFileName,
DWORD nBufferLength,
const char* lpBuffer,
@ -1114,6 +1119,75 @@ MOZCE_SHUNT_API struct lconv * mozce_localeconv(void)
return &s_locale_conv;
}
MOZCE_SHUNT_API BOOL mozce_AlphaBlend(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of upper-left corner
int nYOriginDest, // y-coord of upper-left corner
int nWidthDest, // destination width
int nHeightDest, // destination height
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of upper-left corner
int nYOriginSrc, // y-coord of upper-left corner
int nWidthSrc, // source width
int nHeightSrc, // source height
BLENDFUNCTION blendFunction // alpha-blending function
){
DWORD SCA = blendFunction.SourceConstantAlpha;
int w = MIN(nWidthSrc,nWidthDest);
int h = MIN(nHeightSrc, nHeightDest);
for ( int x = 0; x<= w; x++){
for( int y = 0; y<=h; y++){
COLORREF dc = GetPixel(hdcDest, nXOriginDest+x, nYOriginDest+y);
COLORREF sc = GetPixel(hdcSrc, nXOriginSrc+x, nYOriginSrc+y);
color Src,Dst;
Src.Red = GetRValue(sc);
Dst.Red = GetRValue(dc);
Src.Green = GetGValue(sc);
Dst.Green = GetGValue(dc);
Src.Blue = GetBValue(sc);
Dst.Blue = GetBValue(dc);
Src.Alpha = 1.0 - (double)((sc >> 24)/255.0);
Dst.Alpha = 1.0 - (double)((dc >> 24)/255.0);
//Src.Alpha = 1.0;//(double)((sc >> 24)/255.0);
//Dst.Alpha = 1.0;//(double)((dc >> 24)/255.0);
if(blendFunction.AlphaFormat & AC_SRC_ALPHA){
Dst.Red = (unsigned char)(Src.Red * (SCA/255.0) + Dst.Red * (1.0 - (SCA/255.0)));
Dst.Green = (unsigned char)(Src.Green * (SCA/255.0) + Dst.Green * (1.0 - (SCA/255.0)));
Dst.Blue = (unsigned char)(Src.Blue * (SCA/255.0) + Dst.Blue * (1.0 - (SCA/255.0)));
Dst.Alpha = MAX(0,MIN(1,Src.Alpha * (SCA/255.0) + Dst.Alpha * (1.0 - (SCA/255.0))));
}else if(SCA == 0xff){
Dst.Red = (unsigned char)(Src.Alpha*Src.Red + (1 - Src.Alpha) * Dst.Red);
Dst.Green = (unsigned char)(Src.Alpha*Src.Green + (1 - Src.Alpha) * Dst.Green);
Dst.Blue = (unsigned char)(Src.Alpha*Src.Blue + (1 - Src.Alpha) * Dst.Blue);
Dst.Alpha = MAX(0,MIN(1,Src.Alpha + (1 - Src.Alpha) * Dst.Alpha));
}else{
Src.Red = (unsigned char)(Src.Red * SCA / 255.0);
Src.Green = (unsigned char)(Src.Green * SCA / 255.0);
Src.Blue = (unsigned char)(Src.Blue * SCA / 255.0);
Src.Alpha = MAX(0,MIN(1,Src.Alpha * SCA / 255.0));
double t = (Src.Red + (1 - Src.Alpha) * Dst.Red);
Dst.Red = (unsigned char)(t>255?255:t);
t = (Src.Green + (1 - Src.Alpha) * Dst.Green);
Dst.Green = (unsigned char)(t>255?255:t);
t = (Src.Blue + (1 - Src.Alpha) * Dst.Blue);
Dst.Blue = (unsigned char)(t>255?255:t);
Dst.Alpha = MAX(0,MIN(1,Src.Alpha + (1 - Src.Alpha) * Dst.Alpha));
}
SetPixel(hdcDest,nXOriginDest+x, nYOriginDest+y, RGB(Dst.Red,Dst.Green,Dst.Blue));
//(((unsigned char)(Dst.Alpha*255) & 0xff) << 24)|
}
}
return true;
}
#if 0
{
#endif
@ -1124,9 +1198,9 @@ void dumpMemoryInfo()
MEMORYSTATUS ms;
ms.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&ms);
wprintf(L"-> %d %d %d %d %d %d %d\n",
ms.dwMemoryLoad,
ms.dwTotalPhys,

Просмотреть файл

@ -236,17 +236,17 @@ MOZCE_SHUNT_API BOOL mozce_CreateProcessA(LPCSTR pszImageName, LPCSTR pszCmdLine
#ifdef DEBUG
mozce_printf("mozce_CreateProcessA called\n");
#endif
LPTSTR image = a2w_malloc(pszImageName, -1, NULL);
LPTSTR cmdline = a2w_malloc(pszCmdLine, -1, NULL);
LPTSTR image = a2w_malloc(pszImageName, -1, NULL);
LPTSTR cmdline = a2w_malloc(pszCmdLine, -1, NULL);
BOOL retval = CreateProcessW(image, cmdline, NULL, NULL, FALSE, fdwCreate, NULL, NULL, NULL, pProcInfo);
if (image)
free(image);
if (cmdline)
free(cmdline);
if (image)
free(image);
if (cmdline)
free(cmdline);
return retval;
}
@ -664,31 +664,38 @@ MOZCE_SHUNT_API BOOL mozce_ExtTextOutA(HDC inDC, int inX, int inY, UINT inOption
MOZCE_PRECHECK
#ifdef DEBUG
mozce_printf("mozce_ExtTextOutA called\n");
mozce_printf("mozce_ExtTextOutA (%s) called\n", inString);
#endif
BOOL retval = false;
if (inCount == -1)
inCount = strlen(inString);
inCount = strlen(inString);
int wLen = 0;
LPTSTR wStr = a2w_malloc(inString, inCount, &wLen);
if(NULL != wStr)
{
{
retval = ExtTextOutW(inDC, inX, inY, inOptions, inRect, wStr, wLen, inDx);
free(wStr);
wStr = NULL;
}
return retval;
}
MOZCE_SHUNT_API BOOL mozce_TextOutA(HDC hdc, int nXStart, int nYStart, const char* lpString, int cbString)
{
return mozce_ExtTextOutA(hdc, nXStart, nYStart, 0, NULL, lpString, cbString, NULL);
MOZCE_PRECHECK
#ifdef DEBUG
mozce_printf("mozce_TextOutA (%s) called\n", lpString);
#endif
return mozce_ExtTextOutA(hdc, nXStart, nYStart, 0, NULL, lpString, cbString, NULL);
}
MOZCE_SHUNT_API DWORD mozce_GetGlyphOutlineA(HDC inDC, CHAR inChar, UINT inFormat, void* inGM, DWORD inBufferSize, LPVOID outBuffer, CONST mozce_MAT2* inMAT2)