From 5f5f726ce6207733a8cab2fb3b5852ddffba0826 Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Mon, 26 Feb 2024 09:56:14 -0500 Subject: [PATCH] Revert "Rename member name for clarity" This reverts commit e16a3e1ac47f6709035f8bd70235f3f99f859578. --- Cesium3DTilesSelection/src/Tile.cpp | 7 +++---- Cesium3DTilesSelection/src/TilesetContentManager.cpp | 5 ++--- CesiumGltf/include/CesiumGltf/ImageCesium.h | 2 +- CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp | 9 ++++----- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Cesium3DTilesSelection/src/Tile.cpp b/Cesium3DTilesSelection/src/Tile.cpp index 2ea992cb2..932dd5b0d 100644 --- a/Cesium3DTilesSelection/src/Tile.cpp +++ b/Cesium3DTilesSelection/src/Tile.cpp @@ -173,10 +173,9 @@ int64_t Tile::computeByteSize() const noexcept { bytes -= bufferViews[size_t(bufferView)].byteLength; } - // lastKnownSizeInBytes is set in - // TilesetContentManager::ContentKindSetter, if not sooner (e.g., by the - // renderer implementation). - bytes += image.cesium.lastKnownSizeInBytes; + // sizeBytes is set in TilesetContentManager::ContentKindSetter, if not + // sooner (e.g., by the renderer implementation). + bytes += image.cesium.sizeBytes; } } diff --git a/Cesium3DTilesSelection/src/TilesetContentManager.cpp b/Cesium3DTilesSelection/src/TilesetContentManager.cpp index 56de0a169..117db2daf 100644 --- a/Cesium3DTilesSelection/src/TilesetContentManager.cpp +++ b/Cesium3DTilesSelection/src/TilesetContentManager.cpp @@ -53,9 +53,8 @@ struct ContentKindSetter { // size now. We'll be adding this number to our total memory usage soon, // and remove it when the tile is later unloaded, and we must use // the same size in each case. - if (image.cesium.lastKnownSizeInBytes < 0) { - image.cesium.lastKnownSizeInBytes = - int64_t(image.cesium.pixelData.size()); + if (image.cesium.sizeBytes < 0) { + image.cesium.sizeBytes = int64_t(image.cesium.pixelData.size()); } } diff --git a/CesiumGltf/include/CesiumGltf/ImageCesium.h b/CesiumGltf/include/CesiumGltf/ImageCesium.h index 9d62724e9..939ada0ae 100644 --- a/CesiumGltf/include/CesiumGltf/ImageCesium.h +++ b/CesiumGltf/include/CesiumGltf/ImageCesium.h @@ -109,6 +109,6 @@ struct CESIUMGLTF_API ImageCesium final { * * The cost of any renderer resources (e.g., GPU textures) created for * this image. */ - int64_t lastKnownSizeInBytes = -1; + int64_t sizeBytes = -1; }; } // namespace CesiumGltf diff --git a/CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp b/CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp index cdcb8ec1c..083cd7344 100644 --- a/CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp +++ b/CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp @@ -91,7 +91,7 @@ RasterOverlayTileProvider::getTile( void RasterOverlayTileProvider::removeTile(RasterOverlayTile* pTile) noexcept { assert(pTile->getReferenceCount() == 0); - this->_tileDataBytes -= pTile->getImage().lastKnownSizeInBytes; + this->_tileDataBytes -= pTile->getImage().sizeBytes; } CesiumAsync::Future @@ -349,12 +349,11 @@ CesiumAsync::Future RasterOverlayTileProvider::doLoad( // size now. We'll add this number to our total memory usage now, // and remove it when the tile is later unloaded, and we must use // the same size in each case. - if (imageCesium.lastKnownSizeInBytes < 0) { - imageCesium.lastKnownSizeInBytes = - int64_t(imageCesium.pixelData.size()); + if (imageCesium.sizeBytes < 0) { + imageCesium.sizeBytes = int64_t(imageCesium.pixelData.size()); } - thiz->_tileDataBytes += imageCesium.lastKnownSizeInBytes; + thiz->_tileDataBytes += imageCesium.sizeBytes; thiz->finalizeTileLoad(isThrottledLoad);