diff --git a/frameworks/innerkitsimpl/codec/src/image_source.cpp b/frameworks/innerkitsimpl/codec/src/image_source.cpp index a11c955618e31523ad8a46671f03521e79455f49..d3b3265ef65b6138030ab0066f08f0689905168b 100644 --- a/frameworks/innerkitsimpl/codec/src/image_source.cpp +++ b/frameworks/innerkitsimpl/codec/src/image_source.cpp @@ -1239,7 +1239,6 @@ unique_ptr ImageSource::CreatePixelMapByInfos(ImagePlugin::PlImageInfo return nullptr; } pixelMap->SetEditable(saveEditable); - pixelMap->UpdatePixelsAlphaType(); // add graphic colorspace object to pixelMap. SetPixelMapColorSpace(context, pixelMap, mainDecoder_); return pixelMap; diff --git a/frameworks/innerkitsimpl/common/src/pixel_map.cpp b/frameworks/innerkitsimpl/common/src/pixel_map.cpp index e8654abd575687ae29ee3a46b32a61fca42e51e0..4b278b056bc0b810bd9bff6ec35ee788dd380b37 100644 --- a/frameworks/innerkitsimpl/common/src/pixel_map.cpp +++ b/frameworks/innerkitsimpl/common/src/pixel_map.cpp @@ -15,10 +15,6 @@ #include "pixel_map.h" -#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) -#include -#endif - #ifdef EXT_PIXEL #include "pixel_yuv_ext.h" #endif @@ -435,120 +431,6 @@ static int AllocPixelMapMemory(std::unique_ptr &dstMemory, int32_t &d return IMAGE_RESULT_SUCCESS; } -static constexpr uint16_t HEIGHT_MIN = 198; -static constexpr uint16_t HEIGHT_MAX = 760; -static constexpr uint16_t WIDTH_MIN = 345; -static constexpr uint16_t WIDTH_MAX = 960; -#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) -static constexpr uint16_t OPAQUE_LABEL = 255; -static constexpr uint16_t TEST_STEP = 4; -static constexpr uint16_t NEON_TEST_STEP = 512; -void PixelMap::UpdatePixelsAlphaType() -{ - if (!ImageSystemProperties::IsSupportOpaqueOpt()) { - return; - } -#ifdef EXT_PIXEL - const uint8_t *dstPixels = GetPixels(); - if (dstPixels == nullptr) { - IMAGE_LOGD("[PixelMap]UpdatePixelsAlphaType invalid input parameter: dstPixels is Null"); - return; - } - - int32_t height = GetHeight(); - int32_t width = GetWidth(); - if (height < HEIGHT_MIN || width < WIDTH_MIN || height > HEIGHT_MAX || width > WIDTH_MAX) { - return; - } - - ImageInfo imageInfo; - GetImageInfo(imageInfo); - - int8_t alphaIndex = -1; - if (imageInfo.pixelFormat == PixelFormat::RGBA_8888 || - imageInfo.pixelFormat == PixelFormat::BGRA_8888) { - alphaIndex = BGRA_ALPHA_INDEX; - } else if (imageInfo.pixelFormat == PixelFormat::ARGB_8888) { - alphaIndex = 0; - } else { - IMAGE_LOGD("[PixelMap]Pixel format is not supported"); - return; - } - - int32_t stride = GetRowStride(); - int32_t rowBytes = GetRowBytes(); - - for (int32_t i = 0; i < height; ++i) { - for (int32_t j = 0; j < rowBytes - (rowBytes % NEON_TEST_STEP); j += NEON_TEST_STEP) { - int32_t index = i * stride + j; - uint8x16x4_t rgba = vld4q_u8(dstPixels + index); - uint8x16_t alpha = rgba.val[alphaIndex]; - if (vminvq_u8(alpha) != OPAQUE_LABEL) { - return; - } - } - for (int j = rowBytes - (rowBytes % NEON_TEST_STEP); j < rowBytes; j += TEST_STEP) { - int index = i * stride + j; - unsigned char alpha = dstPixels[index + 3]; - if (alpha != OPAQUE_LABEL) { - return; - } - } - } - SetSupportOpaqueOpt(true); -#endif -} -#else -void PixelMap::UpdatePixelsAlphaType() -{ - if (!ImageSystemProperties::IsSupportOpaqueOpt()) { - return; - } - const uint8_t *dstPixels = GetPixels(); - if (dstPixels == nullptr) { - IMAGE_LOGD("[PixelMap]UpdatePixelsAlphaType invalid input parameter: dstPixels is Null"); - return; - } - - int32_t height = GetHeight(); - int32_t width = GetWidth(); - if (height < HEIGHT_MIN || width < WIDTH_MIN || height > HEIGHT_MAX || width > WIDTH_MAX) { - return; - } - - ImageInfo imageInfo; - GetImageInfo(imageInfo); - - int8_t alphaIndex = -1; - if (imageInfo.pixelFormat == PixelFormat::RGBA_8888 || - imageInfo.pixelFormat == PixelFormat::BGRA_8888) { - alphaIndex = BGRA_ALPHA_INDEX; - } else if (imageInfo.pixelFormat == PixelFormat::ARGB_8888) { - alphaIndex = 0; - } - if (alphaIndex == -1) { - IMAGE_LOGE("[PixelMap]Pixel format is not supported"); - return; - } - - uint8_t pixelBytes = GetPixelBytes(); - int32_t stride = GetRowStride(); - int32_t rowBytes = GetRowBytes(); - - for (int32_t i = 0; i < height; ++i) { - for (int32_t j = 0; j < rowBytes; j += pixelBytes) { - int32_t index = i * stride + j; - const uint8_t *rpixel = dstPixels + index; - if (rpixel[alphaIndex] != ALPHA_OPAQUE) { - return; - } - } - } - - SetSupportOpaqueOpt(true); -} -#endif - unique_ptr PixelMap::Create(const uint32_t *colors, uint32_t colorLength, BUILD_PARAM &info, const InitializationOptions &opts, int &errorCode) { @@ -602,7 +484,6 @@ unique_ptr PixelMap::Create(const uint32_t *colors, uint32_t colorLeng ImageUtils::DumpPixelMapIfDumpEnabled(dstPixelMap); SetYUVDataInfoToPixelMap(dstPixelMap); ImageUtils::FlushSurfaceBuffer(const_cast(dstPixelMap.get())); - dstPixelMap->UpdatePixelsAlphaType(); return dstPixelMap; } @@ -1211,7 +1092,6 @@ unique_ptr PixelMap::Clone(int32_t &errorCode) return nullptr; } pixelMap->SetTransformered(isTransformered_); - pixelMap->SetSupportOpaqueOpt(supportOpaqueOpt_); TransformData transformData; GetTransformData(transformData); pixelMap->SetTransformData(transformData); @@ -2073,16 +1953,6 @@ bool PixelMap::SetAlphaType(const AlphaType &alphaType) return true; } -void PixelMap::SetSupportOpaqueOpt(bool supportOpaqueOpt) -{ - supportOpaqueOpt_ = supportOpaqueOpt; -} - -bool PixelMap::GetSupportOpaqueOpt() -{ - return supportOpaqueOpt_; -} - uint32_t PixelMap::WritePixel(const Position &pos, const uint32_t &color) { if (pos.x < 0 || pos.y < 0 || pos.x >= GetWidth() || pos.y >= GetHeight()) { @@ -2562,11 +2432,6 @@ bool PixelMap::WritePropertiesToParcel(Parcel &parcel) const return false; } - if (!parcel.WriteBool(supportOpaqueOpt_)) { - IMAGE_LOGE("write pixel map supportOpaqueOpt to parcel failed."); - return false; - } - if (!parcel.WriteBool(isAstc_)) { IMAGE_LOGE("write pixel map isAstc_ to parcel failed."); return false; @@ -2976,7 +2841,6 @@ bool PixelMap::ReadPropertiesFromParcel(Parcel& parcel, PixelMap*& pixelMap, Ima pixelMap->SetReadVersion(readVersion); pixelMap->SetEditable(parcel.ReadBool()); - pixelMap->SetSupportOpaqueOpt(parcel.ReadBool()); memInfo.isAstc = parcel.ReadBool(); pixelMap->SetAstc(memInfo.isAstc); if (pixelMap->GetReadVersion() >= PIXELMAP_VERSION_DISPLAY_ONLY) { diff --git a/frameworks/innerkitsimpl/test/BUILD.gn b/frameworks/innerkitsimpl/test/BUILD.gn index 8147996305ef4290ef81f7ed0bf51f9f3a34af18..2d0e412491e9622452c11935e4cd39518512ab23 100644 --- a/frameworks/innerkitsimpl/test/BUILD.gn +++ b/frameworks/innerkitsimpl/test/BUILD.gn @@ -226,7 +226,6 @@ ohos_unittest("imagepixelmaptest") { "//foundation/multimedia/image_framework/adapter/frameworks/bitmapconverter/native/include", "//foundation/multimedia/image_framework/frameworks/innerkitsimpl/common/include", "//foundation/multimedia/image_framework/frameworks/innerkitsimpl/stream/include", - "//foundation/multimedia/image_framework/frameworks/innerkitsimpl/utils/include", ] cflags = [ "-DIMAGE_COLORSPACE_FLAG" ] sources = [ @@ -238,7 +237,6 @@ ohos_unittest("imagepixelmaptest") { deps = [ # "//foundation/multimedia/image_framework/adapter/frameworks/bitmapconverter/native:bitmapconverter", "//foundation/multimedia/image_framework/interfaces/innerkits:image_native", - "//foundation/multimedia/image_framework/frameworks/innerkitsimpl/utils:image_utils", ] external_deps = [ diff --git a/frameworks/innerkitsimpl/test/unittest/pixel_map_test/image_pixel_map_test.cpp b/frameworks/innerkitsimpl/test/unittest/pixel_map_test/image_pixel_map_test.cpp index d4a24921544998eaa25ef11fe419f91ce3d1e074..577aeb23da0a63d2ebda303a2912710c3d5c2e41 100644 --- a/frameworks/innerkitsimpl/test/unittest/pixel_map_test/image_pixel_map_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/pixel_map_test/image_pixel_map_test.cpp @@ -19,7 +19,6 @@ #include "pixel_map.h" #include "color_space.h" #include "post_proc.h" -#include "image_system_properties.h" using namespace testing::ext; using namespace OHOS::Media; @@ -1500,357 +1499,6 @@ HWTEST_F(ImagePixelMapTest, ImagePixelMap046, TestSize.Level3) GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap046 Create end"; } -/** -* @tc.name: ImagePixelMap047 -* @tc.desc: HEIGHT_MIN test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap047, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap047 rotate start"; - constexpr uint32_t ARGB8888_BYTES = 4; - - InitializationOptions opts; - opts.pixelFormat = OHOS::Media::PixelFormat::ARGB_8888; - opts.alphaType = AlphaType::IMAGE_ALPHA_TYPE_OPAQUE; - opts.size.width = 3; - opts.size.height = 3; - uint32_t dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - uint32_t* data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF0000; - } - std::unique_ptr pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - if (data != nullptr) { - delete[] data; - } - - opts.size.width = 400; - opts.size.height = 3; - dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF0000; - } - pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - if (data != nullptr) { - delete[] data; - } - - opts.size.width = 3; - opts.size.height = 200; - dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF0000; - } - pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - if (data != nullptr) { - delete[] data; - } - - opts.size.width = 400; - opts.size.height = 800; - dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF0000; - } - pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - if (data != nullptr) { - delete[] data; - } - - opts.size.width = 1000; - opts.size.height = 200; - dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF0000; - } - pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - if (data != nullptr) { - delete[] data; - } - - opts.size.width = 1000; - opts.size.height = 800; - dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF0000; - } - pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - - if (data != nullptr) { - delete[] data; - } - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap047 rotate end"; -} - -/** -* @tc.name: ImagePixelMap048 -* @tc.desc: GetSupportOpaqueOpt test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap048, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap048 rotate start"; - uint32_t* data = nullptr; - std::unique_ptr pixelMap = ConstructPixelMap(&data); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - - pixelMap->SetSupportOpaqueOpt(true); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_NE(alphaType, false); - - if (data != nullptr) { - delete[] data; - } - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap048 rotate end"; -} - -/** -* @tc.name: ImagePixelMap049 -* @tc.desc: format test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap049, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap049 rotate start"; - bool isSupportOpt = OHOS::Media::ImageSystemProperties::IsSupportOpaqueOpt(); - if (!isSupportOpt) { - EXPECT_EQ(isSupportOpt, false); - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap049 rotate end"; - return; - } - constexpr uint32_t ARGB8888_BYTES = 4; - - InitializationOptions opts; - opts.pixelFormat = OHOS::Media::PixelFormat::ARGB_8888; - opts.alphaType = AlphaType::IMAGE_ALPHA_TYPE_OPAQUE; - opts.size.width = 600; - opts.size.height = 600; - const uint32_t dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - uint32_t* data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF00FF; - } - std::unique_ptr pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, true); - - opts.pixelFormat = OHOS::Media::PixelFormat::RGBA_8888; - pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, true); - - opts.pixelFormat = OHOS::Media::PixelFormat::BGRA_8888; - pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, true); - - if (data != nullptr) { - delete[] data; - } - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap049 rotate end"; -} - -/** -* @tc.name: ImagePixelMap050 -* @tc.desc: GetPixels test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap050, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap050 rotate start"; - bool isSupportOpt = OHOS::Media::ImageSystemProperties::IsSupportOpaqueOpt(); - if (!isSupportOpt) { - EXPECT_EQ(isSupportOpt, false); - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap050 rotate end"; - return; - } - constexpr uint32_t ARGB8888_BYTES = 4; - - InitializationOptions opts; - opts.pixelFormat = OHOS::Media::PixelFormat::ARGB_8888; - opts.alphaType = AlphaType::IMAGE_ALPHA_TYPE_OPAQUE; - opts.size.width = 600; - opts.size.height = 600; - const uint32_t dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - uint32_t* data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0xFFFF00FF; - } - std::unique_ptr pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - const uint8_t *dstPixels = pixelMap->GetPixels(); - EXPECT_NE(dstPixels, nullptr); - pixelMap->UpdatePixelsAlphaType(); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, true); - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap050 rotate end"; -} - -/** -* @tc.name: ImagePixelMap051 -* @tc.desc: GetPixels test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap051, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap051 rotate start"; - InitializationOptions opts; - opts.pixelFormat = OHOS::Media::PixelFormat::ARGB_8888; - opts.alphaType = AlphaType::IMAGE_ALPHA_TYPE_OPAQUE; - opts.size.width = PIXEL_MAP_TEST_WIDTH; - opts.size.height = PIXEL_MAP_TEST_HEIGHT; - std::unique_ptr pixelMap = std::make_unique(); - EXPECT_NE(pixelMap, nullptr); - const uint8_t *dstPixels = pixelMap->GetPixels(); - EXPECT_EQ(dstPixels, nullptr); - pixelMap->UpdatePixelsAlphaType(); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap051 rotate end"; -} - -/** -* @tc.name: ImagePixelMap052 -* @tc.desc: alpha return test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap052, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap052 rotate start"; - constexpr uint32_t ARGB8888_BYTES = 4; - const uint32_t dataLength = PIXEL_MAP_TEST_WIDTH * PIXEL_MAP_TEST_HEIGHT * ARGB8888_BYTES; - uint32_t* data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0x00FF0000; - } - InitializationOptions opts; - opts.pixelFormat = OHOS::Media::PixelFormat::ARGB_8888; - opts.alphaType = AlphaType::IMAGE_ALPHA_TYPE_OPAQUE; - opts.size.width = PIXEL_MAP_TEST_WIDTH; - opts.size.height = PIXEL_MAP_TEST_HEIGHT; - std::unique_ptr pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - - if (data != nullptr) { - delete[] data; - } - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap052 rotate end"; -} - -/** -* @tc.name: ImagePixelMap053 -* @tc.desc: alpha return test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap053, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap053 rotate start"; - constexpr uint32_t ARGB8888_BYTES = 4; - - InitializationOptions opts; - opts.pixelFormat = OHOS::Media::PixelFormat::ARGB_8888; - opts.alphaType = AlphaType::IMAGE_ALPHA_TYPE_OPAQUE; - opts.size.width = 519; - opts.size.height = 1; - const uint32_t dataLength = opts.size.width * opts.size.height * ARGB8888_BYTES; - uint32_t* data = new uint32_t[dataLength]; - for (uint32_t i = 0; i < dataLength; i++) { - data[i] = 0x00FF0000; - } - std::unique_ptr pixelMap = PixelMap::Create(data, dataLength, opts); - EXPECT_NE(pixelMap, nullptr); - pixelMap->UpdatePixelsAlphaType(); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - - if (data != nullptr) { - delete[] data; - } - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap053 rotate end"; -} - -/** -* @tc.name: ImagePixelMap054 -* @tc.desc: GetSupportOpaqueOpt test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap054, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap054 rotate start"; - std::unique_ptr pixelMap = ConstructBigPixmap(); - EXPECT_NE(pixelMap, nullptr); - bool alphaType = pixelMap->GetSupportOpaqueOpt(); - EXPECT_EQ(alphaType, false); - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap054 rotate end"; -} - -/** -* @tc.name: ImagePixelMap055 -* @tc.desc: GetSupportOpaqueOpt test -* @tc.type: FUNC -* @tc.require: AR000FTAMO -*/ -HWTEST_F(ImagePixelMapTest, ImagePixelMap055, TestSize.Level3) -{ - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap055 rotate start"; - std::unique_ptr pixelMap = ConstructBigPixmap(); - EXPECT_NE(pixelMap, nullptr); - int32_t errorCode = 0; - std::unique_ptr pixelMap1 = pixelMap->Clone(errorCode); - EXPECT_NE(pixelMap1, nullptr); - GTEST_LOG_(INFO) << "ImagePixelMapTest: ImagePixelMap055 rotate end"; -} - std::unique_ptr CreatePixelMapCommon(int32_t width, int32_t height) { const uint32_t dataLength = width * height; diff --git a/frameworks/innerkitsimpl/utils/include/image_system_properties.h b/frameworks/innerkitsimpl/utils/include/image_system_properties.h index 2a39390c098be9830ecdc28c214cd5b9575db785..de78d6c41f12ec44af034ba2fe0228218352cb1b 100644 --- a/frameworks/innerkitsimpl/utils/include/image_system_properties.h +++ b/frameworks/innerkitsimpl/utils/include/image_system_properties.h @@ -39,7 +39,6 @@ public: static bool GetNoPaddingEnabled(); static bool GetPngSampleDecodeEnabled(); static bool UseGPUScalingCapabilities(); - static bool IsSupportOpaqueOpt(); private: ImageSystemProperties() = default; }; diff --git a/frameworks/innerkitsimpl/utils/src/image_system_properties.cpp b/frameworks/innerkitsimpl/utils/src/image_system_properties.cpp index eb890dfc5bc1bb967ccdb3b9646789e01d579d43..bd03300a9a71f185c5e3bf5c6ab4fb1057b3fd10 100644 --- a/frameworks/innerkitsimpl/utils/src/image_system_properties.cpp +++ b/frameworks/innerkitsimpl/utils/src/image_system_properties.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -238,9 +237,5 @@ bool ImageSystemProperties::GetPngSampleDecodeEnabled() #endif } -bool ImageSystemProperties::IsSupportOpaqueOpt() -{ - return false; -} } // namespace Media } // namespace OHOS diff --git a/interfaces/innerkits/include/pixel_map.h b/interfaces/innerkits/include/pixel_map.h index 353bdf30cec5535855434b6a05e32c864bd6f3ea..42e5a3b11645088bf6d490e2156af0f304c8d257 100644 --- a/interfaces/innerkits/include/pixel_map.h +++ b/interfaces/innerkits/include/pixel_map.h @@ -566,20 +566,6 @@ public: */ NATIVEEXPORT virtual bool SetAlphaType(const AlphaType &alphaType); - /** - * Set whether to support opaque optimization. - * - * @param supportOpaqueOpt whether to support opaque optimization. - */ - NATIVEEXPORT virtual void SetSupportOpaqueOpt(bool supportOpaqueOpt); - - /** - * Get whether to support opaque optimization. - * - * @return Return true if support opaque optimization, otherwise return false. - */ - NATIVEEXPORT virtual bool GetSupportOpaqueOpt(); - /** * Write pixel points at the target position. * @@ -870,7 +856,6 @@ public: NATIVEEXPORT uint32_t GetVersionId(); NATIVEEXPORT void AddVersionId(); - void UpdatePixelsAlphaType(); uint64_t GetNoPaddingUsage(); protected: @@ -1070,7 +1055,6 @@ private: bool astcHdr_ = false; friend class OHOS::Rosen::RSModifiersDraw; - bool supportOpaqueOpt_ = false; }; } // namespace Media } // namespace OHOS