Fix iOS build break.
This commit is contained in:
@@ -307,8 +307,6 @@ if (APPLE)
|
||||
filabridge
|
||||
getopt
|
||||
gtest
|
||||
image
|
||||
imageio
|
||||
SPIRV
|
||||
spirv-cross-glsl)
|
||||
|
||||
@@ -323,13 +321,16 @@ if (APPLE)
|
||||
getopt
|
||||
gtest
|
||||
glslang
|
||||
image
|
||||
imageio
|
||||
spirv-cross-core
|
||||
spirv-cross-glsl
|
||||
spirv-cross-msl
|
||||
)
|
||||
|
||||
if (NOT IOS)
|
||||
target_link_libraries(backend_test PRIVATE image imageio)
|
||||
list(APPEND BACKEND_TEST_DEPS image imageio)
|
||||
endif()
|
||||
|
||||
set(BACKEND_TEST_COMBINED_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libbackendtest_combined.a")
|
||||
combine_static_libs(backend_test "${BACKEND_TEST_COMBINED_OUTPUT}" "${BACKEND_TEST_DEPS}")
|
||||
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
|
||||
#include "BackendTest.h"
|
||||
|
||||
#include <imageio/ImageEncoder.h>
|
||||
|
||||
#include <image/ColorTransform.h>
|
||||
|
||||
#include "ShaderGenerator.h"
|
||||
#include "TrianglePrimitive.h"
|
||||
|
||||
@@ -29,7 +25,13 @@
|
||||
|
||||
using namespace filament;
|
||||
using namespace filament::backend;
|
||||
|
||||
#ifndef IOS
|
||||
#include <imageio/ImageEncoder.h>
|
||||
#include <image/ColorTransform.h>
|
||||
|
||||
using namespace image;
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -123,6 +125,7 @@ TEST_F(BackendTest, ReadPixels) {
|
||||
}
|
||||
|
||||
void exportScreenshot(void* pixelData) const {
|
||||
#ifndef IOS
|
||||
const size_t width = readRect.width, height = readRect.height;
|
||||
LinearImage image(width, height, 4);
|
||||
if (format == PixelDataFormat::RGBA && type == PixelDataType::UBYTE) {
|
||||
@@ -135,6 +138,7 @@ TEST_F(BackendTest, ReadPixels) {
|
||||
std::ofstream outputStream(png.c_str(), std::ios::binary | std::ios::trunc);
|
||||
ImageEncoder::encode(outputStream, ImageEncoder::Format::PNG, image, "",
|
||||
png.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
PixelDataFormat format = PixelDataFormat::RGBA;
|
||||
|
||||
Reference in New Issue
Block a user