gpe93surf.cpp

来自「ebd9307开发板wince bsp源码,包括cs8900,lcd,nand,」· C++ 代码 · 共 104 行

CPP
104
字号
//**********************************************************************
//                                                                      
// Filename: gpe93surf.cpp
//                                                                      
// Description: Contains the class for the gpesurf for memory in the 
//              video buffer. 
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Use of this source code is subject to the terms of the Cirrus 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 
// EULA.RTF on your install media.
//
// Copyright(c) Cirrus Logic Corporation 2005, All Rights Reserved
//                                                                      
//**********************************************************************
#include    "precomp.h"

GPE93xxSurf::GPE93xxSurf
(                      
			int width,			// ... system-memory surface (i.e. DIB)
			int height,
			SurfaceHeapV* pSurface,
			ULONG  uPhyOffset,
			int size,
			int stride,
			EGPEFormat format
)
{
	m_nOffsetInVideoMemory = NULL;
	pNode = pSurface->Alloc(size);
	if( pNode != NULL )
	{
		void* pBits = (void*)(pNode->Address());
		if(pBits)
		{
			Init( width, height, pBits, stride, format
#ifdef	DD_ENABLE
                , EGPEFormatToEDDGPEPixelFormat[format]
#endif
                );
                
	        m_nOffsetInVideoMemory  = pNode->Address() + uPhyOffset - FRAMEBUF_PHYSICAL_MEMORY;
            m_fInVideoMemory        = TRUE;
		}
	}
#ifdef	DD_ENABLE
    m_fOwnsBuffer = FALSE;

    m_dwColorKeyLowValue = 0L;
    m_dwColorKeyHighValue = 0L;
    m_dwColorKeyMask = 0xFFFFFFFFL;

    lpDDSurface = NULL;
    m_pDriverData = NULL;
#endif
}

GPE93xxSurf::GPE93xxSurf
(                      
    int         width,         
    int         height,
    void        *pBits,
    int         stride,
    EGPEFormat  format,
    ULONG       ulPhysicalMemory
)
{
    pNode = NULL;
    Init( width, height, pBits, stride, format
#ifdef	DD_ENABLE
                , EGPEFormatToEDDGPEPixelFormat[format]
#endif
                );
    m_fInVideoMemory        = TRUE;
    m_nOffsetInVideoMemory  = 0;

#ifdef	DD_ENABLE
    m_fOwnsBuffer = FALSE;

    m_dwColorKeyLowValue = 0L;
    m_dwColorKeyHighValue = 0L;
    m_dwColorKeyMask = 0xFFFFFFFFL;

    lpDDSurface = NULL;
    m_pDriverData = NULL;
#endif
}

GPE93xxSurf::~GPE93xxSurf()
{
    if(pNode)
    {
		while(*GRAPHICS_BLOCKCTRL & BLOCKCTRL_ENABLE);
        pNode->Free();
    }
}

⌨️ 快捷键说明

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