uiacceltk/hitchcock/coretoolkit/src/huicanvaswspainter.cpp
branchRCL_3
changeset 15 cd0ae4656946
parent 13 3a60ebea00d0
child 18 1801340c26a2
equal deleted inserted replaced
13:3a60ebea00d0 15:cd0ae4656946
    42 #include <graphics/wsgraphicscontext.h>
    42 #include <graphics/wsgraphicscontext.h>
    43 
    43 
    44 #ifdef HUI_DEBUG_TRACK_DRAWING
    44 #ifdef HUI_DEBUG_TRACK_DRAWING
    45 #include "alfloggingconfiguration.h"
    45 #include "alfloggingconfiguration.h"
    46 #include "alfcommanddebug.h"
    46 #include "alfcommanddebug.h"
       
    47 #include "huistatictlsdata.h"
    47 #endif
    48 #endif
    48 #include <e32cmn.h>
    49 #include <e32cmn.h>
    49 #include <AknLayoutFont.h>
    50 #include <AknLayoutFont.h>
    50 #include <graphics/lookuptable.h>
    51 #include <graphics/lookuptable.h>
    51 
    52 
   124     else
   125     else
   125         {
   126         {
   126         // Never happens, right.
   127         // Never happens, right.
   127         }
   128         }
   128     
   129     
   129     iWsCommandBufferReader = new (ELeave) CHuiCanvasCmdBufferReader();    
   130     iWsCommandBufferReader = new (ELeave) CHuiCanvasCmdBufferReader(); 
   130 #ifdef HUI_DEBUG_TRACK_DRAWING
   131     
   131     iCommandDebugger = CAlfCommandDebug::NewL();
   132     #ifdef HUI_DEBUG_TRACK_DRAWING
   132     CHuiCanvasWsGc* realGc = iCanvasWsGc;
   133     if (!iCanvasDebugWsGc)
   133     iCanvasWsGc = CHuiCanvasDebugWsGc::NewL( realGc, *iCommandDebugger );
   134         {
   134     
   135         iCanvasDebugWsGc = CHuiCanvasDebugWsGc::NewL( iCanvasWsGc, *TTlsData::CommandDebugger() );
   135 #endif
   136         iCanvasWsGc = iCanvasDebugWsGc;
       
   137         }
       
   138     
       
   139     #endif
   136     }
   140     }
   137 
   141 
   138 
   142 
   139 CHuiCanvasWsPainter::~CHuiCanvasWsPainter()
   143 CHuiCanvasWsPainter::~CHuiCanvasWsPainter()
   140     {
   144     {
   155 
   159 
   156     iTempRegion.Close();
   160     iTempRegion.Close();
   157     iTempCurrentSubRegion.Close();
   161     iTempCurrentSubRegion.Close();
   158     iTempIntersectingRegion.Close();
   162     iTempIntersectingRegion.Close();
   159 #ifdef HUI_DEBUG_TRACK_DRAWING
   163 #ifdef HUI_DEBUG_TRACK_DRAWING
   160     delete iCommandDebugger;
   164     delete iCanvasDebugWsGc;
   161 #endif
   165 #endif
   162     iFullUpdateRegion.Close();
   166     iFullUpdateRegion.Close();
   163     iShapeRegion.Close();
   167     iShapeRegion.Close();
   164     }
   168     }
   165     
   169     
   765                 }
   769                 }
   766             default:;
   770             default:;
   767             }
   771             }
   768         }
   772         }
   769 
   773 
   770     iCommandDebugger->StartFrame();
   774     TTlsData::CommandDebugger()->StartFrame();
   771     if ( commandBuffer->iProcessName )
   775     if ( commandBuffer->iProcessName )
   772         {
   776         {
   773         // UNCOMMENT THIS IF YOU WANT TO PRINT EVERYTHING
   777         // UNCOMMENT THIS IF YOU WANT TO PRINT EVERYTHING
   774         // iCommandDebugger->SetPrint( ETrue );
   778         // iCommandDebugger->SetPrint( ETrue );
   775         // UNCOMMENT THIS IF YOU WANT PRINTS ONLY FOR CERTAIN PROCESS!
   779         // UNCOMMENT THIS IF YOU WANT PRINTS ONLY FOR CERTAIN PROCESS!
   801     TInt command = 0;
   805     TInt command = 0;
   802     do
   806     do
   803         {
   807         {
   804         command = readerStream.ReadUint8L();
   808         command = readerStream.ReadUint8L();
   805 #ifdef HUI_DEBUG_TRACK_DRAWING
   809 #ifdef HUI_DEBUG_TRACK_DRAWING
   806         iCommandDebugger->SetDescription( command );
   810         TTlsData::CommandDebugger()->SetDescription( command );
   807 #endif
   811 #endif
   808 
   812 
   809 		// Command cases are ordered approximately in the order so that most common ones are at first
   813 		// Command cases are ordered approximately in the order so that most common ones are at first
   810         switch ( command )
   814         switch ( command )
   811             {
   815             {
  1290             }// end switch
  1294             }// end switch
  1291     		offset = readerStream.Source()->TellL( MStreamBuf::ERead ).Offset();
  1295     		offset = readerStream.Source()->TellL( MStreamBuf::ERead ).Offset();
  1292        	
  1296        	
  1293         } while( offset < bufLength );
  1297         } while( offset < bufLength );
  1294 #ifdef HUI_DEBUG_TRACK_DRAWING
  1298 #ifdef HUI_DEBUG_TRACK_DRAWING
  1295     iCommandDebugger->EndFrame();
  1299     TTlsData::CommandDebugger()->EndFrame();
  1296 #endif    
  1300 #endif    
  1297     }
  1301     }
  1298     
  1302     
  1299     
  1303     
  1300 void CHuiCanvasWsPainter::SetCommandSetL( const TDesC8& aCommands )
  1304 void CHuiCanvasWsPainter::SetCommandSetL( const TDesC8& aCommands )
  2144     iTempRegion.Clear();                
  2148     iTempRegion.Clear();                
  2145     iWsCommandBufferReader->ReadRegionL( iTempRegion );
  2149     iWsCommandBufferReader->ReadRegionL( iTempRegion );
  2146     if (aIndex==-1) return; //TP
  2150     if (aIndex==-1) return; //TP
  2147     // Update region is modified when new buffers are added after this buffer, 
  2151     // Update region is modified when new buffers are added after this buffer, 
  2148     // so store the region only at first read. 
  2152     // so store the region only at first read. 
  2149     if (iCommandBuffers[aIndex]->iChanged && iCommandBuffers[aIndex]->iUpdateRegion.Count() == 0)
  2153     if (iCommandBuffers[aIndex]->iChanged && iCommandBuffers[aIndex]->iOriginalUpdateRegion.Count() == 0)
  2150         {
  2154         {
  2151         // Check first that the coordiates are not insane (sometimes thay are)
  2155         // Check first that the coordiates are not insane (sometimes thay are)
  2152         TInt count = iTempRegion.Count();                    
  2156         TInt count = iTempRegion.Count();                    
  2153         TRect displayRect = iCanvasVisual->DisplayRect();
  2157         TRect displayRect = iCanvasVisual->DisplayRect();
  2154         for (TInt i=count-1; i>=0; i--)
  2158         for (TInt i=count-1; i>=0; i--)
  2756         // Forward 'enable render buffer' setting to new GC.
  2760         // Forward 'enable render buffer' setting to new GC.
  2757         iCanvasWsGc->EnableRenderbuffer( iEnableRenderBuffer );
  2761         iCanvasWsGc->EnableRenderbuffer( iEnableRenderBuffer );
  2758         }
  2762         }
  2759 
  2763 
  2760     #ifdef HUI_DEBUG_TRACK_DRAWING
  2764     #ifdef HUI_DEBUG_TRACK_DRAWING
  2761     CHuiCanvasWsGc* realGc = iCanvasWsGc;
  2765     if (!iCanvasDebugWsGc)
  2762     iCanvasWsGc = CHuiCanvasDebugWsGc::NewL( realGc, *iCommandDebugger );
  2766         {
       
  2767         iCanvasDebugWsGc = CHuiCanvasDebugWsGc::NewL( iCanvasWsGc, *TTlsData::CommandDebugger() );
       
  2768         }
       
  2769     else if(iCanvasWsGc!=iCanvasDebugWsGc) 
       
  2770         {
       
  2771         iCanvasDebugWsGc->SetInternalGc(iCanvasWsGc);
       
  2772         }
       
  2773     
       
  2774     iCanvasWsGc = iCanvasDebugWsGc;
  2763     #endif
  2775     #endif
  2764     
  2776     
  2765     AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC();
  2777     AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC();
  2766     }
  2778     }
  2767 
  2779