remove USE_ROSEN_DRAWING in preview

Signed-off-by: hwx1119949 <huyisuo@huawei.com>
This commit is contained in:
hwx1119949 2024-09-19 11:39:42 +08:00
parent 8577cd345a
commit c828b0c63e
4 changed files with 0 additions and 34 deletions

View File

@ -13,7 +13,6 @@
* limitations under the License.
*/
#include "core/components_ng/pattern/text/span/mutable_span_string.h"
#include "core/text/html_utils.h"

View File

@ -15,52 +15,34 @@
#include "drawing_color_filter_preview.h"
#ifdef USE_ROSEN_DRAWING
#include "base/utils/utils.h"
#include "color_filter_napi/js_color_filter.h"
#endif
namespace OHOS::Ace {
RefPtr<DrawingColorFilter> DrawingColorFilter::CreateDrawingColorFilter(void* sptrAddr)
{
#ifndef USE_ROSEN_DRAWING
return nullptr;
#else
CHECK_NULL_RETURN(sptrAddr, nullptr);
auto* jsColorFilter = reinterpret_cast<OHOS::Rosen::Drawing::JsColorFilter*>(sptrAddr);
return AceType::MakeRefPtr<DrawingColorFilterPreview>(jsColorFilter->GetColorFilter());
#endif
}
RefPtr<DrawingColorFilter> DrawingColorFilter::CreateDrawingColorFilter(const std::vector<float>& matrix)
{
#ifndef USE_ROSEN_DRAWING
return nullptr;
#else
OHOS::Rosen::Drawing::ColorMatrix colorMatrix;
colorMatrix.SetArray(matrix.data());
return AceType::MakeRefPtr<DrawingColorFilterPreview>(
Rosen::Drawing::ColorFilter::CreateMatrixColorFilter(colorMatrix));
#endif
}
RefPtr<DrawingColorFilter> DrawingColorFilter::CreateDrawingColorFilterFromNative(void* sptrAddr)
{
#ifndef USE_ROSEN_DRAWING
return nullptr;
#else
CHECK_NULL_RETURN(sptrAddr, nullptr);
auto* colorFilter = reinterpret_cast<std::shared_ptr<OHOS::Rosen::Drawing::ColorFilter>*>(sptrAddr);
return AceType::MakeRefPtr<DrawingColorFilterPreview>(*colorFilter);
#endif
}
void* DrawingColorFilterPreview::GetDrawingColorFilterSptrAddr()
{
#ifndef USE_ROSEN_DRAWING
return nullptr;
#else
return static_cast<void*>(&colorFilter_);
#endif
}
} // namespace OHOS::Ace

View File

@ -16,10 +16,7 @@
#ifndef FOUNDATION_ACE_ADAPTER_OHOS_OSAL_DRAWING_COLOR_FILTER_PREVIEW_H
#define FOUNDATION_ACE_ADAPTER_OHOS_OSAL_DRAWING_COLOR_FILTER_PREVIEW_H
#ifdef USE_ROSEN_DRAWING
#include "effect/color_filter.h"
#endif
#include "base/image/drawing_color_filter.h"
namespace OHOS::Ace {

View File

@ -24,32 +24,20 @@
namespace OHOS::Ace {
RefPtr<DrawingLattice> DrawingLattice::CreateDrawingLattice(void* sptrAddr)
{
#ifndef USE_ROSEN_DRAWING
return nullptr;
#else
CHECK_NULL_RETURN(sptrAddr, nullptr);
auto* jsLattice = reinterpret_cast<OHOS::Rosen::Drawing::JsLattice*>(sptrAddr);
return AceType::MakeRefPtr<DrawingLatticePreview>(jsLattice->GetLattice());
#endif
}
RefPtr<DrawingLattice> DrawingLattice::CreateDrawingLatticeFromNative(void* sptrAddr)
{
#ifndef USE_ROSEN_DRAWING
return nullptr;
#else
CHECK_NULL_RETURN(sptrAddr, nullptr);
auto* lattice = reinterpret_cast<std::shared_ptr<OHOS::Rosen::Drawing::Lattice>*>(sptrAddr);
return AceType::MakeRefPtr<DrawingLatticePreview>(*lattice);
#endif
}
void* DrawingLatticePreview::GetDrawingLatticeSptrAddr()
{
#ifndef USE_ROSEN_DRAWING
return nullptr;
#else
return static_cast<void*>(&lattice_);
#endif
}
} // namespace OHOS::Ace