mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 01:00:50 +00:00
!13158 arkui-x update master OH to weekly_20240722 and OH fix build bug
Merge pull request !13158 from mufeng521/mufeng_master_oh_weekly_20240722
This commit is contained in:
commit
f9b81fb655
@ -57,71 +57,114 @@ ohos_shared_library("drawing_napi") {
|
||||
subsystem_name = "graphic"
|
||||
}
|
||||
|
||||
ohos_shared_library("drawing_napi_impl") {
|
||||
sources = [
|
||||
"brush_napi/js_brush.cpp",
|
||||
"canvas_napi/js_canvas.cpp",
|
||||
"color_filter_napi/js_color_filter.cpp",
|
||||
"enum_napi/js_enum.cpp",
|
||||
"font_napi/js_font.cpp",
|
||||
"font_napi/js_typeface.cpp",
|
||||
"image_filter_napi/js_image_filter.cpp",
|
||||
"js_common.cpp",
|
||||
"js_drawing_init.cpp",
|
||||
"js_drawing_utils.cpp",
|
||||
"lattice_napi/js_lattice.cpp",
|
||||
"mask_filter_napi/js_mask_filter.cpp",
|
||||
"matrix_napi/js_matrix.cpp",
|
||||
"path_effect_napi/js_path_effect.cpp",
|
||||
"path_napi/js_path.cpp",
|
||||
"pen_napi/js_pen.cpp",
|
||||
"region_napi/js_region.cpp",
|
||||
"roundRect_napi/js_roundrect.cpp",
|
||||
"sampling_options_napi/js_sampling_options.cpp",
|
||||
"shader_effect_napi/js_shader_effect.cpp",
|
||||
"shadow_layer_napi/js_shadow_layer.cpp",
|
||||
"text_blob_napi/js_text_blob.cpp",
|
||||
]
|
||||
|
||||
defines = []
|
||||
configs = [ ":local_drawing_config" ]
|
||||
public_configs = [ ":drawing_config" ]
|
||||
|
||||
deps = [
|
||||
"../../../../../rosen/modules/2d_graphics:2d_graphics",
|
||||
"../../../../../rosen/modules/render_service_base:librender_service_base",
|
||||
]
|
||||
|
||||
external_deps = [ "napi:ace_napi" ]
|
||||
|
||||
if (current_os == "ohos" || current_os == "ohos_ng") {
|
||||
sanitize = {
|
||||
boundary_sanitize = true
|
||||
integer_overflow = true
|
||||
ubsan = true
|
||||
}
|
||||
external_deps += [
|
||||
"hilog:libhilog",
|
||||
"image_framework:image_native",
|
||||
"init:libbegetutil",
|
||||
if (is_arkui_x) {
|
||||
ohos_source_set("drawing_napi_impl") {
|
||||
sources = [
|
||||
"brush_napi/js_brush.cpp",
|
||||
"canvas_napi/js_canvas.cpp",
|
||||
"color_filter_napi/js_color_filter.cpp",
|
||||
"enum_napi/js_enum.cpp",
|
||||
"font_napi/js_font.cpp",
|
||||
"font_napi/js_typeface.cpp",
|
||||
"image_filter_napi/js_image_filter.cpp",
|
||||
"js_common.cpp",
|
||||
"js_drawing_init.cpp",
|
||||
"js_drawing_utils.cpp",
|
||||
"lattice_napi/js_lattice.cpp",
|
||||
"mask_filter_napi/js_mask_filter.cpp",
|
||||
"matrix_napi/js_matrix.cpp",
|
||||
"path_effect_napi/js_path_effect.cpp",
|
||||
"path_napi/js_path.cpp",
|
||||
"pen_napi/js_pen.cpp",
|
||||
"region_napi/js_region.cpp",
|
||||
"roundRect_napi/js_roundrect.cpp",
|
||||
"sampling_options_napi/js_sampling_options.cpp",
|
||||
"shader_effect_napi/js_shader_effect.cpp",
|
||||
"shadow_layer_napi/js_shadow_layer.cpp",
|
||||
"text_blob_napi/js_text_blob.cpp",
|
||||
]
|
||||
deps += [ "../../../../../utils:libgraphic_utils" ]
|
||||
defines += [ "ROSEN_OHOS" ]
|
||||
cflags = [ "-fstack-protector-strong" ]
|
||||
cflags_cc = [
|
||||
"-fstack-protector-strong",
|
||||
"-std=c++17",
|
||||
|
||||
defines = []
|
||||
configs = [ ":local_drawing_config" ]
|
||||
public_configs = [ ":drawing_config" ]
|
||||
|
||||
deps = [
|
||||
"../../../../../rosen/modules/2d_graphics:2d_graphics",
|
||||
"../../../../../rosen/modules/render_service_base:librender_service_base_static",
|
||||
"//foundation/arkui/napi:ace_napi",
|
||||
]
|
||||
} else {
|
||||
defines += [ "MODULE_DRAWING" ]
|
||||
cflags_cc = [ "-std=c++17" ]
|
||||
}
|
||||
|
||||
if (current_os == "mingw") {
|
||||
defines += [ "WINDOWS_PLATFORM" ]
|
||||
part_name = "graphic_2d"
|
||||
subsystem_name = "graphic"
|
||||
}
|
||||
} else {
|
||||
ohos_shared_library("drawing_napi_impl") {
|
||||
sources = [
|
||||
"brush_napi/js_brush.cpp",
|
||||
"canvas_napi/js_canvas.cpp",
|
||||
"color_filter_napi/js_color_filter.cpp",
|
||||
"enum_napi/js_enum.cpp",
|
||||
"font_napi/js_font.cpp",
|
||||
"font_napi/js_typeface.cpp",
|
||||
"image_filter_napi/js_image_filter.cpp",
|
||||
"js_common.cpp",
|
||||
"js_drawing_init.cpp",
|
||||
"js_drawing_utils.cpp",
|
||||
"lattice_napi/js_lattice.cpp",
|
||||
"mask_filter_napi/js_mask_filter.cpp",
|
||||
"matrix_napi/js_matrix.cpp",
|
||||
"path_effect_napi/js_path_effect.cpp",
|
||||
"path_napi/js_path.cpp",
|
||||
"pen_napi/js_pen.cpp",
|
||||
"region_napi/js_region.cpp",
|
||||
"roundRect_napi/js_roundrect.cpp",
|
||||
"sampling_options_napi/js_sampling_options.cpp",
|
||||
"shader_effect_napi/js_shader_effect.cpp",
|
||||
"shadow_layer_napi/js_shadow_layer.cpp",
|
||||
"text_blob_napi/js_text_blob.cpp",
|
||||
]
|
||||
defines = []
|
||||
configs = [ ":local_drawing_config" ]
|
||||
public_configs = [ ":drawing_config" ]
|
||||
|
||||
innerapi_tags = [ "platformsdk" ]
|
||||
part_name = "graphic_2d"
|
||||
subsystem_name = "graphic"
|
||||
deps = [
|
||||
"../../../../../rosen/modules/2d_graphics:2d_graphics",
|
||||
"../../../../../rosen/modules/render_service_base:librender_service_base",
|
||||
]
|
||||
|
||||
external_deps = [ "napi:ace_napi" ]
|
||||
|
||||
if (current_os == "ohos" || current_os == "ohos_ng") {
|
||||
sanitize = {
|
||||
boundary_sanitize = true
|
||||
integer_overflow = true
|
||||
ubsan = true
|
||||
}
|
||||
external_deps += [
|
||||
"hilog:libhilog",
|
||||
"image_framework:image_native",
|
||||
"init:libbegetutil",
|
||||
]
|
||||
deps += [ "../../../../../utils:libgraphic_utils" ]
|
||||
defines += [ "ROSEN_OHOS" ]
|
||||
cflags = [ "-fstack-protector-strong" ]
|
||||
cflags_cc = [
|
||||
"-fstack-protector-strong",
|
||||
"-std=c++17",
|
||||
]
|
||||
} else {
|
||||
defines += [ "MODULE_DRAWING" ]
|
||||
cflags_cc = [ "-std=c++17" ]
|
||||
}
|
||||
|
||||
if (current_os == "mingw") {
|
||||
defines += [ "WINDOWS_PLATFORM" ]
|
||||
}
|
||||
|
||||
innerapi_tags = [ "platformsdk" ]
|
||||
part_name = "graphic_2d"
|
||||
subsystem_name = "graphic"
|
||||
}
|
||||
}
|
||||
|
@ -159,6 +159,10 @@ if (enable_text_gine) {
|
||||
"$rosen_root/modules/2d_engine/rosen_text/skia_txt/txt/src",
|
||||
]
|
||||
|
||||
if (is_arkui_x) {
|
||||
include_dirs += [ "//third_party/bounds_checking_function/include" ]
|
||||
}
|
||||
|
||||
defines += [
|
||||
"USE_GRAPHIC_TEXT_GINE",
|
||||
"WINDOWS_PLATFORM",
|
||||
|
@ -17,6 +17,7 @@
|
||||
#define IMAGE_H
|
||||
|
||||
#include "drawing/engine_adapter/impl_interface/image_impl.h"
|
||||
#include "image/gpu_context.h"
|
||||
#include "include/core/SkImage.h"
|
||||
#include "utils/drawing_macros.h"
|
||||
#ifdef RS_ENABLE_VK
|
||||
|
@ -92,7 +92,11 @@ public:
|
||||
|
||||
uint32_t offset = opAllocator_.AddrToOffset(op);
|
||||
if (lastOpItemOffset_.has_value()) {
|
||||
#ifdef CROSS_PLATFORM
|
||||
auto* lastOpItem = static_cast<OpItem*>(opAllocator_.OffsetToAddr(lastOpItemOffset_.__get()));
|
||||
#else
|
||||
auto* lastOpItem = static_cast<OpItem*>(opAllocator_.OffsetToAddr(lastOpItemOffset_.value()));
|
||||
#endif
|
||||
if (lastOpItem != nullptr) {
|
||||
lastOpItem->SetNextOpItemOffset(offset);
|
||||
}
|
||||
|
@ -84,7 +84,11 @@ public:
|
||||
|
||||
uint32_t offset = opAllocator_.AddrToOffset(op);
|
||||
if (lastOpItemOffset_.has_value()) {
|
||||
#ifdef CROSS_PLATFORM
|
||||
auto* lastOpItem = static_cast<OpItem*>(opAllocator_.OffsetToAddr(lastOpItemOffset_.__get()));
|
||||
#else
|
||||
auto* lastOpItem = static_cast<OpItem*>(opAllocator_.OffsetToAddr(lastOpItemOffset_.value()));
|
||||
#endif
|
||||
if (lastOpItem != nullptr) {
|
||||
lastOpItem->SetNextOpItemOffset(offset);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ inline RoundRect::RoundRect(const Rect& r, scalar xRad, scalar yRad) noexcept :
|
||||
inline RoundRect::RoundRect(const Rect& r, const std::vector<Point>& radiusXY) noexcept : RoundRect()
|
||||
{
|
||||
rect_ = r;
|
||||
for (int i = 0; i < CORNER_NUMBER && i < static_cast<int>(radiusXY.size()); ++i) {
|
||||
for (size_t i = 0; i < CORNER_NUMBER && i < static_cast<int>(radiusXY.size()); ++i) {
|
||||
radiusXY_[i] = radiusXY[i];
|
||||
}
|
||||
isSimple_ = false;
|
||||
|
@ -23,6 +23,7 @@ namespace Drawing {
|
||||
|
||||
DrawingSymbolLayersGroups SkiaHmSymbolConfigOhos::GetSymbolLayersGroups(uint16_t glyphId)
|
||||
{
|
||||
#if !defined(ANDROID_PLATFORM) && !defined(IOS_PLATFORM)
|
||||
SymbolLayersGroups groups = HmSymbolConfig_OHOS::GetInstance()->GetSymbolLayersGroups(glyphId);
|
||||
|
||||
DrawingSymbolLayersGroups drawingGroups;
|
||||
@ -51,6 +52,9 @@ DrawingSymbolLayersGroups SkiaHmSymbolConfigOhos::GetSymbolLayersGroups(uint16_t
|
||||
drawingGroups.animationSettings = drawingSettings;
|
||||
drawingGroups.renderModeGroups = drawingRenderModeGroups;
|
||||
|
||||
return drawingGroups;
|
||||
#endif
|
||||
DrawingSymbolLayersGroups drawingGroups;
|
||||
return drawingGroups;
|
||||
}
|
||||
|
||||
@ -120,6 +124,7 @@ static std::vector<DrawingPiecewiseParameter> ConvertPiecewiseParametersVec(cons
|
||||
return out;
|
||||
}
|
||||
|
||||
#if !defined(ANDROID_PLATFORM) && !defined(IOS_PLATFORM)
|
||||
std::vector<std::vector<DrawingPiecewiseParameter>> SkiaHmSymbolConfigOhos::GetGroupParameters(
|
||||
DrawingAnimationType type, uint16_t groupSum, uint16_t animationMode, DrawingCommonSubType commonSubType)
|
||||
{
|
||||
@ -134,6 +139,7 @@ std::vector<std::vector<DrawingPiecewiseParameter>> SkiaHmSymbolConfigOhos::GetG
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace Drawing
|
||||
} // namespace Rosen
|
||||
|
@ -195,7 +195,11 @@ DrawingSymbolLayersGroups SkiaStaticFactory::GetSymbolLayersGroups(uint16_t glyp
|
||||
std::vector<std::vector<DrawingPiecewiseParameter>> SkiaStaticFactory::GetGroupParameters(
|
||||
DrawingAnimationType type, uint16_t groupSum, uint16_t animationMode, DrawingCommonSubType commonSubType)
|
||||
{
|
||||
#if !defined(ANDROID_PLATFORM) && !defined(IOS_PLATFORM)
|
||||
return SkiaHmSymbolConfigOhos::GetGroupParameters(type, groupSum, animationMode, commonSubType);
|
||||
#endif
|
||||
std::vector<std::vector<DrawingPiecewiseParameter>> parameters;
|
||||
return parameters;
|
||||
}
|
||||
|
||||
FontStyleSet* SkiaStaticFactory::CreateEmpty()
|
||||
|
@ -51,7 +51,9 @@ bool GPUContext::BuildFromVK(const GrVkBackendContext& context, const GPUContext
|
||||
|
||||
void GPUContext::GetResourceCacheLimits(int* maxResource, size_t* maxResourceBytes) const
|
||||
{
|
||||
impl_->GetResourceCacheLimits(maxResource, maxResourceBytes);
|
||||
if (impl_ != nullptr) {
|
||||
impl_->GetResourceCacheLimits(maxResource, maxResourceBytes);
|
||||
}
|
||||
}
|
||||
|
||||
void GPUContext::SetResourceCacheLimits(int maxResource, size_t maxResourceBytes)
|
||||
|
@ -164,9 +164,7 @@ protected:
|
||||
#endif
|
||||
EGLConfig config_;
|
||||
GraphicColorGamut colorSpace_ = GraphicColorGamut::GRAPHIC_COLOR_GAMUT_SRGB;
|
||||
#ifndef ROSEN_CROSS_PLATFORM
|
||||
int32_t pixelFormat_ = GraphicPixelFormat::GRAPHIC_PIXEL_FMT_RGBA_8888;
|
||||
#endif
|
||||
|
||||
bool isUniRenderMode_ = false;
|
||||
const std::string UNIRENDER_CACHE_DIR = "/data/service/el0/render_service";
|
||||
|
@ -36,8 +36,10 @@ class EventQueue final {
|
||||
public:
|
||||
// Priority for the events
|
||||
enum class Priority : uint32_t {
|
||||
// The highest priority queue, should be distributed until the tasks in the queue are completed.
|
||||
VIP = 0,
|
||||
// Event that should be distributed at once if possible.
|
||||
IMMEDIATE = 0,
|
||||
IMMEDIATE,
|
||||
// High priority event, sorted by handle time, should be distributed before low priority event.
|
||||
HIGH,
|
||||
// Normal event, sorted by handle time.
|
||||
|
@ -31,13 +31,20 @@ ohos_source_set("render_frame_trace") {
|
||||
}
|
||||
}
|
||||
}
|
||||
external_deps = [ "jsoncpp:jsoncpp" ]
|
||||
external_deps = []
|
||||
if (is_arkui_x) {
|
||||
deps = [ "//third_party/jsoncpp:jsoncpp_static" ]
|
||||
} else {
|
||||
external_deps += [ "jsoncpp:jsoncpp" ]
|
||||
}
|
||||
if (!build_ohos_sdk) {
|
||||
external_deps += [
|
||||
"ipc:ipc_single",
|
||||
"qos_manager:concurrent_task_client",
|
||||
]
|
||||
defines = [ "QOS_MANAGER" ]
|
||||
if (!is_arkui_x) {
|
||||
defines = [ "QOS_MANAGER" ]
|
||||
}
|
||||
}
|
||||
if (defined(global_parts_info)) {
|
||||
if (defined(global_parts_info.resourceschedule_frame_aware_sched)) {
|
||||
|
@ -231,7 +231,7 @@ ohos_shared_library("librender_service") {
|
||||
|
||||
if (rosen_is_ohos) {
|
||||
sources += [ "$rosen_root/modules/frame_report/src/rs_frame_report.cpp" ]
|
||||
} else {
|
||||
} else if (!is_arkui_x) {
|
||||
sources +=
|
||||
[ "$rosen_root/modules/frame_report/src/mingw/rs_frame_report.cpp" ]
|
||||
}
|
||||
|
@ -364,10 +364,7 @@ ohos_source_set("render_service_base_src") {
|
||||
"src/memory/rs_tag_tracker.cpp",
|
||||
|
||||
#pipeline
|
||||
"src/pipeline/rs_display_render_node.cpp",
|
||||
"src/pipeline/rs_occlusion_config.cpp",
|
||||
"src/pipeline/rs_uni_render_judgement.cpp",
|
||||
"src/pipeline/sk_resource_manager.cpp",
|
||||
|
||||
#transaction
|
||||
"src/transaction/rs_hgm_config_data.cpp",
|
||||
@ -459,6 +456,7 @@ ohos_source_set("render_service_base_src") {
|
||||
include_dirs += [
|
||||
"$graphic_2d_root/utils/color_manager/export",
|
||||
"//foundation/multimedia/image_framework/interfaces/innerkits/include",
|
||||
"//foundation/graphic/graphic_surface/interfaces/inner_api/surface",
|
||||
]
|
||||
}
|
||||
|
||||
@ -681,7 +679,11 @@ ohos_source_set("librender_service_base_static") {
|
||||
}
|
||||
|
||||
if (rs_enable_gpu) {
|
||||
public_external_deps += [ "openssl:libcrypto_shared" ]
|
||||
if (is_arkui_x) {
|
||||
public_external_deps += [ "openssl:libcrypto_static" ]
|
||||
} else {
|
||||
public_external_deps += [ "openssl:libcrypto_shared" ]
|
||||
}
|
||||
}
|
||||
|
||||
part_name = "graphic_2d"
|
||||
|
@ -38,6 +38,10 @@ if (rosen_cross_platform) {
|
||||
}
|
||||
}
|
||||
|
||||
if (use_rosen_drawing && defined(is_arkui_x) && is_arkui_x) {
|
||||
rs_common_define += [ "USE_ROSEN_DRAWING" ]
|
||||
}
|
||||
|
||||
if (is_emulator) {
|
||||
rs_common_define += [ "ROSEN_EMULATOR" ]
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "info_collection/rs_hardware_compose_disabled_reason_collection.h"
|
||||
#include <vector>
|
||||
|
||||
namespace OHOS {
|
||||
namespace Rosen {
|
||||
@ -43,7 +44,7 @@ void HwcDisabledReasonCollection::UpdateHwcDisabledReasonForDFX(NodeId id,
|
||||
HwcDisabledReasonInfos HwcDisabledReasonCollection::GetHwcDisabledReasonInfo() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(hwcDisabledReasonMtx_);
|
||||
HwcDisabledReasonInfos hwcDisabledReasonInfos;
|
||||
std::vector<HwcDisabledReasonInfo> hwcDisabledReasonInfos;
|
||||
for (const auto& hwcDisabledReasonInfo : hwcDisabledReasonInfoMap_) {
|
||||
hwcDisabledReasonInfos.emplace_back(hwcDisabledReasonInfo.second);
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ template("render_service_client_source_set") {
|
||||
include_dirs += [
|
||||
"$graphic_2d_root/utils/color_manager/export",
|
||||
"//foundation/multimedia/image_framework/interfaces/innerkits/include",
|
||||
"//foundation/graphic/graphic_surface/interfaces/inner_api/surface",
|
||||
]
|
||||
}
|
||||
|
||||
@ -139,6 +140,7 @@ template("render_service_client_source_set") {
|
||||
if (is_cross_platform) {
|
||||
#ui
|
||||
sources -= [ "core/ui/rs_display_node.cpp" ]
|
||||
defines += [ "CROSS_PLATFORM" ]
|
||||
}
|
||||
|
||||
if (defined(graphic_2d_ext_configs.vendor_root)) {
|
||||
@ -148,7 +150,7 @@ template("render_service_client_source_set") {
|
||||
|
||||
if (rosen_is_ohos) {
|
||||
sources += [ "$rosen_root/modules/frame_report/src/rs_frame_report.cpp" ]
|
||||
} else {
|
||||
} else if (!is_arkui_x) {
|
||||
sources +=
|
||||
[ "$rosen_root/modules/frame_report/src/mingw/rs_frame_report.cpp" ]
|
||||
}
|
||||
@ -190,7 +192,7 @@ template("render_service_client_source_set") {
|
||||
if (defined(use_rosen_drawing) && use_rosen_drawing) {
|
||||
defines += [ "USE_ROSEN_DRAWING" ]
|
||||
deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ]
|
||||
if (ace_enable_gpu) {
|
||||
if (ace_enable_gpu && !is_arkui_x) {
|
||||
defines += [ "ACE_ENABLE_GPU" ]
|
||||
}
|
||||
if (current_os == "mingw") {
|
||||
|
@ -191,6 +191,7 @@ void RSRenderThreadVisitor::PrepareSurfaceRenderNode(RSSurfaceRenderNode& node)
|
||||
|
||||
void RSRenderThreadVisitor::PrepareEffectRenderNode(RSEffectRenderNode& node)
|
||||
{
|
||||
#ifndef CROSS_PLATFORM
|
||||
if (!node.ShouldPaint() || curDirtyManager_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
@ -205,6 +206,7 @@ void RSRenderThreadVisitor::PrepareEffectRenderNode(RSEffectRenderNode& node)
|
||||
|
||||
effectRegion_ = effectRegion;
|
||||
dirtyFlag_ = dirtyFlag;
|
||||
#endif
|
||||
}
|
||||
|
||||
void RSRenderThreadVisitor::DrawRectOnCanvas(const RectI& dirtyRect, const Drawing::ColorQuad color,
|
||||
@ -997,10 +999,10 @@ void RSRenderThreadVisitor::ProcessTextureSurfaceRenderNode(RSSurfaceRenderNode&
|
||||
} else {
|
||||
auto backgroundColor = node.GetRenderProperties().GetBackgroundColor();
|
||||
if (backgroundColor != RgbPalette::Transparent()) {
|
||||
canvas_->clear(backgroundColor.AsArgbInt());
|
||||
canvas_->Clear(backgroundColor.AsArgbInt());
|
||||
}
|
||||
}
|
||||
canvas_->restore();
|
||||
canvas_->Restore();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -37,6 +37,7 @@ config("libtexgine_public_config") {
|
||||
include_dirs = [
|
||||
"export",
|
||||
"texgine_drawing",
|
||||
"//third_party/icu/icu4c/source/common",
|
||||
"$graphic_2d_root/rosen/modules/render_service_base/include",
|
||||
"$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter",
|
||||
"$graphic_2d_root/rosen/modules/2d_graphics/include",
|
||||
@ -77,6 +78,12 @@ ohos_source_set("libtexgine_source") {
|
||||
public_deps = [ "texgine_drawing:libtexgine_drawing" ]
|
||||
|
||||
defines = []
|
||||
if (is_arkui_x) {
|
||||
defines += [ "CROSS_PLATFORM" ]
|
||||
public_deps += [ "//third_party/jsoncpp:jsoncpp_static" ]
|
||||
} else {
|
||||
public_deps += [ "//third_party/jsoncpp:jsoncpp" ]
|
||||
}
|
||||
if (defined(use_rosen_drawing) && use_rosen_drawing) {
|
||||
defines += [ "USE_ROSEN_DRAWING" ]
|
||||
if (ace_enable_gpu) {
|
||||
@ -86,10 +93,15 @@ ohos_source_set("libtexgine_source") {
|
||||
if (enable_text_gine) {
|
||||
defines += [ "USE_GRAPHIC_TEXT_GINE" ]
|
||||
}
|
||||
external_deps = [
|
||||
"bounds_checking_function:libsec_static",
|
||||
"cJSON:cjson_static",
|
||||
]
|
||||
if (is_arkui_x) {
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_static" ]
|
||||
deps += [ "//third_party/cJSON:cjson_static" ]
|
||||
} else {
|
||||
external_deps = [
|
||||
"bounds_checking_function:libsec_static",
|
||||
"cJSON:cjson_static",
|
||||
]
|
||||
}
|
||||
|
||||
if (platform == "ohos") {
|
||||
defines += [ "BUILD_NON_SDK_VER" ]
|
||||
@ -123,6 +135,12 @@ ohos_source_set("libtexgine_source") {
|
||||
[ "$graphic_2d_root/rosen/build/icu:rosen_libicu_$platform" ]
|
||||
}
|
||||
}
|
||||
if (platform == "android") {
|
||||
defines += [ "BUILD_SDK_ANDROID" ]
|
||||
}
|
||||
if (platform == "ios") {
|
||||
defines += [ "BUILD_SDK_IOS" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,11 @@ void TextSpan::Paint(TexgineCanvas &canvas, double offsetX, double offsetY, cons
|
||||
if (xs.background.has_value()) {
|
||||
auto rect = TexgineRect::MakeXYWH(offsetX, offsetY + *tmetrics_->fAscent_, width_,
|
||||
*tmetrics_->fDescent_ - *tmetrics_->fAscent_);
|
||||
#ifdef CROSS_PLATFORM
|
||||
canvas.DrawRect(rect, xs.background.__get());
|
||||
#else
|
||||
canvas.DrawRect(rect, xs.background.value());
|
||||
#endif
|
||||
}
|
||||
|
||||
if (xs.backgroundRect.color != 0) {
|
||||
@ -209,7 +213,11 @@ void TextSpan::Paint(TexgineCanvas &canvas, double offsetX, double offsetY, cons
|
||||
paint.SetAntiAlias(true);
|
||||
paint.SetColor(xs.color);
|
||||
if (xs.foreground.has_value()) {
|
||||
#ifdef CROSS_PLATFORM
|
||||
paint = xs.foreground.__get();
|
||||
#else
|
||||
paint = xs.foreground.value();
|
||||
#endif
|
||||
}
|
||||
|
||||
PaintShadow(canvas, offsetX, offsetY, xs.shadows);
|
||||
|
@ -797,13 +797,21 @@ std::vector<TextRect> TypographyImpl::MergeRects(const std::vector<TextRect> &bo
|
||||
std::fabs(*pre->rect.fRight_ - *rect.rect.fLeft_) < MINDEV) {
|
||||
*pre->rect.fRight_ = *rect.rect.fRight_;
|
||||
} else {
|
||||
#ifdef CROSS_PLATFORM
|
||||
rects.push_back(pre.__get());
|
||||
#else
|
||||
rects.push_back(pre.value());
|
||||
#endif
|
||||
pre = rect;
|
||||
}
|
||||
}
|
||||
|
||||
if (pre.has_value()) {
|
||||
#ifdef CROSS_PLATFORM
|
||||
rects.push_back(pre.__get());
|
||||
#else
|
||||
rects.push_back(pre.value());
|
||||
#endif
|
||||
}
|
||||
|
||||
return rects;
|
||||
|
@ -29,10 +29,12 @@
|
||||
#define GET_TID GetCurrentThreadId
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_SDK_MAC
|
||||
#if defined(BUILD_SDK_MAC) || defined(BUILD_SDK_IOS)
|
||||
#include <stdlib.h>
|
||||
#include <sys/syscall.h>
|
||||
#define GET_TID() syscall(SYS_thread_selfid)
|
||||
#elif defined(BUILD_SDK_ANDROID)
|
||||
#define GET_TID() gettid()
|
||||
#else
|
||||
#ifdef __gnu_linux__
|
||||
#include <sys/types.h>
|
||||
|
@ -23,7 +23,7 @@ ohos_unittest("frame_report_test") {
|
||||
sources += [
|
||||
"$graphic_2d_root/rosen/modules/frame_report/src/rs_frame_report.cpp",
|
||||
]
|
||||
} else {
|
||||
} else if (!is_arkui_x) {
|
||||
sources += [ "$graphic_2d_root/rosen/modules/frame_report/src/mingw/rs_frame_report.cpp" ]
|
||||
}
|
||||
|
||||
|
@ -84,9 +84,8 @@ if (current_os == "ohos") {
|
||||
part_name = "graphic_2d"
|
||||
}
|
||||
} else {
|
||||
ohos_shared_library("color_manager") {
|
||||
ohos_source_set("color_manager") {
|
||||
public_deps = [ ":color_manager_source" ]
|
||||
public_configs = [ ":export" ]
|
||||
part_name = "graphic_2d"
|
||||
subsystem_name = "graphic"
|
||||
}
|
||||
|
@ -12,12 +12,16 @@
|
||||
# limitations under the License.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//foundation/graphic/graphic_2d/graphic_config.gni")
|
||||
|
||||
config("sandbox_utils_config") {
|
||||
include_dirs = [ "." ]
|
||||
}
|
||||
|
||||
ohos_static_library("sandbox_utils") {
|
||||
if (is_cross_platform) {
|
||||
defines = [ "ROSEN_CROSS_PLATFORM" ]
|
||||
}
|
||||
sources = [ "sandbox_utils.cpp" ]
|
||||
public_configs = [ ":sandbox_utils_config" ]
|
||||
|
||||
|
@ -26,7 +26,7 @@ pid_t GetRealPid(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return GetCurrentProcessId();
|
||||
#elif defined(OHOS_LITE) || defined(__APPLE__) || defined(__gnu_linux__)
|
||||
#elif defined(OHOS_LITE) || defined(__APPLE__) || defined(__gnu_linux__) || defined(ROSEN_CROSS_PLATFORM)
|
||||
return getpid();
|
||||
#else
|
||||
return getprocpid();
|
||||
|
Loading…
Reference in New Issue
Block a user