You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Texture 2D array streaming is implemented through FTexture2DArrayMipAllocator_Reallocate Volume texture streaming is implemented through FVolumeTextureMipAllocator_Reallocate. New generic stream out implementation in FTextureStreamOut. Fixed different issues in FTexture2DMipDataProvider_IO relatively to optional bulks and IO errors. Added UTexture::GetSurfaceDepth() for 3d textures. Added UTexture::GetSurfaceArraySize() for array textures (where cubemaps return 6). Moved UTexture2D::CancelPendingTextureStreaming() and UTexture2D::LevelIndex to UTexture. Renamed UTexture2DArray::GetNumSlices() to UTexture2DArray::GetArraySize(). Fixed missing "virtual" keyword in base class UTextureMipDataProviderFactory. Updated the texture editor UI so that it shows Texture2DArray array sizes and Texture3D depth. Unified the UI for cubemaps so that it shows as an array with size 6. Reimplemented "LODGroups" command to make it coherent with latest changes. #rb jian.ru, danny.couture, matt.peters #fyi mihnea.balta #jira UE-97975, UE-81395, UE-102061, UE-84427 [CL 14832616 by Uriel Doyon in ue5-main branch]
101 lines
2.7 KiB
C++
101 lines
2.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreTypes.h"
|
|
#include "Containers/EnumAsByte.h"
|
|
#include "Engine/Texture.h"
|
|
#include "Math/Color.h"
|
|
#include "Math/IntPoint.h"
|
|
#include "Misc/Timespan.h"
|
|
#include "Templates/SharedPointer.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
#include "UObject/ScriptMacros.h"
|
|
#include "WebBrowserTextureSample.h"
|
|
|
|
#include "WebBrowserTexture.generated.h"
|
|
|
|
/**
|
|
* Implements a texture asset for rendering webbrowser output for Android.
|
|
*/
|
|
UCLASS(hidecategories = (Adjustments, Compositing, LevelOfDetail, Object))
|
|
class WEBBROWSERTEXTURE_API UWebBrowserTexture
|
|
: public UTexture
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
/** The addressing mode to use for the X axis. */
|
|
TEnumAsByte<TextureAddress> AddressX;
|
|
|
|
/** The addressing mode to use for the Y axis. */
|
|
TEnumAsByte<TextureAddress> AddressY;
|
|
|
|
/** Whether to clear the texture when no media is being played (default = enabled). */
|
|
bool AutoClear;
|
|
|
|
/** The color used to clear the texture if AutoClear is enabled (default = black). */
|
|
FLinearColor ClearColor;
|
|
|
|
public:
|
|
|
|
/**
|
|
* Gets the current aspect ratio of the texture.
|
|
*
|
|
* @return Texture aspect ratio.
|
|
* @see GetHeight, GetWidth
|
|
*/
|
|
float GetAspectRatio() const;
|
|
|
|
/**
|
|
* Gets the current height of the texture.
|
|
*
|
|
* @return Texture height (in pixels).
|
|
* @see GetAspectRatio, GetWidth
|
|
*/
|
|
int32 GetHeight() const;
|
|
|
|
/**
|
|
* Gets the current width of the texture.
|
|
*
|
|
* @return Texture width (in pixels).
|
|
* @see GetAspectRatio, GetHeight
|
|
*/
|
|
int32 GetWidth() const;
|
|
|
|
public:
|
|
//~ UTexture interface.
|
|
virtual void BeginDestroy() override;
|
|
virtual FTextureResource* CreateResource() override;
|
|
virtual EMaterialValueType GetMaterialType() const override;
|
|
virtual float GetSurfaceWidth() const override;
|
|
virtual float GetSurfaceHeight() const override;
|
|
virtual float GetSurfaceDepth() const override { return 0; }
|
|
virtual uint32 GetSurfaceArraySize() const override { return 0; }
|
|
virtual FGuid GetExternalTextureGuid() const override;
|
|
|
|
public:
|
|
//~ UObject interface.
|
|
virtual FString GetDesc() override;
|
|
virtual void GetResourceSizeEx(FResourceSizeEx& CumulativeResourceSize) override;
|
|
|
|
void TickResource(TSharedPtr<FWebBrowserTextureSample, ESPMode::ThreadSafe> Sample);
|
|
|
|
void SetExternalTextureGuid(FGuid guid);
|
|
protected:
|
|
/** Unregister the player's external texture GUID. */
|
|
void UnregisterPlayerGuid();
|
|
|
|
private:
|
|
/** Current width and height of the resource (in pixels). */
|
|
FIntPoint Dimensions;
|
|
|
|
/** The previously used player GUID. */
|
|
FGuid WebPlayerGuid;
|
|
|
|
/** Texture sample queue. */
|
|
TSharedPtr<FWebBrowserTextureSampleQueue, ESPMode::ThreadSafe> SampleQueue;
|
|
|
|
/** Current size of the resource (in bytes).*/
|
|
SIZE_T Size;
|
|
};
|