enable system param set function and add loginfo

Signed-off-by: yan-shuifeng <yanshuifeng@huawei.com>
Change-Id: Id616faa0608121c0eab2cf47db382676243af69f
This commit is contained in:
yan-shuifeng
2022-02-09 17:46:45 +08:00
parent 0bd74eb99c
commit f9fc57dbf5
58 changed files with 87 additions and 171 deletions
+22 -32
View File
@@ -151,14 +151,34 @@ void AceAbility::OnStart(const Want& want)
{
Ability::OnStart(want);
LOGI("AceAbility::OnStart called");
static std::once_flag onceFlag;
std::call_once(onceFlag, []() {
auto abilityContext = GetAbilityContext();
std::call_once(onceFlag, [abilityContext]() {
LOGI("Initialize for current process.");
SystemProperties::SetDeviceType(DeviceType::PHONE);
SetHwIcuDirectory();
Container::UpdateCurrent(INSTANCE_ID_PLATFORM);
CapabilityRegistry::Register();
AceApplicationInfo::GetInstance().SetPackageName(abilityContext->GetBundleName());
AceApplicationInfo::GetInstance().SetDataFileDirPath(abilityContext->GetFilesDir());
});
OHOS::sptr<OHOS::Rosen::Window> window = Ability::GetWindow();
// register surface change callback
OHOS::sptr<OHOS::Rosen::IWindowChangeListener> thisAbility(this);
window->RegisterWindowChangeListener(thisAbility);
int32_t width = window->GetRect().width_;
int32_t height = window->GetRect().height_;
LOGI("AceAbility: windowConfig: width: %{public}d, height: %{public}d", width, height);
// get density
auto defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplay();
if (defaultDisplay) {
density_ = defaultDisplay->GetVirtualPixelRatio();
LOGI("AceAbility: Default display density set: %{public}f", density_);
} else {
LOGI("AceAbility: Default display is null, set density failed. Use default density: %{public}f", density_);
}
SystemProperties::InitDeviceInfo(width, height, height >= width ? 0 : 1, density_, false);
SystemProperties::SetColorMode(ColorMode::LIGHT);
std::unique_ptr<Global::Resource::ResConfig> resConfig(Global::Resource::CreateResConfig());
auto resourceManager = GetResourceManager();
@@ -215,29 +235,6 @@ void AceAbility::OnStart(const Want& want)
auto pluginUtils = std::make_shared<PluginUtilsImpl>();
PluginManager::GetInstance().SetAceAbility(this, pluginUtils);
OHOS::sptr<OHOS::Rosen::Window> window = Ability::GetWindow();
// register surface change callback
OHOS::sptr<OHOS::Rosen::IWindowChangeListener> thisAbility(this);
window->RegisterWindowChangeListener(thisAbility);
int32_t width = window->GetRect().width_;
int32_t height = window->GetRect().height_;
LOGI("AceAbility: windowConfig: width: %{public}d, height: %{public}d", width, height);
// get density
auto defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplay();
if (defaultDisplay) {
density_ = defaultDisplay->GetVirtualPixelRatio();
LOGI("AceAbility: Default display density set: %{public}f", density_);
} else {
LOGI("AceAbility: Default display is null, set density failed. Use default density: %{public}f", density_);
}
SystemProperties::SetResolution(density_);
SystemProperties::SetDeviceType(DeviceType::PHONE);
SystemProperties::SetColorMode(ColorMode::LIGHT);
SystemProperties::SetDeviceOrientation(height >= width ? 0 : 1);
// create container
Platform::AceContainer::CreateContainer(abilityId_, frontendType, isArkApp, srcPath, this,
std::make_unique<AcePlatformEventCallback>([this]() { TerminateAbility(); }));
@@ -411,7 +408,6 @@ void AceAbility::OnBackPressed()
void AceAbility::OnPointerEvent(std::shared_ptr<MMI::PointerEvent>& pointerEvent)
{
LOGI("AceAbility::OnPointerEvent called ");
auto flutterAceView = static_cast<Platform::FlutterAceView*>(
Platform::AceContainer::GetContainer(abilityId_)->GetView());
if (!flutterAceView) {
@@ -423,9 +419,6 @@ void AceAbility::OnPointerEvent(std::shared_ptr<MMI::PointerEvent>& pointerEvent
void AceAbility::OnKeyUp(const std::shared_ptr<MMI::KeyEvent>& keyEvent)
{
LOGI("AceAbility::OnKeyUp called,keyEvent info: keyCode is %{public}d,\
keyAction is %{public}d, keyActionTime is %{public}d",
keyEvent->GetKeyCode(), keyEvent->GetKeyAction(), keyEvent->GetActionTime());
auto flutterAceView = static_cast<Platform::FlutterAceView*>(
Platform::AceContainer::GetContainer(abilityId_)->GetView());
if (!flutterAceView) {
@@ -443,9 +436,6 @@ void AceAbility::OnKeyUp(const std::shared_ptr<MMI::KeyEvent>& keyEvent)
void AceAbility::OnKeyDown(const std::shared_ptr<MMI::KeyEvent>& keyEvent)
{
LOGI("AceAbility::OnKeyDown called,keyEvent info: keyCode is %{private}d,\
keyAction is %{public}d, keyActionTime is %{public}d",
keyEvent->GetKeyCode(), keyEvent->GetKeyAction(), keyEvent->GetActionTime());
auto flutterAceView = static_cast<Platform::FlutterAceView*>(
Platform::AceContainer::GetContainer(abilityId_)->GetView());
if (!flutterAceView) {
+26 -3
View File
@@ -222,6 +222,26 @@ void ConvertAxisEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent, Ax
TimeStamp time(micros);
event.time = time;
}
void LogPointInfo(const std::shared_ptr<MMI::PointerEvent>& pointerEvent)
{
LOGI("point source: %{public}d", pointerEvent->GetSourceType());
auto actionId = pointerEvent->GetPointerId();
MMI::PointerEvent::PointerItem item;
if (pointerEvent->GetPointerItem(actionId, item)) {
LOGI("action point info: id: %{public}d, x: %{public}d, y: %{public}d, action: %{public}d", actionId,
item.GetLocalX(), item.GetLocalY(), pointerEvent->GetPointerAction());
}
auto ids = pointerEvent->GetPointersIdList();
for (auto&& id : ids) {
MMI::PointerEvent::PointerItem item;
if (pointerEvent->GetPointerItem(id, item)) {
LOGI("all point info: id: %{public}d, x: %{public}d, y: %{public}d, isPressed: %{public}d", actionId,
item.GetLocalX(), item.GetLocalY(), item.IsPressed());
}
}
}
} // namespace
FlutterAceView* FlutterAceView::CreateView(int32_t instanceId, bool useCurrentEventRunner, bool usePlatfromThread)
@@ -304,7 +324,7 @@ void FlutterAceView::SetViewportMetrics(FlutterAceView* view, const flutter::Vie
void FlutterAceView::DispatchTouchEvent(FlutterAceView* view, const std::shared_ptr<MMI::PointerEvent>& pointerEvent)
{
LOGD("FlutterAceView::DispatchTouchEvent SourceType = %{public}d", pointerEvent->GetSourceType());
LogPointInfo(pointerEvent);
if (pointerEvent->GetSourceType() == MMI::PointerEvent::SOURCE_TYPE_MOUSE) {
// mouse event
if (pointerEvent->GetPointerAction() >= MMI::PointerEvent::POINTER_ACTION_AXIS_BEGIN &&
@@ -325,6 +345,8 @@ void FlutterAceView::DispatchTouchEvent(FlutterAceView* view, const std::shared_
bool FlutterAceView::DispatchKeyEvent(FlutterAceView* view, int32_t keyCode, int32_t action, int32_t repeatTime,
int64_t timeStamp, int64_t timeStampStart)
{
LOGI("key info: keyCode: %{public}d, action: %{public}d, timeStamp: %{public}d", keyCode, action,
static_cast<int32_t>(timeStamp));
if (view != nullptr) {
return view->ProcessKeyEvent(keyCode, action, repeatTime, timeStamp, timeStampStart);
}
@@ -402,7 +424,6 @@ void FlutterAceView::ProcessMouseEvent(const std::shared_ptr<MMI::PointerEvent>&
{
MouseEvent event;
ConvertMouseEvent(pointerEvent, event);
LOGD("ProcessMouseEvent");
if (mouseEventCallback_) {
mouseEventCallback_(event);
@@ -413,7 +434,6 @@ void FlutterAceView::ProcessAxisEvent(const std::shared_ptr<MMI::PointerEvent>&
{
AxisEvent event;
ConvertAxisEvent(pointerEvent, event);
LOGD("ProcessAxisEvent");
if (axisEventCallback_) {
axisEventCallback_(event);
@@ -578,6 +598,7 @@ std::unique_ptr<DrawDelegate> FlutterAceView::GetDrawDelegate()
darwDelegate->SetDrawFrameCallback([this](RefPtr<Flutter::Layer>& layer, const Rect& dirty) {
if (!layer) {
LOGE("layer is nullptr");
return;
}
RefPtr<Flutter::FlutterSceneBuilder> flutterSceneBuilder = AceType::MakeRefPtr<Flutter::FlutterSceneBuilder>();
@@ -590,6 +611,8 @@ std::unique_ptr<DrawDelegate> FlutterAceView::GetDrawDelegate()
auto window = flutter::UIDartState::Current()->window();
if (window != nullptr && window->client() != nullptr) {
window->client()->Render(scene.get());
} else {
LOGE("window is nullptr");
}
});
@@ -80,7 +80,6 @@ void BackendDelegateImpl::RunPa(const std::string& url, const OHOS::AAFwk::Want&
void BackendDelegateImpl::SetJsMessageDispatcher(const RefPtr<JsMessageDispatcher>& dispatcher) const
{
LOGD("BackendDelegateImpl SetJsMessageDispatcher");
taskExecutor_->PostTask([dispatcherCallback = dispatcherCallback_, dispatcher] { dispatcherCallback(dispatcher); },
TaskExecutor::TaskType::JS);
}
+3 -3
View File
@@ -162,9 +162,11 @@ void UIContentImpl::CommonInitialize(OHOS::Rosen::Window* window, const std::str
static std::once_flag onceFlag;
std::call_once(onceFlag, [&context]() {
LOGI("Initialize for current process.");
SystemProperties::SetDeviceType(DeviceType::PHONE);
SetHwIcuDirectory();
Container::UpdateCurrent(INSTANCE_ID_PLATFORM);
AceApplicationInfo::GetInstance().SetProcessName(context->GetBundleName());
AceApplicationInfo::GetInstance().SetDataFileDirPath(context->GetFilesDir());
CapabilityRegistry::Register();
});
@@ -185,10 +187,8 @@ void UIContentImpl::CommonInitialize(OHOS::Rosen::Window* window, const std::str
LOGI("AceAbility: Default display is null, set density failed. Use default density: %{public}f", density);
}
}
SystemProperties::SetResolution(density);
SystemProperties::SetDeviceType(DeviceType::PHONE);
SystemProperties::InitDeviceInfo(width, height, height >= width ? 0 : 1, density, false);
SystemProperties::SetColorMode(ColorMode::LIGHT);
SystemProperties::SetDeviceOrientation(height >= width ? 0 : 1);
std::unique_ptr<Global::Resource::ResConfig> resConfig(Global::Resource::CreateResConfig());
auto resourceManager = context->GetResourceManager();
+1 -5
View File
@@ -26,11 +26,7 @@ template("ace_osal_ohos_source_set") {
"hiviewdfx_hilog_native:libhilog",
"startup_l2:syspara",
]
configs = [
# need check this
"//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara_config",
"$ace_root:ace_config",
]
configs = [ "$ace_root:ace_config" ]
} else {
external_deps = [
"bytrace:bytrace_core",
+13 -6
View File
@@ -31,7 +31,6 @@ const char PROPERTY_DEVICE_TYPE_TV[] = "tv";
const char PROPERTY_DEVICE_TYPE_WATCH[] = "watch";
const char PROPERTY_DEVICE_TYPE_CAR[] = "car";
const char DISABLE_ROSEN_FILE_PATH[] = "/etc/disablerosen";
const char ENABLE_DEBUG_FILE_PATH[] = "/etc/enabledebug";
constexpr int32_t ORIENTATION_PORTRAIT = 0;
constexpr int32_t ORIENTATION_LANDSCAPE = 1;
@@ -51,7 +50,13 @@ bool IsTraceEnabled()
bool IsRosenBackendEnabled()
{
#if defined(WINDOWS_PLATFORM) || defined(MAC_PLATFORM)
return false;
#endif
#ifdef ENABLE_ROSEN_BACKEND
if (system::GetParameter("persist.ace.rosen.backend.enabled", "0") == "1") {
return true;
}
if (access(DISABLE_ROSEN_FILE_PATH, F_OK) == 0) {
return false;
}
@@ -69,10 +74,7 @@ bool IsAccessibilityEnabled()
bool IsDebugEnabled()
{
if (access(ENABLE_DEBUG_FILE_PATH, F_OK) == 0) {
return true;
}
return false;
return (system::GetParameter("persist.ace.debug.enabled", "0") == "1");
}
} // namespace
@@ -120,6 +122,7 @@ ColorMode SystemProperties::colorMode_ { ColorMode::LIGHT };
ScreenShape SystemProperties::screenShape_ { ScreenShape::NOT_ROUND };
LongScreenType SystemProperties::LongScreen_ { LongScreenType::NOT_LONG };
bool SystemProperties::rosenBackendEnabled_ = IsRosenBackendEnabled();
bool SystemProperties::debugEnabled_ = IsDebugEnabled();
DeviceType SystemProperties::GetDeviceType()
{
@@ -164,6 +167,10 @@ void SystemProperties::InitDeviceInfo(
apiVersion_ = system::GetParameter("hw_sc.build.os.apiversion", INVALID_PARAM);
releaseType_ = system::GetParameter("hw_sc.build.os.releasetype", INVALID_PARAM);
paramDeviceType_ = system::GetParameter("hw_sc.build.os.devicetype", INVALID_PARAM);
debugEnabled_ = IsDebugEnabled();
traceEnabled_ = IsTraceEnabled();
accessibilityEnabled_ = IsAccessibilityEnabled();
rosenBackendEnabled_ = IsRosenBackendEnabled();
if (isRound_) {
screenShape_ = ScreenShape::ROUND;
@@ -203,6 +210,6 @@ void SystemProperties::InitMccMnc(int32_t mcc, int32_t mnc)
bool SystemProperties::GetDebugEnabled()
{
return IsDebugEnabled();
return debugEnabled_;
}
} // namespace OHOS::Ace
+1 -1
View File
@@ -589,7 +589,7 @@ void AceContainer::AddAssetPath(
}
if (flutterAssetManager) {
LOGD("Current path is: %s", path.c_str());
LOGD("Current path is: %{private}s", path.c_str());
auto dirAssetProvider = AceType::MakeRefPtr<DirAssetProvider>(
path, std::make_unique<flutter::DirectoryAssetBundle>(
fml::OpenDirectory(path.c_str(), false, fml::FilePermission::kRead)));
@@ -58,7 +58,6 @@ void AnimatableDimension::AnimateTo(double endValue)
return;
}
if (NearEqual(Value(), endValue) && !evaluator_) {
LOGD("AnimateTo with same value. endValue: %{public}.2f", endValue);
return;
}
ResetController();
@@ -69,7 +69,6 @@ void AnimatableMatrix4::AnimateTo(const Matrix4& endValue)
}
if (*this == endValue && !evaluator_) {
LOGD("AnimateTo with same value. endValue: %{public}s", endValue.ToString().c_str());
return;
}
ResetController();
@@ -259,6 +259,7 @@ private:
static ScreenShape screenShape_;
static LongScreenType LongScreen_;
static bool rosenBackendEnabled_;
static bool debugEnabled_;
};
} // namespace OHOS::Ace
-10
View File
@@ -39,13 +39,11 @@ DOMDiv::DOMDiv(NodeId nodeId, const std::string& nodeName) : DOMNode(nodeId, nod
void DOMDiv::OnChildNodeAdded(const RefPtr<DOMNode>& child, int32_t slot)
{
ACE_DCHECK(child);
LOGD("DOMDiv appendChild %{public}s", child->GetTag().c_str());
if (GetDisplay() == DisplayType::GRID) {
if (!grid_) {
LOGE("DOMDiv GridLayout is null");
return;
}
LOGD("Current is grid, add child to grid.");
grid_->InsertChild(slot, child->GetRootComponent());
} else {
if (isFlexWrap_) {
@@ -53,14 +51,12 @@ void DOMDiv::OnChildNodeAdded(const RefPtr<DOMNode>& child, int32_t slot)
LOGE("DOMDiv wrapChild is null");
return;
}
LOGD("Current is wrap, add child to wrap.");
wrapChild_->InsertChild(slot, child->GetRootComponent());
} else {
if (!flexChild_) {
LOGE("DOMDiv FlexChild is null");
return;
}
LOGD("Current is flex, add child to flex.");
flexChild_->InsertChild(slot, child->GetRootComponent());
}
}
@@ -68,13 +64,11 @@ void DOMDiv::OnChildNodeAdded(const RefPtr<DOMNode>& child, int32_t slot)
void DOMDiv::OnChildNodeRemoved(const RefPtr<DOMNode>& child)
{
LOGD("DOMDiv remove child %{public}s", child->GetTag().c_str());
if (GetDisplay() == DisplayType::GRID) {
if (!grid_) {
LOGE("DOMDiv GridLayout is null");
return;
}
LOGD("Current is grid, remove child from grid.");
grid_->RemoveChild(child->GetRootComponent());
} else {
if (isFlexWrap_) {
@@ -82,14 +76,12 @@ void DOMDiv::OnChildNodeRemoved(const RefPtr<DOMNode>& child)
LOGE("DOMDiv wrapChild is null");
return;
}
LOGD("Current is wrap, remove child from wrap.");
wrapChild_->RemoveChild(child->GetRootComponent());
} else {
if (!flexChild_) {
LOGE("DOMDiv FlexChild is null");
return;
}
LOGD("Current is flex, remove child from flex.");
flexChild_->RemoveChild(child->GetRootComponent());
}
}
@@ -121,7 +113,6 @@ Alignment DOMDiv::ComputeFlexAlign(FlexAlign flexMainAlign, FlexAlign flexCrossA
void DOMDiv::CreateOrUpdateGrid()
{
LOGD("Create DOMGrid");
if (!grid_) {
grid_ = AceType::MakeRefPtr<GridLayoutComponent>(std::list<RefPtr<Component>>());
}
@@ -140,7 +131,6 @@ void DOMDiv::CreateOrUpdateGrid()
void DOMDiv::CreateOrUpdateGridItem()
{
LOGD("Create DOMGrid item");
if (!gridItem_) {
gridItem_ = AceType::MakeRefPtr<GridLayoutItemComponent>(RefPtr<Component>());
}
@@ -51,7 +51,6 @@ std::vector<std::string> JsForEachFunction::ExecuteIdentityMapper()
}
std::string key(jsKey->ToString());
LOGD("ForEach item with identifier: %s", key.c_str());
result.emplace_back(key.c_str());
} else {
result.emplace_back(std::to_string(i));
@@ -63,7 +62,7 @@ std::vector<std::string> JsForEachFunction::ExecuteIdentityMapper()
void JsForEachFunction::ExecuteBuilderForIndex(int32_t index)
{
LOGD("ExecuteBuilderForIndex: start, index %d", index);
LOGD("ExecuteBuilderForIndex: start, index %{public}d", index);
// indexed item
JSRef<JSArray> jsArray = JSRef<JSArray>::Cast(jsThis_.Lock());
JSRef<JSVal> params[2];
@@ -573,7 +573,6 @@ panda::Local<panda::JSValueRef> JsSendMouseEvent(panda::EcmaVM* vm, panda::Local
panda::Local<panda::JSValueRef> Vp2Px(panda::EcmaVM* vm, panda::Local<panda::JSValueRef> value,
const panda::Local<panda::JSValueRef> args[], int32_t argc, void* data)
{
LOGD("Vp2Px");
if (argc != 1) {
LOGE("The arg is wrong, must have one argument");
return panda::JSValueRef::Undefined(vm);
@@ -594,7 +593,6 @@ panda::Local<panda::JSValueRef> Vp2Px(panda::EcmaVM* vm, panda::Local<panda::JSV
panda::Local<panda::JSValueRef> Px2Vp(panda::EcmaVM* vm, panda::Local<panda::JSValueRef> value,
const panda::Local<panda::JSValueRef> args[], int32_t argc, void* data)
{
LOGD("Px2Vp");
if (argc != 1) {
LOGE("The arg is wrong, must have one argument");
return panda::JSValueRef::Undefined(vm);
@@ -618,7 +616,6 @@ panda::Local<panda::JSValueRef> Px2Vp(panda::EcmaVM* vm, panda::Local<panda::JSV
panda::Local<panda::JSValueRef> Fp2Px(panda::EcmaVM* vm, panda::Local<panda::JSValueRef> value,
const panda::Local<panda::JSValueRef> args[], int32_t argc, void* data)
{
LOGD("Fp2Px");
if (argc != 1) {
LOGE("The arg is wrong, must have one argument");
return panda::JSValueRef::Undefined(vm);
@@ -647,7 +644,6 @@ panda::Local<panda::JSValueRef> Fp2Px(panda::EcmaVM* vm, panda::Local<panda::JSV
panda::Local<panda::JSValueRef> Px2Fp(panda::EcmaVM* vm, panda::Local<panda::JSValueRef> value,
const panda::Local<panda::JSValueRef> args[], int32_t argc, void* data)
{
LOGD("Px2Fp");
if (argc != 1) {
LOGE("The arg is wrong, must have one argument");
return panda::JSValueRef::Undefined(vm);
@@ -678,7 +674,6 @@ panda::Local<panda::JSValueRef> Px2Fp(panda::EcmaVM* vm, panda::Local<panda::JSV
panda::Local<panda::JSValueRef> Lpx2Px(panda::EcmaVM* vm, panda::Local<panda::JSValueRef> value,
const panda::Local<panda::JSValueRef> args[], int32_t argc, void* data)
{
LOGD("Lpx2Px");
if (argc != 1) {
LOGE("The arg is wrong, must have one argument");
return panda::JSValueRef::Undefined(vm);
@@ -706,7 +701,6 @@ panda::Local<panda::JSValueRef> Lpx2Px(panda::EcmaVM* vm, panda::Local<panda::JS
panda::Local<panda::JSValueRef> Px2Lpx(panda::EcmaVM* vm, panda::Local<panda::JSValueRef> value,
const panda::Local<panda::JSValueRef> args[], int32_t argc, void* data)
{
LOGD("Px2Lpx");
if (argc != 1) {
LOGE("The arg is wrong, must have one argument");
return panda::JSValueRef::Undefined(vm);
@@ -61,6 +61,16 @@ public:
void SetProcessName(const std::string& processName);
const std::string& GetProcessName() const;
void SetDataFileDirPath(const std::string& dataDirFilePath)
{
dataDirFilePath_ = dataDirFilePath;
}
const std::string& GetDataFileDirPath() const
{
return dataDirFilePath_;
}
virtual bool GetBundleInfo(const std::string& packageName, AceBundleInfo& bundleInfo) = 0;
virtual double GetLifeTime() const = 0;
@@ -137,6 +147,7 @@ protected:
std::string packageName_;
std::string processName_;
std::string dataDirFilePath_;
int32_t uid_;
bool isRightToLeft_ = false;
+4 -2
View File
@@ -22,6 +22,7 @@
#include "base/log/log.h"
#include "base/memory/memory_monitor.h"
#include "base/thread/background_task_executor.h"
#include "core/common/ace_application_info.h"
#include "core/common/ace_page.h"
#include "core/image/image_cache.h"
@@ -54,9 +55,10 @@ void HandleSignal(int signo)
default:
return;
}
auto fd = fopen("/data/arkui_dump.log", "w");
auto dumpFilePath = AceApplicationInfo::GetInstance().GetDataFileDirPath() + "/arkui.dump";
auto fd = fopen(dumpFilePath.c_str(), "w");
if (fd == nullptr) {
LOGE("HandleSignal signal failed due to fd is null");
LOGE("HandleSignal signal failed due to fd is null, path is %{private}s", dumpFilePath.c_str());
return;
}
+1
View File
@@ -16,6 +16,7 @@
#ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_DRAW_DELEGATE_H
#define FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_DRAW_DELEGATE_H
#include "base/geometry/rect.h"
#include "core/pipeline/layers/layer.h"
namespace OHOS::Rosen {
+2
View File
@@ -36,9 +36,11 @@ Window::Window(std::unique_ptr<PlatformWindow> platformWindow) : platformWindow_
void Window::RequestFrame()
{
if (!onShow_) {
LOGI("window is not show, stop request frame");
return;
}
if (!isRequestVsync_ && platformWindow_ != nullptr) {
LOGD("request next vsync");
platformWindow_->RequestFrame();
isRequestVsync_ = true;
}
@@ -35,7 +35,6 @@ const std::vector<CheckableStatus> CHECKABLE_STATUS = {
void RenderCheckbox::Update(const RefPtr<Component>& component)
{
LOGD("update");
RenderCheckable::Update(component);
const auto& checkbox = AceType::DynamicCast<CheckboxComponent>(component);
if (!checkbox) {
@@ -33,7 +33,6 @@ constexpr double DEFAULT_SHRINK_TIME_SLOT = 0.9;
void RenderRadio::Update(const RefPtr<Component>& component)
{
LOGD("update");
RenderCheckable::Update(component);
const auto& radio = AceType::DynamicCast<RadioComponent<std::string>>(component);
component_ = radio;
@@ -23,8 +23,6 @@ using namespace Flutter;
void FlutterRenderClip::Paint(RenderContext& context, const Offset& offset)
{
LOGD("Paint");
RRect rrect;
Corner corner = {
Radius(NormalizeToPx(topLeftRadius_.GetX()), NormalizeToPx(topLeftRadius_.GetY())),
@@ -21,7 +21,6 @@ using namespace Flutter;
RenderLayer FlutterRenderDisplay::GetRenderLayer()
{
LOGD("GetRenderLayer");
if (disableLayer_) {
return nullptr;
}
@@ -38,7 +37,6 @@ RenderLayer FlutterRenderDisplay::GetRenderLayer()
void FlutterRenderDisplay::Paint(RenderContext& context, const Offset& offset)
{
LOGD("Paint");
if (visible_ == VisibleType::VISIBLE) {
if (!disableLayer_ && layer_) {
layer_->SetOpacity(opacity_, 0.0, 0.0);
@@ -53,7 +53,6 @@ void RosenRenderDisplay::OnOpacityAnimationCallback()
void RosenRenderDisplay::Paint(RenderContext& context, const Offset& offset)
{
LOGD("Paint");
if (visible_ == VisibleType::VISIBLE) {
RenderNode::Paint(context, offset);
}
@@ -32,7 +32,6 @@ RenderLayer FlutterRenderRefresh::GetRenderLayer()
void FlutterRenderRefresh::Paint(RenderContext& context, const Offset& offset)
{
LOGD("Refresh Paint");
layer_->SetClip(0.0, GetLayoutSize().Width(), 0.0, GetLayoutSize().Height(), Clip::HARD_EDGE);
auto children = GetChildren();
@@ -28,7 +28,6 @@ void RosenRenderRefresh::Paint(RenderContext& context, const Offset& offset)
if (rsNode == nullptr) {
return;
}
LOGD("Refresh Paint");
rsNode->SetClipToFrame(true);
auto children = GetChildren();
@@ -27,7 +27,6 @@ using namespace Flutter;
void FlutterRenderRoot::Paint(RenderContext& context, const Offset& offset)
{
LOGD("RootNode Paint");
auto canvas = static_cast<FlutterRenderContext&>(context).GetCanvas();
if (!canvas || !canvas->canvas()) {
LOGE("Paint canvas is null");
@@ -49,7 +49,6 @@ void RenderRoot::Update(const RefPtr<Component>&)
void RenderRoot::PerformLayout()
{
LOGD("RenderRoot::PerformLayout");
auto appTheme = GetTheme<AppTheme>();
// Use theme background color to clear canvas.
if (appTheme && !isBgColorInit_) {
@@ -27,7 +27,6 @@ namespace OHOS::Ace {
void RootElement::PerformBuild()
{
LOGD("RootElement::PerformBuild");
const RefPtr<RootComponent> root = AceType::DynamicCast<RootComponent>(component_);
if (root) {
active_ = true;
@@ -25,7 +25,6 @@ namespace OHOS::Ace {
void RosenRenderRoot::Paint(RenderContext& context, const Offset& offset)
{
LOGD("RootNode Paint");
auto rsNode = static_cast<RosenRenderContext*>(&context)->GetRSNode();
if (!rsNode) {
LOGE("Paint canvas is null");
@@ -32,7 +32,6 @@ constexpr Dimension HOVER_RADIUS = 16.0_vp;
void FlutterRenderCircleBlock::Update(const RefPtr<Component>& component)
{
LOGD("Slider::Update");
RenderBlock::Update(component);
}
@@ -38,7 +38,6 @@ constexpr int32_t HOVER_ANIMATION_DURATION = 250;
void FlutterRenderSlider::Update(const RefPtr<Component>& component)
{
LOGD("Slider::Update");
RenderSlider::Update(component);
if (initialUpdate_) {
track_ = RenderTrack::Create();
@@ -59,7 +58,6 @@ void FlutterRenderSlider::Update(const RefPtr<Component>& component)
blockHotHeight_ = slider->GetBlock()->GetHotRegionHeight();
track_->Update(slider->GetTrack());
LOGD("Slider::Update end");
MarkNeedLayout();
}
@@ -19,7 +19,6 @@ namespace OHOS::Ace {
void RenderBlock::Update(const RefPtr<Component>& component)
{
LOGD("Slider::RenderBlock Update");
const RefPtr<BlockComponent> block = AceType::DynamicCast<BlockComponent>(component);
if (block == nullptr) {
LOGE("Slider::RenderBlock update with nullptr");
@@ -34,7 +33,6 @@ void RenderBlock::Update(const RefPtr<Component>& component)
void RenderBlock::PerformLayout()
{
LOGD("Slider::RenderBlock PerformLayout");
SetLayoutSize(Measure());
}
@@ -32,7 +32,6 @@ RenderLayer FlutterRenderTabBar::GetRenderLayer()
void FlutterRenderTabBar::Paint(RenderContext& context, const Offset& offset)
{
LOGD("TabBar Paint");
layer_->SetClip(0.0, GetLayoutSize().Width(), 0.0, GetLayoutSize().Height(), Clip::HARD_EDGE);
RenderTabBar::Paint(context, offset);
}
@@ -31,7 +31,6 @@ RenderLayer FlutterRenderTabContent::GetRenderLayer()
}
void FlutterRenderTabContent::Paint(RenderContext& context, const Offset& offset)
{
LOGD("TabContent Paint");
layer_->SetClip(0.0, GetLayoutSize().Width(), 0.0, GetLayoutSize().Height(), Clip::HARD_EDGE);
RenderNode::Paint(context, offset);
}
@@ -114,7 +114,6 @@ void TabBarElement::PerformBuild()
return;
}
LOGD("TabBarElement::PerformBuild");
int32_t index = 0;
for (auto& box : tabs_) {
UpdateChild(GetChild(index), box);
@@ -39,7 +39,6 @@ RenderLayer FlutterRenderToolBarItem::GetRenderLayer()
void FlutterRenderToolBarItem::Paint(RenderContext& context, const Offset& offset)
{
LOGD("ToolBarItem Paint");
clipLayer_->SetClip(0.0, GetLayoutSize().Width(), 0.0, GetLayoutSize().Height(), Clip::HARD_EDGE);
auto renderContext = AceType::DynamicCast<FlutterRenderContext>(&context);
if (!renderContext) {
@@ -37,7 +37,6 @@ void RosenRenderToolBarItem::Update(const RefPtr<Component>& component)
void RosenRenderToolBarItem::Paint(RenderContext& context, const Offset& offset)
{
LOGD("ToolBarItem Paint");
auto renderContext = AceType::DynamicCast<RosenRenderContext>(&context);
if (!renderContext) {
LOGE("Render context is null");
@@ -142,7 +142,6 @@ void ButtonComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Componen
}
buttonElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
buttonElement->MarkDirty();
LOGD("button AddChildWithSlot");
}
void ButtonComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -155,7 +154,6 @@ void ButtonComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Compo
auto child = buttonElement->GetChildBySlot(slot);
buttonElement->UpdateChildWithSlot(child, newComponent, slot, slot);
buttonElement->MarkDirty();
LOGD("button UpdateChildWithSlot");
}
void ButtonComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -167,7 +165,6 @@ void ButtonComposedElement::DeleteChildWithSlot(int32_t slot)
}
buttonElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
buttonElement->MarkDirty();
LOGD("button DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -125,7 +125,6 @@ void ColumnComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Componen
}
flexElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
flexElement->MarkDirty();
LOGD("column AddChildWithSlot");
}
void ColumnComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -138,7 +137,6 @@ void ColumnComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Compo
auto child = flexElement->GetChildBySlot(slot);
flexElement->UpdateChildWithSlot(child, newComponent, slot, slot);
flexElement->MarkDirty();
LOGD("column UpdateChildWithSlot");
}
void ColumnComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -150,7 +148,6 @@ void ColumnComposedElement::DeleteChildWithSlot(int32_t slot)
}
flexElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
flexElement->MarkDirty();
LOGD("column DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -71,7 +71,6 @@ void ColumnSplitComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Com
}
columnSplitElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
columnSplitElement->MarkDirty();
LOGD("columnSplit AddChildWithSlot");
}
void ColumnSplitComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -84,7 +83,6 @@ void ColumnSplitComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<
auto child = columnSplitElement->GetChildBySlot(slot);
columnSplitElement->UpdateChildWithSlot(child, newComponent, slot, slot);
columnSplitElement->MarkDirty();
LOGD("columnSplit UpdateChildWithSlot");
}
void ColumnSplitComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -96,7 +94,6 @@ void ColumnSplitComposedElement::DeleteChildWithSlot(int32_t slot)
}
columnSplitElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
columnSplitElement->MarkDirty();
LOGD("columnSplit DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -128,7 +128,6 @@ void FlexComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Component>
}
flexElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
flexElement->MarkDirty();
LOGD("flex AddChildWithSlot");
}
void FlexComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -141,7 +140,6 @@ void FlexComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Compone
auto child = flexElement->GetChildBySlot(slot);
flexElement->UpdateChildWithSlot(child, newComponent, slot, slot);
flexElement->MarkDirty();
LOGD("flex UpdateChildWithSlot");
}
void FlexComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -153,7 +151,6 @@ void FlexComposedElement::DeleteChildWithSlot(int32_t slot)
}
flexElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
flexElement->MarkDirty();
LOGD("flex DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -235,7 +235,6 @@ void GridComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Component>
}
gridLayoutElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
gridLayoutElement->MarkDirty();
LOGD("grid AddChildWithSlot");
}
void GridComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -248,7 +247,6 @@ void GridComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Compone
auto child = gridLayoutElement->GetChildBySlot(slot);
gridLayoutElement->UpdateChildWithSlot(child, newComponent, slot, slot);
gridLayoutElement->MarkDirty();
LOGD("grid UpdateChildWithSlot");
}
void GridComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -260,7 +258,6 @@ void GridComposedElement::DeleteChildWithSlot(int32_t slot)
}
gridLayoutElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
gridLayoutElement->MarkDirty();
LOGD("grid DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -120,7 +120,6 @@ void GridContainerComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<C
}
boxElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
boxElement->MarkDirty();
LOGD("gridContainer AddChildWithSlot");
}
void GridContainerComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -137,7 +136,6 @@ void GridContainerComposedElement::UpdateChildWithSlot(int32_t slot, const RefPt
}
boxElement->UpdateChildWithSlot(child, newComponent, slot, slot);
boxElement->MarkDirty();
LOGD("gridContainer UpdateChildWithSlot");
}
void GridContainerComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -149,7 +147,6 @@ void GridContainerComposedElement::DeleteChildWithSlot(int32_t slot)
}
boxElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
boxElement->MarkDirty();
LOGD("gridContainer DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -96,7 +96,6 @@ void HyperlinkComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Compo
}
hyperlinkElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
hyperlinkElement->MarkDirty();
LOGD("hyperlink AddChildWithSlot");
}
void HyperlinkComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -113,7 +112,6 @@ void HyperlinkComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Co
}
hyperlinkElement->UpdateChildWithSlot(child, newComponent, slot, slot);
hyperlinkElement->MarkDirty();
LOGD("hyperlink UpdateChildWithSlot");
}
void HyperlinkComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -125,7 +123,6 @@ void HyperlinkComposedElement::DeleteChildWithSlot(int32_t slot)
}
hyperlinkElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
hyperlinkElement->MarkDirty();
LOGD("hyperlink DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -118,7 +118,6 @@ void RowComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Component>&
}
rowElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
rowElement->MarkDirty();
LOGD("row AddChildWithSlot");
}
void RowComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -131,7 +130,6 @@ void RowComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Componen
auto child = rowElement->GetChildBySlot(slot);
rowElement->UpdateChildWithSlot(child, newComponent, slot, slot);
rowElement->MarkDirty();
LOGD("row UpdateChildWithSlot");
}
void RowComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -143,7 +141,6 @@ void RowComposedElement::DeleteChildWithSlot(int32_t slot)
}
rowElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
rowElement->MarkDirty();
LOGD("row DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -70,7 +70,6 @@ void RowSplitComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Compon
}
rowSplitElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
rowSplitElement->MarkDirty();
LOGD("rowSplit AddChildWithSlot");
}
void RowSplitComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -83,7 +82,6 @@ void RowSplitComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Com
auto child = rowSplitElement->GetChildBySlot(slot);
rowSplitElement->UpdateChildWithSlot(child, newComponent, slot, slot);
rowSplitElement->MarkDirty();
LOGD("rowSplit UpdateChildWithSlot");
}
void RowSplitComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -95,7 +93,6 @@ void RowSplitComposedElement::DeleteChildWithSlot(int32_t slot)
}
rowSplitElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
rowSplitElement->MarkDirty();
LOGD("rowSplit DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -102,7 +102,6 @@ void ScrollBarComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Compo
}
scrollBarElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
scrollBarElement->MarkDirty();
LOGD("scrollBar AddChildWithSlot");
}
void ScrollBarComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -115,7 +114,6 @@ void ScrollBarComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Co
auto child = scrollBarElement->GetChildBySlot(slot);
scrollBarElement->UpdateChildWithSlot(child, newComponent, slot, slot);
scrollBarElement->MarkDirty();
LOGD("scrollBar UpdateChildWithSlot");
}
void ScrollBarComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -127,6 +125,5 @@ void ScrollBarComposedElement::DeleteChildWithSlot(int32_t slot)
}
scrollBarElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
scrollBarElement->MarkDirty();
LOGD("scrollBar DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -85,7 +85,6 @@ void StackComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Component
}
stackElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
stackElement->MarkDirty();
LOGD("stack AddChildWithSlot");
}
void StackComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -98,7 +97,6 @@ void StackComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Compon
auto child = stackElement->GetChildBySlot(slot);
stackElement->UpdateChildWithSlot(child, newComponent, slot, slot);
stackElement->MarkDirty();
LOGD("stack UpdateChildWithSlot");
}
void StackComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -110,7 +108,5 @@ void StackComposedElement::DeleteChildWithSlot(int32_t slot)
}
stackElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
stackElement->MarkDirty();
LOGD("stack DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -145,7 +145,6 @@ void SwiperComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Componen
}
swiperElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
swiperElement->MarkDirty();
LOGD("swiper AddChildWithSlot");
}
void SwiperComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -158,7 +157,6 @@ void SwiperComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Compo
auto child = swiperElement->GetChildBySlot(slot);
swiperElement->UpdateChildWithSlot(child, newComponent, slot, slot);
swiperElement->MarkDirty();
LOGD("swiper UpdateChildWithSlot");
}
void SwiperComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -170,7 +168,6 @@ void SwiperComposedElement::DeleteChildWithSlot(int32_t slot)
}
swiperElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
swiperElement->MarkDirty();
LOGD("swiper DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -96,7 +96,6 @@ void TabContentComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Comp
}
tabContentElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
tabContentElement->MarkDirty();
LOGD("tabContent AddChildWithSlot");
}
void TabContentComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -109,7 +108,6 @@ void TabContentComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<C
auto child = tabContentElement->GetChildBySlot(slot);
tabContentElement->UpdateChildWithSlot(child, newComponent, slot, slot);
tabContentElement->MarkDirty();
LOGD("tabContent UpdateChildWithSlot");
}
void TabContentComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -121,7 +119,6 @@ void TabContentComposedElement::DeleteChildWithSlot(int32_t slot)
}
tabContentElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
tabContentElement->MarkDirty();
LOGD("tabContent DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -231,7 +231,6 @@ void TextComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Component>
}
textElement->UpdateChildWithSlot(nullptr, newComponent, slot, slot);
textElement->MarkDirty();
LOGD("text AddChildWithSlot");
}
void TextComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent)
@@ -244,7 +243,6 @@ void TextComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Compone
auto child = textElement->GetChildBySlot(slot);
textElement->UpdateChildWithSlot(child, newComponent, slot, slot);
textElement->MarkDirty();
LOGD("text UpdateChildWithSlot");
}
void TextComposedElement::DeleteChildWithSlot(int32_t slot)
@@ -256,7 +254,6 @@ void TextComposedElement::DeleteChildWithSlot(int32_t slot)
}
textElement->UpdateChildWithSlot(nullptr, nullptr, slot, slot);
textElement->MarkDirty();
LOGD("text DeleteChildWithSlot");
}
} // namespace OHOS::Ace::V2
@@ -27,8 +27,6 @@ void ConvertTouchEvent(const std::vector<uint8_t>& data, std::vector<TouchEvent>
size_t size = data.size() / sizeof(AceActionData);
auto current = const_cast<AceActionData*>(origin);
auto end = current + size;
LOGD("ConvertTouchEvent size:%zu", size);
while (current < end) {
std::chrono::microseconds micros(current->timeStamp);
TimeStamp time(micros);
@@ -43,7 +41,6 @@ void ConvertTouchEvent(const std::vector<uint8_t>& data, std::vector<TouchEvent>
case AceActionData::ActionType::ADD:
case AceActionData::ActionType::REMOVE:
case AceActionData::ActionType::HOVER:
LOGD("ConvertTouchEvent not implement!");
break;
case AceActionData::ActionType::DOWN:
point.type = TouchType::DOWN;
-2
View File
@@ -146,7 +146,6 @@ sk_sp<SkData> ImageLoader::LoadDataFromCachedFile(const std::string& uri)
sk_sp<SkData> FileImageLoader::LoadImageData(
const ImageSourceInfo& imageSourceInfo, const WeakPtr<PipelineContext> context)
{
LOGD("File Image!");
auto src = imageSourceInfo.GetSrc();
std::string filePath = RemovePathHead(src);
if (imageSourceInfo.GetSrcType() == SrcType::INTERNAL) {
@@ -283,7 +282,6 @@ sk_sp<SkData> NetworkImageLoader::LoadImageData(
{
auto uri = imageSourceInfo.GetSrc();
// 1. find in cache file path.
LOGD("Network Image!");
auto skData = ImageLoader::LoadDataFromCachedFile(uri);
if (skData) {
return skData;
@@ -27,7 +27,6 @@ namespace OHOS::Ace {
RefPtr<Element> ComponentGroupElement::Create()
{
LOGD("ComponentGroupElement::Create");
return AceType::MakeRefPtr<ComponentGroupElement>();
}
@@ -47,10 +46,8 @@ void ComponentGroupElement::PerformBuild()
const auto& newComponents = componentGroup->GetChildren();
if (context->GetIsDeclarative() && componentGroup->GetUpdateType() != UpdateType::REBUILD) {
LOGD("Reconciliation via declarative path %{public}s", AceType::TypeName(this));
UpdateChildrenForDeclarative(newComponents);
} else {
LOGD("Reconciliation via common path %{public}s", AceType::TypeName(this));
UpdateChildren(newComponents);
}
}
@@ -39,7 +39,6 @@ FlutterRenderContext::~FlutterRenderContext()
void FlutterRenderContext::Repaint(const RefPtr<RenderNode>& node)
{
if (!ShouldPaint(node) || !node->NeedRender() || !node->GetRenderLayer()) {
LOGD("Node is not need to paint");
return;
}
InitContext(node->GetRenderLayer(), node->GetRectWithShadow());
@@ -50,7 +49,6 @@ void FlutterRenderContext::Repaint(const RefPtr<RenderNode>& node)
void FlutterRenderContext::PaintChild(const RefPtr<RenderNode>& child, const Offset& offset)
{
if (!ShouldPaint(child)) {
LOGD("Node is not need to paint");
return;
}
@@ -174,7 +172,6 @@ void FlutterRenderContext::StopRecordingIfNeeded()
bool FlutterRenderContext::IsIntersectWith(const RefPtr<RenderNode>& child, Offset& offset)
{
if (!ShouldPaint(child)) {
LOGD("Node is not need to paint");
return false;
}
@@ -192,7 +189,6 @@ bool FlutterRenderContext::IsIntersectWith(const RefPtr<RenderNode>& child, Offs
void FlutterRenderContext::InitContext(RenderLayer layer, const Rect& rect)
{
LOGD("InitContext with width %{public}lf height %{public}lf", rect.Width(), rect.Height());
estimatedRect_ = rect;
containerLayer_ = CastLayerAs<ContainerLayer>(layer);
containerLayer_->RemoveChildren();
@@ -76,10 +76,8 @@ void RenderNode::MarkTreeRender(const RefPtr<RenderNode>& root, bool& meetHole,
if (meetHole) {
root->SetNeedClip(false);
LOGD("Hole: has meet hole, no need clip");
} else {
root->SetNeedClip(true);
LOGD("Hole: has not meet hole, need clip");
}
if (needFlush) {
@@ -376,7 +374,6 @@ void RenderNode::RenderWithContext(RenderContext& context, const Offset& offset)
}
pendingDispatchLayoutReady_ = false;
if (GetHasSubWindow() || !GetNeedClip()) {
LOGD("Hole: meet subwindow node or no need clip");
if (context.GetNeedRestoreHole()) {
context.Restore();
context.SetNeedRestoreHole(false);
@@ -39,7 +39,6 @@ RosenRenderContext::~RosenRenderContext()
void RosenRenderContext::Repaint(const RefPtr<RenderNode>& node)
{
if (!ShouldPaint(node) || !node->NeedRender() || node->GetRSNode() == nullptr) {
LOGD("Node is not need to paint");
return;
}
@@ -59,7 +58,6 @@ void RosenRenderContext::Repaint(const RefPtr<RenderNode>& node)
void RosenRenderContext::PaintChild(const RefPtr<RenderNode>& child, const Offset& offset)
{
if (!ShouldPaint(child)) {
LOGD("Node is not need to paint");
return;
}
auto pipelineContext = child->GetContext().Upgrade();
@@ -149,7 +147,6 @@ void RosenRenderContext::StopRecordingIfNeeded()
bool RosenRenderContext::IsIntersectWith(const RefPtr<RenderNode>& child, Offset& offset)
{
if (!ShouldPaint(child)) {
LOGD("Node is not need to paint");
return false;
}
@@ -168,7 +165,6 @@ bool RosenRenderContext::IsIntersectWith(const RefPtr<RenderNode>& child, Offset
void RosenRenderContext::InitContext(
const std::shared_ptr<RSNode>& rsNode, const Rect& rect, const Offset& initialOffset)
{
LOGD("InitContext with width %{public}lf height %{public}lf", rect.Width(), rect.Height());
rsNode_ = rsNode;
estimatedRect_ = rect + initialOffset;
if (rsNode_ == nullptr) {
@@ -23,13 +23,11 @@ namespace OHOS::Ace {
RefPtr<Element> SoleChildElement::Create()
{
LOGD("SoleChildElement::Create");
return AceType::MakeRefPtr<SoleChildElement>();
}
void SoleChildElement::PerformBuild()
{
LOGD("SoleChildElement::PerformBuild");
RefPtr<SoleChildComponent> component = AceType::DynamicCast<SoleChildComponent>(component_);
const auto& child = children_.empty() ? nullptr : children_.front();
UpdateChild(child, component->GetChild());
+1 -11
View File
@@ -511,7 +511,6 @@ void PipelineContext::FlushRender()
auto context = RenderContext::Create();
if (transparentHole_.IsValid()) {
LOGD("Hole: set transparentHole_ in FlushRender");
context->SetClipHole(transparentHole_);
}
if (!dirtyRenderNodes_.empty()) {
@@ -1156,11 +1155,8 @@ void PipelineContext::ScheduleUpdate(const RefPtr<ComposedComponent>& compose)
{
CHECK_RUN_ON(UI);
ComposeId id = compose->GetId();
LOGD("update compose for id:%{public}s", id.c_str());
const auto& it = composedElementMap_.find(id);
if (it == composedElementMap_.end()) {
LOGD("can't update composed for id:%{public}s, name:%{public}s", id.c_str(), compose->GetName().c_str());
} else {
if (it != composedElementMap_.end()) {
for (const auto& composedElement : it->second) {
composedElement->SetUpdateComponent(compose);
}
@@ -1171,7 +1167,6 @@ void PipelineContext::ScheduleUpdate(const RefPtr<ComposedComponent>& compose)
void PipelineContext::AddComposedElement(const ComposeId& id, const RefPtr<ComposedElement>& element)
{
CHECK_RUN_ON(UI);
LOGD("add new composed element id:%{public}s", id.c_str());
auto it = composedElementMap_.find(id);
if (it != composedElementMap_.end()) {
it->second.emplace_back(element);
@@ -1185,7 +1180,6 @@ void PipelineContext::AddComposedElement(const ComposeId& id, const RefPtr<Compo
void PipelineContext::RemoveComposedElement(const ComposeId& id, const RefPtr<ComposedElement>& element)
{
CHECK_RUN_ON(UI);
LOGD("remove composed element id:%{public}s", id.c_str());
auto it = composedElementMap_.find(id);
if (it != composedElementMap_.end()) {
it->second.remove(element);
@@ -1202,7 +1196,6 @@ void PipelineContext::AddDirtyElement(const RefPtr<Element>& dirtyElement)
LOGW("dirtyElement is null");
return;
}
LOGD("schedule rebuild for %{public}s", AceType::TypeName(dirtyElement));
dirtyElements_.emplace(dirtyElement);
hasIdleTasks_ = true;
window_->RequestFrame();
@@ -1230,7 +1223,6 @@ void PipelineContext::AddDirtyRenderNode(const RefPtr<RenderNode>& renderNode, b
LOGW("renderNode is null");
return;
}
LOGD("schedule render for %{public}s", AceType::TypeName(renderNode));
if (!overlay) {
dirtyRenderNodes_.emplace(renderNode);
} else {
@@ -1257,7 +1249,6 @@ void PipelineContext::AddDirtyLayoutNode(const RefPtr<RenderNode>& renderNode)
LOGW("renderNode is null");
return;
}
LOGD("schedule layout for %{public}s", AceType::TypeName(AceType::RawPtr(renderNode)));
renderNode->SaveExplicitAnimationOption(explicitAnimationOption_);
dirtyLayoutNodes_.emplace(renderNode);
ForceLayoutForImplicitAnimation();
@@ -1272,7 +1263,6 @@ void PipelineContext::AddPredictLayoutNode(const RefPtr<RenderNode>& renderNode)
LOGW("renderNode is null");
return;
}
LOGD("schedule predict layout for %{public}s", AceType::TypeName(renderNode));
predictLayoutNodes_.emplace(renderNode);
ForceLayoutForImplicitAnimation();
hasIdleTasks_ = true;