Skip to content

Commit

Permalink
Revert "Rename member name for clarity"
Browse files Browse the repository at this point in the history
This reverts commit e16a3e1.
  • Loading branch information
j9liu committed Feb 26, 2024
1 parent 6c48779 commit 5f5f726
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
7 changes: 3 additions & 4 deletions Cesium3DTilesSelection/src/Tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
5 changes: 2 additions & 3 deletions Cesium3DTilesSelection/src/TilesetContentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
2 changes: 1 addition & 1 deletion CesiumGltf/include/CesiumGltf/ImageCesium.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TileProviderAndTile>
Expand Down Expand Up @@ -349,12 +349,11 @@ CesiumAsync::Future<TileProviderAndTile> 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);

Expand Down

0 comments on commit 5f5f726

Please sign in to comment.