The pdEngineSetParams function sets important Power Engine parameters. These parameters can be used to fine-tune the performance of D-Type Power Engine and/or change its memory footprint.
Parameter | Description |
---|---|
engine |
Handle of the previously created Power Engine instance. |
params |
A valid pointer to the DT_PD_ENGINE_PARAMS structure. This structure contains important run-time parameters for the specified Power Engine. The members of this structure have the following meaning: CacheBytes — Size limit for Power Engine's caching subsystem in bytes. Must be non-negative. This optional caching subsystem is designed to boost Power Engine's performance and is primarily used as a temporary buffer during rendering. For example, Power Engine documents may use this cache as a buffer for alpha-masking. Or, various text objects may choose to store in this buffer positional glyph data obtained from character codes during text layout operations and later reuse it when rendering the same text. The default size limit of this cache depends on the platform and version of the engine but is typically set to 6 MB (6,291,456 bytes). If you wish to set the size limit of Power Engine's caching subsystem to a larger or smaller value, change CacheBytes accordingly. CacheItems — This parameter specifies the maximum number of items that Power Engine's caching subsystem can simultaneously hold. Must be non-negative. The default value is 1000. If you wish to increase or decrease this value, change CacheItems accordingly. Reserved1 — Reserved for future use. Must be set to 0. Reserved2 — Reserved for future use. Must be set to 0. |
reserved |
Reserved for future use. Must be set to 0. |
If successful, the return value is 1. Otherwise, the function returns 0.
While the CacheBytes member of the DT_PD_ENGINE_PARAMS structure puts a restriction on the size of D-Type Power Engine's cache, this is not always its true maximum size. In some situations the size of the caching subsystem may temporarily exceed the limit specified by CacheBytes in order to hold a large single object. For example, if CacheBytes is set to 1 MB and the size of the object to be temporarily stored in the cache is 1.2 MB, the caching subsystem will grow to 1.2 MB in order to hold this object. However, any subsequent requests to store any additional objects in the cache will remove the ones that are using too much space and bring the size of the cache below the value specified by CacheBytes.