#include <offattr.h>
Inheritance diagram for OffscreenAttrValue:
Public Member Functions | |
~OffscreenAttrValue () | |
virtual BOOL | IsDifferent (AttributeValue *) |
Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality. | |
virtual void | SimpleCopy (AttributeValue *pOther) |
virtual void | Restore (RenderRegion *, BOOL) |
virtual void | Render (RenderRegion *, BOOL Temp=FALSE) |
virtual DocRect | GetOffscreenBoundingRect () |
virtual void | SetOffscreenBoundingRect (const DocRect drOffBB) |
virtual BOOL | DoesOffscreenBmpRequireTransp (GRenderRegion *pGRR=NULL) |
As an optimisation, you can make this call on an offscreen attribute, and only allocate + use a transparency-capable bitmap if it is necessary. eg, this results in about a 10% performance increase for feathering. | |
BOOL | TestNodeForTransparency (Node *pNode=NULL) |
Test the given node to see whether it or any of its children requires transparency. | |
virtual void | GetMinimumOffscreenBmpDimensions (UINT32 *RequiredWidth, UINT32 *RequiredHeight) |
virtual BOOL | DoesOffscreenBMPCaptureBackground () |
void | SetAlwaysUseTransparency () |
void | UnsetAlwaysUseTransparency () |
virtual void | OffscreenRenderingCompleted (RenderRegion *pRender, LPBITMAPINFO lpBitmapInfo, LPBYTE lpBits, DocRect BitmapRect)=0 |
Protected Member Functions | |
OffscreenAttrValue () | |
Protected Attributes | |
DocRect | m_OffBB |
BOOL | m_fForceTransparency |
Definition at line 156 of file offattr.h.
|
Definition at line 201 of file offattr.cpp. 00202 { 00203 m_fForceTransparency = FALSE; 00204 #ifdef DEBUGOFFSCREENATTRS 00205 m_fHasBeenRendered = FALSE; 00206 #endif 00207 }
|
|
Definition at line 217 of file offattr.cpp.
|
|
Reimplemented in FeatherAttrValue. Definition at line 190 of file offattr.h. 00190 {return FALSE;}
|
|
As an optimisation, you can make this call on an offscreen attribute, and only allocate + use a transparency-capable bitmap if it is necessary. eg, this results in about a 10% performance increase for feathering.
See also: TestNodeForTransparency() Reimplemented in FeatherAttrValue. Definition at line 330 of file offattr.cpp. 00331 { 00332 // if we've been told to always use transparency, then always return TRUE here. 00333 if (m_fForceTransparency) 00334 return TRUE; 00335 00336 // our normal behaviour - test our linked node to see whether it needs transparency. 00337 return TestNodeForTransparency(GetLinkedNode()); 00338 }
|
|
Reimplemented in FeatherAttrValue. Definition at line 189 of file offattr.h.
|
|
Definition at line 300 of file offattr.cpp. 00301 { 00302 return m_OffBB; 00303 }
|
|
Compare two AttributeValue objects. The base class version always returns TRUE - derived classes should override this function to provide functionality.
Reimplemented from AttributeValue. Definition at line 230 of file offattr.cpp. 00231 { 00232 return TRUE; 00233 }
|
|
Implemented in FeatherAttrValue. |
|
Implements AttributeValue. Reimplemented in FeatherAttrValue. Definition at line 246 of file offattr.cpp. 00247 { 00248 // Debug test for an offscreen attribute being Render()'ed multiple times without 00249 // OffscreenRenderingCompleted() being called. This is easily caused by: 00250 // 1. rendering code which isn't bracketed by calls to SaveContext() / RestoreContext() 00251 // 2. rendering an attribute map which includes an offscreen attr - you must be careful 00252 // that you don't inadvertently render the attr twice. 00253 // 00254 // Reason: offscreen attrs initialise and divert subsequent rendering into an offscreen 00255 // bitmap, which is retrieved and processed when the attribute goes out of scope 00256 // after a RestoreContext() call. Render the attr twice => you'll be creating 00257 // and maybe rendering into an offscreen bitmap which is never used + may also 00258 // cause a memory leak of that bitmap. 00259 #ifdef DEBUGOFFSCREENATTRS 00260 if (!IsDefaultFlagSet()) 00261 { 00262 if (m_fHasBeenRendered) 00263 { 00264 char msg[120]; 00265 sprintf(msg, "OffscreenAttrValue::Render; Attr at 0x%x rendered more than once! See code for details!", (DWORD)this); 00266 ERROR3(msg); 00267 return; 00268 } 00269 else 00270 { 00271 m_fHasBeenRendered = TRUE; 00272 } 00273 } 00274 #endif 00275 00276 pRender->SetOffscreen(this); 00277 }
|
|
Implements AttributeValue. Reimplemented in FeatherAttrValue. Definition at line 288 of file offattr.cpp. 00289 { 00290 pRegion->RestoreOffscreen(this); 00291 }
|
|
Definition at line 193 of file offattr.h. 00193 { m_fForceTransparency = TRUE; }
|
|
Definition at line 184 of file offattr.h. 00184 { m_OffBB = drOffBB; }
|
|
Reimplemented from GeometryLinkedAttrValue. Reimplemented in FeatherAttrValue. Definition at line 171 of file offattr.h. 00172 { 00173 GeometryLinkedAttrValue::SimpleCopy(pOther); 00174 m_fForceTransparency = ((OffscreenAttrValue*)pOther)->m_fForceTransparency; 00175 }
|
|
Test the given node to see whether it or any of its children requires transparency.
Definition at line 355 of file offattr.cpp. 00356 { 00357 // return TRUE if the node is NULL, just in case transparency is later required. 00358 if (pNode == NULL || !pNode->IsNodeRenderableClass()) 00359 return TRUE; 00360 00361 // check the node to see whether it is see-through, remembering to test 00362 // its indirectly applied attributes. 00363 return ((NodeRenderable*)pNode)->IsSeeThrough(TRUE); 00364 }
|
|
Definition at line 196 of file offattr.h. 00196 { m_fForceTransparency = FALSE; }
|
|
|
|
|