⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcdcsurf.cpp

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 CPP
字号:
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
// Copyright (C) 2004-2006, Freescale Semiconductor, Inc. All Rights Reserved.
// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
//
//------------------------------------------------------------------------------


#include <windows.h>
#include <winddi.h>
#include <gpe.h>
#include <pm.h>

#include "csp.h"
#include "LcdcClass.h"

 /***********************************************************************
 *
 *  FUNCTION:	  LcdcClass
 *
 *  DESCRIPTION:  Constructor of LCDCSurf
 *
 *  PARAMETERS:		
 *
 *  RETURNS:		
 *
**********************************************************************/
LcdcSurf::LcdcSurf(	int width, 
			int height, 
			int offset, 
			void *pBits, 
			int stride, 
			EGPEFormat format, 
			Node2D *pNode) : GPESurfRotate(width, height, pBits, stride, format)
{
	DEBUGMSG(GPE_ZONE_CREATE, (TEXT("LCDCSurf::LCDCSurf\r\n")));

	m_pNode2D                 =      pNode;
	m_fInVideoMemory          =      TRUE;
	m_nOffsetInVideoMemory    =      offset;
#ifdef OEM_ALLOC_MEM	
	m_pLcdcSurfBuffer =	NULL;
#endif
}
/***********************************************************************
 *
 *  FUNCTION:	  LcdcClass
 *
 *  DESCRIPTION:  Constructor of LCDCSurf
 *
 *  PARAMETERS:		
 *
 *  RETURNS:		
 *
**********************************************************************/
#ifdef OEM_ALLOC_MEM
extern const int EGPEFormatToBpp[];
LcdcSurf::LcdcSurf(int width,
					int        height,
				 	EGPEFormat format ) : GPESurfRotate(0, 0, 0, 0,format)
 {
 	unsigned long temp;
 	if (width > 0 && height > 0)
	{
		temp = ( (EGPEFormatToBpp[ format ] * width + 7 )/ 8 + 3 ) & ~3L;
		m_pLcdcSurfBuffer = malloc( temp * height);
		Init(width, height, m_pLcdcSurfBuffer, temp, format);
		m_pNode2D = NULL;
 	}
	else
	{
		memset(this, 0, sizeof (this));
    	}	
 }
#endif
/***********************************************************************
 *
 *  FUNCTION:	  LcdcClass
 *
 *  DESCRIPTION:  Destructor of LCDCSurf
 *
 *  PARAMETERS:		
 *
 *  RETURNS:		
 *
**********************************************************************/
LcdcSurf::~LcdcSurf(void)
{
	if (m_pNode2D!=NULL) 
		m_pNode2D->Free();
#ifdef OEM_ALLOC_MEM	
	 if(m_pLcdcSurfBuffer != NULL){
		free(m_pLcdcSurfBuffer);
		m_pLcdcSurfBuffer = NULL;
	}
#endif
}
/*********************************************************************
 END OF FILE
*********************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -