QuartzUISurfaceTexture: declaration reference
0.57.0-dev · beta source documentation. Native, Blueprint, Editor and rendering examples are source-reviewed, not executed in Unreal during this scan. See validation and limits.
Pinned source (source: Source/QuartzUIRuntime/Public/QuartzUISurfaceTexture.h) · integration recipe · practical guide
UQuartzUISurfaceTexture
Advanced type. Stable material-facing facade for a browser-owned native texture. The UObject and its texture reference remain stable while the browser may replace its underlying RHI texture after first paint, resize, or recovery. This object does not own another full-resolution pixel allocation.
Prerequisites / integration: Exact-player app/view and real supported RHI for rendering; project-owned HTML/materials. Use the QuartzUISurfaceTexture recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: Use component-provided texture in the matching material parameter. Session holds facade; generation-safe RHI rebinding.
Avoid: Creating a new facade every frame or assuming no backend copy. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUISurfaceTexture.h#L19)
FQuartzUISurfaceTextureTestAccess
Internal type. Narrow RHI-free public seam for deterministic facade lifetime tests.
Prerequisites / integration: Exact-player app/view and real supported RHI for rendering; project-owned HTML/materials. Use the QuartzUISurfaceTexture recipe in the host module QuartzUIRuntime.
Minimal example / lifecycle: Use component-provided texture in the matching material parameter. Session holds facade; generation-safe RHI rebinding.
Avoid: Creating a new facade every frame or assuming no backend copy. This named helper is runtime-owned; inspect/use it through the owner above rather than constructing it in gameplay.
Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUISurfaceTexture.h#L67)
Complete header
Source snapshot, not an additional example. Unreal annotations distinguish exposed Blueprint nodes from native-only/private methods.
#pragma once
#include "CoreMinimal.h"
#include "Engine/Texture.h"
#include "QuartzUISurfaceTexture.generated.h"
struct FQuartzUISurfaceTextureAccess;
struct FQuartzUISurfaceTextureBindingState;
/**
* Stable material-facing facade for a browser-owned native texture.
*
* The UObject and its texture reference remain stable while the browser may
* replace its underlying RHI texture after first paint, resize, or recovery.
* This object does not own another full-resolution pixel allocation.
*/
UCLASS(BlueprintType, Transient, hidecategories = (Adjustments, Compositing, LevelOfDetail, Object))
class QUARTZUIRUNTIME_API UQuartzUISurfaceTexture final : public UTexture
{
GENERATED_BODY()
public:
UQuartzUISurfaceTexture(const FObjectInitializer& ObjectInitializer);
FIntPoint GetPixelSize() const { return PixelSize; }
int64 GetSurfaceGeneration() const { return SurfaceGeneration; }
bool IsSurfaceAvailable() const { return bSurfaceAvailable; }
FName GetPixelFormatName() const { return PixelFormatName; }
virtual FTextureResource* CreateResource() override;
virtual EMaterialValueType GetMaterialType() const override { return MCT_Texture2D; }
virtual ETextureClass GetTextureClass() const override { return ETextureClass::Other2DNoSource; }
virtual float GetSurfaceWidth() const override { return static_cast<float>(PixelSize.X); }
virtual float GetSurfaceHeight() const override { return static_cast<float>(PixelSize.Y); }
virtual float GetSurfaceDepth() const override { return 0.0f; }
virtual uint32 GetSurfaceArraySize() const override { return 0; }
virtual FString GetDesc() override;
virtual void GetResourceSizeEx(FResourceSizeEx& CumulativeResourceSize) override;
private:
TSharedPtr<FQuartzUISurfaceTextureBindingState, ESPMode::ThreadSafe> BindingState;
uint64 NextResourceSerial = 0;
uint64 ActiveResourceSerial = 0;
UPROPERTY(Transient)
FIntPoint PixelSize = FIntPoint::ZeroValue;
UPROPERTY(Transient)
int64 SurfaceGeneration = 0;
UPROPERTY(Transient)
FName PixelFormatName = NAME_None;
UPROPERTY(Transient)
bool bSurfaceAvailable = false;
friend struct FQuartzUISurfaceTextureAccess;
friend struct FQuartzUISurfaceTextureTestAccess;
};
#if WITH_DEV_AUTOMATION_TESTS
/** Narrow RHI-free public seam for deterministic facade lifetime tests. */
struct QUARTZUIRUNTIME_API FQuartzUISurfaceTextureTestAccess final
{
static bool BindFromTexture(
UQuartzUISurfaceTexture& Facade,
UTexture& Donor,
int64 SurfaceGeneration);
static bool IsBoundToTexture(
const UQuartzUISurfaceTexture& Facade,
const UTexture& Donor);
static uint64 GetActiveResourceSerial(const UQuartzUISurfaceTexture& Facade);
static void Clear(UQuartzUISurfaceTexture& Facade, int64 SurfaceGeneration);
};
#endif