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

📄 halsurf.cpp

📁 Intel PXA27X Display Driver Windows CE
💻 CPP
📖 第 1 页 / 共 2 页
字号:
//
// 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.
//
// -----------------------------------------------------------------------------
//
//  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.
//
// -----------------------------------------------------------------------------
/* 
** INTEL CONFIDENTIAL
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors.  Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel抯
** prior express written permission.

** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
*/
#include "precomp.h"

extern "C" BOOL bDoRotation;

extern "C" void DispDrvrDirtyRectDump(LPCRECT prc);

DWORD WINAPI HalFlipToGDISurface( LPDDHAL_FLIPTOGDISURFACEDATA pd )
{
    DEBUGENTER( HalFlipToGDISurface );
    /*
    typedef struct _DDHAL_FLIPTOGDISURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL    lpDD;             // driver struct
        DWORD                      dwToGDI;          // TRUE if flipping to the GDI surface, FALSE if flipping away
        DWORD                      dwReserved;       // reserved for future use
        HRESULT                    ddRVal;           // return value
        LPDDHAL_FLIPTOGDISURFACE   FlipToGDISurface; // PRIVATE: ptr to callback
    } DDHAL_FLIPTOGDISURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalCreateSurface( LPDDHAL_CREATESURFACEDATA pd )
{
    DEBUGENTER( HalCreateSurface );
    /*
    typedef struct _DDHAL_CREATESURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDSURFACEDESC             lpDDSurfaceDesc;// description of surface being created
        LPDDRAWI_DDRAWSURFACE_LCL   FAR *lplpSList; // list of created surface objects
        DWORD                       dwSCnt;         // number of surfaces in SList
        HRESULT                     ddRVal;         // return value
        LPDDHAL_CREATESURFACE       CreateSurface;  // PRIVATE: ptr to callback
    } DDHAL_CREATESURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

//////////////////////////// DDHAL_DDEXEBUFCALLBACKS ////////////////////////////

DWORD WINAPI HalCanCreateSurface( LPDDHAL_CANCREATESURFACEDATA pd )
{
    DEBUGENTER( HalCanCreateSurface );
    /*
    typedef struct _DDHAL_CANCREATESURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL    lpDD;                // driver struct
        LPDDSURFACEDESC            lpDDSurfaceDesc;    // description of surface being created
        DWORD                    bIsDifferentPixelFormat;
                                                    // pixel format differs from primary surface
        HRESULT                    ddRVal;                // return value
        LPDDHAL_CANCREATESURFACE    CanCreateSurface;
                                                    // PRIVATE: ptr to callback
    } DDHAL_CANCREATESURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalCreateExecuteBuffer( LPDDHAL_CREATESURFACEDATA pd )
{
    DEBUGENTER( HalCreateExecuteBuffer );
    /*
    typedef struct _DDHAL_CREATESURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDSURFACEDESC             lpDDSurfaceDesc;// description of surface being created
        LPDDRAWI_DDRAWSURFACE_LCL   FAR *lplpSList; // list of created surface objects
        DWORD                       dwSCnt;         // number of surfaces in SList
        HRESULT                     ddRVal;         // return value
        LPDDHAL_CREATESURFACE       CreateSurface;  // PRIVATE: ptr to callback
    } DDHAL_CREATESURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}


DWORD WINAPI HalDestroyExecuteBuffer( LPDDHAL_DESTROYSURFACEDATA pd )
{
    DEBUGENTER( HalDestroyExecutebuffer );
    /*
    typedef struct _DDHAL_DESTROYSURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        HRESULT                     ddRVal;         // return value
        LPDDHALSURFCB_DESTROYSURFACE DestroySurface;// PRIVATE: ptr to callback
        BOOL                        fDestroyGlobal;
    } DDHAL_DESTROYSURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalLock( LPDDHAL_LOCKDATA pd )
{
    DEBUGENTER( HalLock );
    /*
    typedef struct _DDHAL_LOCKDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        DWORD                       bHasRect;       // rArea is valid
        RECTL                       rArea;          // area being locked
        LPVOID                      lpSurfData;     // pointer to screen memory (return value)
        HRESULT                     ddRVal;         // return value
        LPDDHALSURFCB_LOCK          Lock;           // PRIVATE: ptr to callback
    } DDHAL_LOCKDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalUnlock( LPDDHAL_UNLOCKDATA pd )
{
    DEBUGENTER( HalUnlock );
    /*
    typedef struct _DDHAL_UNLOCKDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        HRESULT                     ddRVal;            // return value
        LPDDHALSURFCB_UNLOCK        Unlock;         // PRIVATE: ptr to callback
    } DDHAL_UNLOCKDATA;
    */

    DDGPEUnlock(pd);

    if (bDoRotation
        && pd->lpDDSurface->lpGbl->fpVidMem == (DWORD)g_pGPE->PrimarySurface()->Buffer())
    {
        RECT rc;

        rc.left   = 0;
        rc.top    = 0;
        rc.right  = g_pGPE->PrimarySurface()->Width();
        rc.bottom = g_pGPE->PrimarySurface()->Height();

        DispDrvrDirtyRectDump(&rc);
    }

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

//////////////////////////// DDHAL_DDSURFACECALLBACKS ////////////////////////////

DWORD WINAPI HalDestroySurface( LPDDHAL_DESTROYSURFACEDATA pd )
{
    DEBUGENTER( HalDestroySurface );
    /*
    typedef struct _DDHAL_DESTROYSURFACEDATA
    {
        LPDDRAWI_DIRECTDRAW_GBL     lpDD;           // driver struct
        LPDDRAWI_DDRAWSURFACE_LCL   lpDDSurface;    // surface struct
        HRESULT                     ddRVal;         // return value
        LPDDHALSURFCB_DESTROYSURFACE DestroySurface;// PRIVATE: ptr to callback
        BOOL                        fDestroyGlobal;
    } DDHAL_DESTROYSURFACEDATA;
    */

    // Implementation
    pd->ddRVal = DD_OK;

    return DDHAL_DRIVER_HANDLED;
}

DWORD WINAPI HalSetSurfaceDesc(LPDDHAL_HALSETSURFACEDESCDATA pd)
{
    DEBUGENTER( HalSetSurfaceDesc );
    /*
        typedef struct _DDHAL_HALSETSURFACEDESCDATA
        {
            DWORD           dwSize;                 // Size of this structure
            LPDDRAWI_DDRAWSURFACE_LCL  lpDDSurface; // Surface
            LPDDSURFACEDESC    lpddsd;                    // Description of surface
            HRESULT         ddrval;
        } DDHAL_HALSETSURFACEDESCDATA;
    */

    // Implementation

⌨️ 快捷键说明

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