/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! This module contains the logic to obtain a primitive's source texture and uv rect. //! //! Currently this is a somewhat involved process because the code grew into having ad-hoc //! ways to store this information depending on how the image data is produced. The goal //! is for any textured primitive to be able to read from any source (texture cache, render //! tasks, etc.) without primitive-specific code.
/// Resolve a resource cache's imagre request into a texture cache item. pubfn resolve_image(
request: ImageRequest,
resource_cache: &ResourceCache,
gpu_buffer: &mut GpuBufferBuilderF,
deferred_resolves: &mut FrameVec<DeferredResolve>,
is_composited: bool,
) -> CacheItem { match resource_cache.get_image_properties(request.key) {
Some(image_properties) => { // Check if an external image that needs to be resolved // by the render thread. match image_properties.external_image {
Some(external_image) => { // This is an external texture - we will add it to // the deferred resolves list to be patched by // the render thread... let uv_rect_address = gpu_buffer.reserve_renderer_deferred_blocks(BLOCKS_PER_UV_RECT);
let deferred_resolve_index = DeferredResolveIndex(deferred_resolves.len() as u32);
let image_buffer_kind = match external_image.image_type {
ExternalImageType::TextureHandle(target) => {
target
}
ExternalImageType::Buffer => { // The ExternalImageType::Buffer should be handled by resource_cache. // It should go through the non-external case.
panic!("Unexpected non-texture handle type");
}
};
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.3Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.