亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? blt_alpha.cpp

?? 6410BSP3
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// Copyright (c) Samsung Electronics. Co. LTD.  All rights reserved.
//
/*++
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.

Module Name:    blt_alpha.cpp

Abstract:       alphablended accelerated bitblt/rectangle for S3C6410 FIMGSE-2D

Functions:


Notes:


--*/

#include "precomp.h"

/// From Frame Buffer to Frame Buffer Directly
/// Constraints
/// Source Surface's width is same with Destination Surface's width.
/// Source and Dest must be in Video FrameBuffer Region
/// In Surface Format
/// ScreenHeight and ScreenWidth means logical looking aspect for application
/// Height and Width means real data format.
/// This function will copy the source and destination surface into scratch buffer
/**
*   @fn SCODE S3C6410Disp::AcceleratedAlphaSrcCopyBlt(GPEBltParms *pBltParms)
*   @brief  Do Blit with SRCCOPY, SRCAND, SRCPAINT, SRCINVERT
*   @param  pBltParms    Blit Parameter Information Structure
*   @sa     GPEBltParms
*   @note   ROP : 0xCCCC(SRCCOPY), 0x8888(SRCAND), 0x6666(SRCINVERT), 0XEEEE(SRCPAINT)
*   @note   Using Information : DstSurface, ROP, Solidcolor
*/
SCODE S3C6410Disp::AcceleratedAlphaSrcCopyBlt(GPEBltParms *pBltParms)
{
    PRECTL prclSrc, prclDst;
    RECT rectlSrcBackup;
    RECT rectlDstBackup;
    BOOL bHWSuccess = FALSE;
    BOOL bSrcInScratch = FALSE;
    BOOL bDstInScratch = FALSE;
    
    /// Allocation Scratch Framebuffer to process Bottom-Up Image
    DDGPESurf *SrcScratchSurf = NULL;
    DDGPESurf *DstScratchSurf = NULL;
    DDGPESurf *pDstClone = NULL;    
    GPESurf *OldSrcSurf = NULL;
    GPESurf *OldDstSurf = NULL;
    
    prclSrc = pBltParms->prclSrc;
    prclDst = pBltParms->prclDst;
    
    /**
    *   Prepare Source & Destination Surface Information
    */
    SURFACE_DESCRIPTOR descSrcSurface, descDstSurface;
    DWORD   dwTopStrideStartAddr = 0;

    descSrcSurface.dwColorMode = GetHWColorFormat(pBltParms->pSrc);
    descDstSurface.dwColorMode = GetHWColorFormat(pBltParms->pDst);
    /// !!!!Surface Width may not match to Real Data format!!!!
    /// !!!!Set Width by Scan Stride Size!!!!
    descSrcSurface.dwHoriRes = ABS(SURFACE_WIDTH(pBltParms->pSrc));
    descDstSurface.dwHoriRes = ABS(SURFACE_WIDTH(pBltParms->pDst));

    if(pBltParms->pDst->IsRotate())
    {
        RotateRectl(prclDst);   //< RotateRectl rotate rectangle with screen rotation information
        if(pBltParms->prclClip)
        {
            RotateRectl(pBltParms->prclClip);
        }
    }
    if(pBltParms->pSrc->IsRotate())
    {
        RotateRectl(prclSrc);
    }

    if (pBltParms->bltFlags & BLT_TRANSPARENT)
    {
        RETAILMSG(0,(TEXT("TransparentMode Color : %d\n"), pBltParms->solidColor));
        // turn on transparency & set comparison color
        m_oG2D->SetTransparentMode(1, pBltParms->solidColor);
    }

    switch (pBltParms->rop4)
    {
    case    0x6666: // SRCINVERT
        m_oG2D->SetRopEtype(ROP_SRC_XOR_DST);
        break;
    case    0x8888: // SRCAND
        m_oG2D->SetRopEtype(ROP_SRC_AND_DST);
        break;
    case    0xCCCC: // SRCCOPY
        m_oG2D->SetRopEtype(ROP_SRC_ONLY);
        break;
    case    0xEEEE: // SRCPAINT
        m_oG2D->SetRopEtype(ROP_SRC_OR_DST);
        break;
    }

    /// Check Source Rectangle Address
    /// HW Coordinate limitation is 2040
    /// 1. Get the Top line Start Address
    /// 2. Set the base offset to Top line Start Address
    /// 3. Recalulate top,bottom rectangle
    /// 4. Do HW Bitblt

    CopyRect(&rectlSrcBackup, (LPRECT)pBltParms->prclSrc);
    CopyRect(&rectlDstBackup, (LPRECT)pBltParms->prclDst);

    /// Destination's Region can have negative coordinate, especially for left, top point
    /// In this case, For both destination, source's rectangle must be clipped again to use HW.
    ClipDestDrawRect(pBltParms);
    
    /// Set Source Surface Information
    if((pBltParms->pSrc->Stride() > 0) && (pBltParms->pSrc->Stride() > 0) && (pBltParms->pSrc == pBltParms->pDst) 
        && !(pBltParms->pSrc)->InVideoMemory() )  // OnScreen BitBlt
    {
        dwTopStrideStartAddr = m_dwPhyAddrOfSurface[0];
        descSrcSurface.dwBaseaddr = dwTopStrideStartAddr;
        descSrcSurface.dwVertRes = (pBltParms->pSrc->ScreenHeight() != 0 ) ? pBltParms->pSrc->ScreenHeight() : pBltParms->pSrc->Height();
        descDstSurface.dwBaseaddr = descSrcSurface.dwBaseaddr;
        descDstSurface.dwVertRes = descSrcSurface.dwVertRes;
        RETAILMSG(DISP_ZONE_2D,(TEXT("Onscreen CachedBitBlt:Addr:0x%x, Height:%d\r\n"), descSrcSurface.dwBaseaddr, descSrcSurface.dwVertRes));
    }
    else        // OffScreen BitBlt
    {
        if((( DDGPESurf *)(pBltParms->pSrc))->InVideoMemory() )
        {
            descSrcSurface.dwBaseaddr = (m_VideoMemoryPhysicalBase + (( DDGPESurf *)(pBltParms->pSrc))->OffsetInVideoMemory());
            /// If surface is created by user temporary, that has no screen width and height.
            descSrcSurface.dwVertRes = (pBltParms->pSrc->ScreenHeight() != 0 ) ? pBltParms->pSrc->ScreenHeight() : pBltParms->pSrc->Height();
            RETAILMSG(DISP_ZONE_2D,(TEXT("Offscreen BitBlt Src in VideoMem:Addr:0x%x, Height:%d\r\n"), descSrcSurface.dwBaseaddr, descSrcSurface.dwVertRes));
        } 
        else
        {
            // In this case, WE must copy source area
            if(pBltParms->pSrc->Stride() < 0)
            {
                bHWSuccess = CreateScratchSurface(pBltParms->pSrc, &SrcScratchSurf, pBltParms->prclSrc, &descSrcSurface, pBltParms->pSrc->Format(), TRUE);
                
                if(!bHWSuccess)
                {
                    goto PostHWBitBlt;
                }

                OldSrcSurf = pBltParms->pSrc;   
                pBltParms->pSrc = SrcScratchSurf;
                bSrcInScratch = TRUE;
                RETAILMSG(DISP_ZONE_2D,(TEXT("SBBase:0x%x, Vert:%d, Hori:%d, CM:%d\r\n"), descSrcSurface.dwBaseaddr, descSrcSurface.dwVertRes,
                descSrcSurface.dwHoriRes, descSrcSurface.dwColorMode));
            }
            else
            {
                if(m_dwPhyAddrOfSurface[0] == NULL) // Copy
                {
                    bHWSuccess = CreateScratchSurface(pBltParms->pSrc, &SrcScratchSurf, pBltParms->prclSrc, &descSrcSurface, pBltParms->pSrc->Format(),TRUE);
                    
                    if(!bHWSuccess)
                    {
                        goto PostHWBitBlt;
                    }
                    
                    OldSrcSurf = pBltParms->pSrc;   
                    pBltParms->pSrc = SrcScratchSurf;
                    bSrcInScratch = TRUE;                    
                    RETAILMSG(DISP_ZONE_2D,(TEXT("STBase:0x%x, Vert:%d, Hori:%d, CM:%d\r\n"), descSrcSurface.dwBaseaddr, descSrcSurface.dwVertRes,
                    descSrcSurface.dwHoriRes, descSrcSurface.dwColorMode));                
                }
                else
                {
                    dwTopStrideStartAddr = m_dwPhyAddrOfSurface[0] + pBltParms->prclSrc->top * pBltParms->pSrc->Stride();
                    descSrcSurface.dwBaseaddr = dwTopStrideStartAddr;
                    descSrcSurface.dwVertRes = RECT_HEIGHT(pBltParms->prclSrc);

                    pBltParms->prclSrc->top = 0;
                    pBltParms->prclSrc->bottom = descSrcSurface.dwVertRes;
                    RETAILMSG(DISP_ZONE_2D,(TEXT("STVBase:0x%x, Vert:%d, Hori:%d, CM:%d\r\n"), descSrcSurface.dwBaseaddr, descSrcSurface.dwVertRes,
                    descSrcSurface.dwHoriRes, descSrcSurface.dwColorMode));
                    
                }
            }
        }

        /// Set Destination Surface Information
        if(((DDGPESurf *)(pBltParms->pDst))->InVideoMemory() )
        {
            descDstSurface.dwBaseaddr = (m_VideoMemoryPhysicalBase + (( DDGPESurf *)(pBltParms->pDst))->OffsetInVideoMemory());
            /// If surface is created by user temporary, that has no screen width and height.
            descDstSurface.dwVertRes = (pBltParms->pDst->ScreenHeight() != 0 ) ? pBltParms->pDst->ScreenHeight() : pBltParms->pDst->Height();
            RETAILMSG(DISP_ZONE_2D,(TEXT("Offscreen BitBlt Dst in VideoMem:Addr:0x%x, Height:%d\r\n"), descDstSurface.dwBaseaddr, descDstSurface.dwVertRes));            
        }
        else
        {
            if(pBltParms->pDst->Stride() < 0)
            {
                bHWSuccess = CreateScratchSurface(pBltParms->pDst, &DstScratchSurf, pBltParms->prclDst, &descDstSurface, pBltParms->pDst->Format(), TRUE);
                
                if(!bHWSuccess)
                {
                    goto PostHWBitBlt;
                }
                
                OldDstSurf = pBltParms->pDst;   
                pBltParms->pDst = DstScratchSurf;
                bDstInScratch = TRUE;                
                RETAILMSG(DISP_ZONE_2D,(TEXT("DBBase:0x%x, Vert:%d, Hori:%d, CM:%d\r\n"), descDstSurface.dwBaseaddr, descDstSurface.dwVertRes,
                descDstSurface.dwHoriRes, descDstSurface.dwColorMode));
    /*            
                RETAILMSG(DISP_ZONE_WARNING,(TEXT("I don't know about this case\n")));
                return EmulatedBlt(pBltParms);
    */
            }
            else
            {
                if(m_dwPhyAddrOfSurface[1] == NULL) // Prepare
                {  
                    bHWSuccess = CreateScratchSurface(pBltParms->pDst, &DstScratchSurf, pBltParms->prclDst, &descDstSurface, pBltParms->pDst->Format(), TRUE);
                    
                    if(!bHWSuccess)
                    {
                        goto PostHWBitBlt;
                    }
                    
                    OldDstSurf = pBltParms->pDst;   
                    pBltParms->pDst = DstScratchSurf;
                    bDstInScratch = TRUE;                    
                    RETAILMSG(DISP_ZONE_2D,(TEXT("DTBase:0x%x, Vert:%d, Hori:%d, CM:%d\r\n"), descDstSurface.dwBaseaddr, descDstSurface.dwVertRes,
                    descDstSurface.dwHoriRes, descDstSurface.dwColorMode));
                
                }
                else
                {
                    dwTopStrideStartAddr = m_dwPhyAddrOfSurface[1] + pBltParms->prclDst->top * pBltParms->pDst->Stride();
                    descDstSurface.dwBaseaddr = dwTopStrideStartAddr;
                    descDstSurface.dwVertRes = RECT_HEIGHT(pBltParms->prclDst);
                    pBltParms->prclDst->top = 0;
                    pBltParms->prclDst->bottom = descDstSurface.dwVertRes;
                    RETAILMSG(DISP_ZONE_2D,(TEXT("DTVBase:0x%x, Vert:%d, Hori:%d, CM:%d\r\n"), descDstSurface.dwBaseaddr, descDstSurface.dwVertRes,
                    descDstSurface.dwHoriRes, descDstSurface.dwColorMode));
                }
            }
        }
    }

    m_oG2D->Set3rdOperand(G2D_OPERAND3_PAT);

    // AlphaBlending Equation, Perpixel and Perplane same.
    // Data = (Source * (ALPHA+1) + destination *(256-ALPHA)) >> 8
    // Fading
    // Data = ((Source * (ALPHA+1) ) >>8) + fading offset
    //
    
    // Check if Constant Alpha or Per-Pixel Alpha
    if(pBltParms->blendFunction.AlphaFormat != 0 && pBltParms->blendFunction.SourceConstantAlpha != 0xFF)
    {
        SURFACE_DESCRIPTOR descRealSrcSurface;
        SURFACE_DESCRIPTOR descRealDstSurface;        
        GPESurf *pDstBackup=0;
        RECT rectDstBackup;
        RECT rectSrcBackup;
        RECT rectBackupCloneDst;
        
        // Backup original source region, This can be Scratch Surface's region
        CopyRect(&rectSrcBackup, (LPRECT)pBltParms->prclSrc);            
        // Backup original destination region
        CopyRect(&rectDstBackup, (LPRECT)pBltParms->prclDst);
        // Bakcup original destination surface
        pDstBackup = pBltParms->pDst;
        
        // backup real source Surface.
        memcpy(&descRealSrcSurface, &descSrcSurface, sizeof(SURFACE_DESCRIPTOR));
    
        // if Per-Pixel Alpha with SCA then we just run 2 alphablend call
        // set destination descriptor as source descriptor.
        // prepare scratch for fading.
        if(!bSrcInScratch)
        {
            bHWSuccess = CreateScratchSurface(pBltParms->pSrc, &SrcScratchSurf, pBltParms->prclSrc, &descSrcSurface, pBltParms->pSrc->Format(), FALSE);

            OldSrcSurf = pBltParms->pSrc;
            pBltParms->pSrc = SrcScratchSurf;
            bSrcInScratch = TRUE;    
        }

        // Replace Target region as source itself
        pBltParms->prclDst = pBltParms->prclSrc;
        // Replace Target Surface as Source Surface
        pBltParms->pDst = pBltParms->pSrc;

        m_oG2D->SetAlphaMode(G2D_FADING_MODE); //< Self Fading AlphaBlend
        m_oG2D->SetAlphaValue(pBltParms->blendFunction.SourceConstantAlpha);
        // Do SCA to self(fading mode).
        bHWSuccess = HWBitBlt(pBltParms, &descRealSrcSurface, &descSrcSurface);        
        
        ///////
        // restore destination region
        pBltParms->prclDst = (LPRECTL)&rectDstBackup;
        // restore destination surface
        pBltParms->pDst = pDstBackup;

        if(!bHWSuccess)
        {
            goto PostHWBitBlt;
        }
        
#define ALPHABIT_WORKAROUND2 (TRUE)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费性生活视频播放| 亚洲午夜激情网站| 成人看片黄a免费看在线| 午夜精品福利一区二区三区av | 国产一区二区三区高清播放| 亚洲欧美日韩人成在线播放| 日本一区二区三区电影| 久久伊99综合婷婷久久伊| 91精品国产手机| 51精品秘密在线观看| 欧美一级高清大全免费观看| 日韩欧美精品在线| 亚洲图片有声小说| eeuss影院一区二区三区| 成人免费视频网站在线观看| 欧美一区二区三区在线观看 | 国产精品狼人久久影院观看方式| 久久蜜桃av一区二区天堂| 久久久www免费人成精品| 日韩激情在线观看| 久久99国产精品免费| 国产一本一道久久香蕉| 91精品黄色片免费大全| 午夜免费久久看| 欧美最猛黑人xxxxx猛交| 欧美精品在线一区二区| 精品国产乱码久久久久久久| 国产拍揄自揄精品视频麻豆| 国产在线精品一区二区夜色| 成人午夜私人影院| 久久嫩草精品久久久久| 精品无人区卡一卡二卡三乱码免费卡| 欧美老女人在线| 亚洲国产视频一区二区| 欧美高清hd18日本| 日韩av网站免费在线| 成人免费视频免费观看| 国产精品久久久久久久久动漫| 国产.欧美.日韩| 91精品国产乱| 久久99国内精品| 精品国产乱码久久久久久久久| 国内精品久久久久影院色| 精品国产乱码久久久久久久 | 五月婷婷色综合| 91精品国产综合久久久久久久| 日韩成人午夜精品| 久久日韩粉嫩一区二区三区| 国产毛片精品国产一区二区三区| 国产欧美日产一区| 欧美精选午夜久久久乱码6080| 午夜成人免费电影| 精品区一区二区| 亚洲激情自拍偷拍| 成人网页在线观看| 亚洲美女免费视频| 欧美一区二区三区成人| 国产精品一二三在| 欧美精品一区二区三区蜜桃视频| 国产米奇在线777精品观看| 中文一区一区三区高中清不卡| 视频在线观看国产精品| 久久综合色婷婷| 色视频一区二区| 国产精品色哟哟| 国产1区2区3区精品美女| 亚洲精品综合在线| 精品国产1区二区| 91猫先生在线| 亚洲色图欧美在线| 色呦呦一区二区三区| 日韩电影在线免费观看| 中文文精品字幕一区二区| 欧美午夜精品一区二区三区| 欧美国产欧美综合| 51精品秘密在线观看| av在线不卡观看免费观看| 日本不卡一区二区三区高清视频| 国产欧美一区二区三区鸳鸯浴| 欧美性欧美巨大黑白大战| 国产成人在线视频网址| 久久精品网站免费观看| 国产成人自拍在线| 日韩va欧美va亚洲va久久| 亚洲欧美另类久久久精品| 日韩欧美黄色影院| 欧美日韩一区二区三区高清| 午夜影院久久久| 欧美videos大乳护士334| 在线观看成人小视频| 成人黄色综合网站| 一区二区三区在线免费视频| 欧美性色欧美a在线播放| 不卡一区二区在线| 国产成人综合视频| 韩国午夜理伦三级不卡影院| 午夜精品久久久久久久久久久 | 久久久国产精华| 6080yy午夜一二三区久久| 91在线丨porny丨国产| 亚洲午夜私人影院| 亚洲欧美一区二区三区久本道91| 国产人伦精品一区二区| 亚洲精品一线二线三线| 日韩一区二区免费高清| 欧美日韩精品一区二区三区四区 | 亚洲妇熟xx妇色黄| 玉米视频成人免费看| 国产精品久久久久久久久免费相片| 欧美精品一区二区三区很污很色的 | 国产成人欧美日韩在线电影| 久久疯狂做爰流白浆xx| 一色屋精品亚洲香蕉网站| 在线播放91灌醉迷j高跟美女| 91免费国产在线| 白白色 亚洲乱淫| 成a人片国产精品| 色综合久久中文字幕综合网| 99精品欧美一区二区三区小说| 波多野结衣欧美| 91小视频在线| 在线观看成人小视频| 欧美日韩精品一区二区三区蜜桃| 欧美伦理影视网| 日韩欧美在线1卡| 精品国产成人系列| 国产精品无码永久免费888| 中文字幕一区二区不卡| 一区二区三区在线观看网站| 亚洲一区在线观看视频| 国产精品色哟哟| 亚洲欧美一区二区三区极速播放| 玉足女爽爽91| 免费在线看成人av| 洋洋av久久久久久久一区| 日韩精品国产精品| 国产一区视频导航| aaa国产一区| 欧美日韩三级一区| 久久久久久久久久美女| 中文字幕一区二| 天堂久久一区二区三区| 国产精品夜夜爽| 欧美日韩一区二区不卡| 精品国产亚洲一区二区三区在线观看| 国产亚洲精品bt天堂精选| 亚洲久草在线视频| 裸体健美xxxx欧美裸体表演| 亚洲一区二区三区三| 精品一区二区在线观看| 91视频.com| 日韩欧美成人一区二区| 最新国产精品久久精品| 日本网站在线观看一区二区三区| 国产99久久精品| 欧美日韩国产免费| 中文字幕色av一区二区三区| 免费成人av资源网| 99久久精品国产导航| 精品av综合导航| 亚洲一区二区在线观看视频| 福利一区二区在线| 7777精品久久久大香线蕉| 中文字幕一区二区三区在线不卡| 日本视频免费一区| 欧美综合色免费| 国产精品久久久一本精品| 蜜桃精品视频在线观看| 欧美色精品在线视频| 中文字幕在线观看一区| 久久99久久99| 在线播放一区二区三区| 一区二区三区日韩欧美精品| 国产成a人亚洲| 欧美成人午夜电影| 午夜精品一区在线观看| 91国模大尺度私拍在线视频| 在线免费观看成人短视频| 国产日韩在线不卡| 精品一区二区在线看| 91.com视频| 丝袜亚洲精品中文字幕一区| 色婷婷av一区| √…a在线天堂一区| 成人午夜av影视| 久久久精品综合| 国产一区二区三区免费看| 欧美xxxxx牲另类人与| 男男视频亚洲欧美| 在线不卡免费av| 日韩电影免费一区| 91精品麻豆日日躁夜夜躁| 天堂va蜜桃一区二区三区| 欧美日本国产视频| 亚洲国产成人va在线观看天堂| 在线看一区二区| 亚洲综合另类小说| 欧美丝袜自拍制服另类| 亚洲成av人综合在线观看| 欧美性生活大片视频|