#include <offscrn.h>
Inheritance diagram for GRenderRegionWrapper:
Public Member Functions | |
GRenderRegionWrapper () | |
~GRenderRegionWrapper () | |
virtual BOOL | Initialise (GRenderRegion *pActiveRR, double ResFactor, DocRect AreaOfDocumentToRender, UINT32 bpp, BOOL NeedsTransp)=0 |
virtual BOOL | RestorePreviousRendererState ()=0 |
virtual GRenderRegion * | GetRenderRegion ()=0 |
void | GetBitmapPointers (LPBITMAPINFO *bi, LPBYTE *by) |
void | SetBitmapPointers (LPBITMAPINFO bi, LPBYTE by) |
KernelBitmap * | GetKernelBitmap () |
Static Public Member Functions | |
static GRenderRegionWrapper * | GetAppropriateRenderWrapper (GRenderRegion *pActiveRR, double ResFactor, DocRect AreaOfDocumentToRender, UINT32 bpp, BOOL NeedsTransp) |
static ConcurrentRenderer * | GetConcurrentRenderer (GRenderRegion *pSourceRR, double ResFactor, DocRect AreaOfDocumentToRender, UINT32 bpp, BOOL NeedsTransp) |
Create and use a concurrent renderer. This flavour of render wrapper derives from QuickRenderer, and creates a fresh GRenderRegion, whose rendering matrix is based on the source RR. | |
static void | NewWrappedRRCreated (GRenderRegion *pGrr) |
static void | GetBitmapPointers (GRenderRegion *pGrr, LPBITMAPINFO *bi, LPBYTE *by) |
Definition at line 141 of file offscrn.h.
|
Definition at line 147 of file offscrn.h.
|
|
Definition at line 148 of file offscrn.h.
|
|
Definition at line 141 of file offscrn.cpp. 00147 { 00148 if(NeedsTransp) 00149 { 00150 ENSURE(bpp==32,"Can only handle transp when rendering to 32bpp bmp"); 00151 if(bpp!=32) 00152 return NULL; 00153 } 00154 00155 GRenderRegionWrapper* pNewWrap = NULL; 00156 00157 if(pActiveRR == NULL) 00158 { 00159 pNewWrap = (GRenderRegionWrapper*) new QuickRenderer(); 00160 } 00161 else 00162 { 00163 if(ResFactor!=1.0 || bpp!=32) 00164 { 00165 pNewWrap = (GRenderRegionWrapper*) new ConcurrentRenderer(); 00166 } 00167 else 00168 { 00169 // can only use offscreen rendering system in 32bpp mode and 00170 // using same resolution as screen (ie same kernel matrix) 00171 pNewWrap = (GRenderRegionWrapper*) new GDrawBorrower(); 00172 } 00173 } 00174 00175 if(!pNewWrap->Initialise(pActiveRR, ResFactor, AreaOfDocumentToRender, bpp, NeedsTransp)) 00176 { 00177 // failed to init. free mem. 00178 delete pNewWrap; 00179 return NULL; 00180 } 00181 00182 // initialised and ready to render 00183 return pNewWrap; 00184 }
|
|
Definition at line 286 of file offscrn.cpp. 00287 { 00288 *bi = pGrr->pBitmapInfo; 00289 *by = pGrr->pBits; 00290 }
|
|
Definition at line 271 of file offscrn.cpp. 00272 { 00273 GRenderRegion *pGrr = GetRenderRegion(); 00274 *bi = pGrr->pBitmapInfo; 00275 *by = pGrr->pBits; 00276 }
|
|
Create and use a concurrent renderer. This flavour of render wrapper derives from QuickRenderer, and creates a fresh GRenderRegion, whose rendering matrix is based on the source RR.
ConcurrentRenderer* pRendWrap = GRenderRegionWrapper::GetConcurrentRenderer(...) GRenderRegion* pOffscreenRR = pRendWrap->GetRenderRegion(); pOffscreenRR->SetFillColour(COLOUR_BLACK); pOffscreenRR->SetLineColour(COLOUR_TRANS); pOffscreenRR->DrawPath(pPathToDraw); pRendWrap->GetBitmapPointers(&pBmpInfo, &pBmpBits); pRendWrap->RestorePreviousRendererState();
Definition at line 231 of file offscrn.cpp. 00237 { 00238 ERROR2IF(NeedsTransp && (bpp != 32), NULL, "Can only do transp with 32 bpp bitmaps"); 00239 00240 ConcurrentRenderer* pNewWrap = new ConcurrentRenderer; 00241 if (!pNewWrap->Initialise(pSourceRR, ResFactor, AreaOfDocumentToRender, bpp, NeedsTransp)) 00242 { 00243 delete pNewWrap; 00244 pNewWrap = NULL; 00245 } 00246 00247 return pNewWrap; 00248 }
|
|
Definition at line 315 of file offscrn.cpp. 00316 { 00317 LPBITMAPINFO bi; 00318 LPBYTE by; 00319 GetBitmapPointers(&bi,&by); 00320 00321 LPBITMAPINFOHEADER bh = &bi->bmiHeader; 00322 if(bh->biCompression==0x80000001) 00323 { 00324 GetRenderRegion()->GetDrawContext()->ConvertBitmap( 00325 bh, by, 00326 bh, by, 00327 0 00328 ); 00329 } 00330 00331 CWxBitmap* pTempBmp= new CWxBitmap(bi, by); 00332 KernelBitmap* kBmp = new KernelBitmap(pTempBmp,TRUE); 00333 return kBmp; 00334 }
|
|
Implemented in GDrawBorrower, and QuickRenderer. |
|
Implemented in GDrawBorrower, QuickRenderer, and ConcurrentRenderer. |
|
Definition at line 259 of file offscrn.cpp. 00260 { 00261 pGrr->SetIsWrapped(TRUE); 00262 }
|
|
Implemented in GDrawBorrower, QuickRenderer, and ConcurrentRenderer. |
|
Definition at line 302 of file offscrn.cpp. 00303 { 00304 GRenderRegion *pGrr = GetRenderRegion(); 00305 pGrr->SetBitmapPointers(bi, by); 00306 }
|