!2632 统一渲染支持快速启动窗口(StartingWindow)

Merge pull request !2632 from 赵路/master
This commit is contained in:
openharmony_ci 2022-08-29 03:05:36 +00:00 committed by Gitee
commit c54e9efeea
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
12 changed files with 27 additions and 23 deletions

View File

@ -35,9 +35,10 @@ public:
virtual int32_t GetFocusWindow(sptr<IRemoteObject>& abilityToken) = 0;
virtual void StartingWindow(sptr<AbilityTransitionInfo> info, sptr<Media::PixelMap> pixelMap, uint32_t bgColor) = 0;
virtual void StartingWindow(sptr<AbilityTransitionInfo> info,
std::shared_ptr<Media::PixelMap> pixelMap, uint32_t bgColor) = 0;
virtual void StartingWindow(sptr<AbilityTransitionInfo> info, sptr<Media::PixelMap> pixelMap) = 0;
virtual void StartingWindow(sptr<AbilityTransitionInfo> info, std::shared_ptr<Media::PixelMap> pixelMap) = 0;
virtual void CancelStartingWindow(sptr<IRemoteObject> abilityToken) = 0;

View File

@ -32,10 +32,10 @@ public:
virtual int32_t GetFocusWindow(sptr<IRemoteObject>& abilityToken) override;
virtual void StartingWindow(sptr<AbilityTransitionInfo> info, sptr<Media::PixelMap> pixelMap,
virtual void StartingWindow(sptr<AbilityTransitionInfo> info, std::shared_ptr<Media::PixelMap> pixelMap,
uint32_t bgColor) override;
virtual void StartingWindow(sptr<AbilityTransitionInfo> info, sptr<Media::PixelMap> pixelMap) override;
virtual void StartingWindow(sptr<AbilityTransitionInfo> info, std::shared_ptr<Media::PixelMap> pixelMap) override;
virtual void CancelStartingWindow(sptr<IRemoteObject> abilityToken) override;

View File

@ -73,8 +73,8 @@ int32_t WindowManagerServiceHandlerProxy::GetFocusWindow(sptr<IRemoteObject>& ab
return ret;
}
void WindowManagerServiceHandlerProxy::StartingWindow(sptr<AbilityTransitionInfo> info, sptr<Media::PixelMap> pixelMap,
uint32_t bgColor)
void WindowManagerServiceHandlerProxy::StartingWindow(sptr<AbilityTransitionInfo> info,
std::shared_ptr<Media::PixelMap> pixelMap, uint32_t bgColor)
{
HILOG_DEBUG("%{public}s is called.", __func__);
MessageParcel data;
@ -86,7 +86,7 @@ void WindowManagerServiceHandlerProxy::StartingWindow(sptr<AbilityTransitionInfo
HILOG_ERROR("Write info failed.");
return;
}
if (!data.WriteParcelable(pixelMap.GetRefPtr())) {
if (!data.WriteParcelable(pixelMap.get())) {
HILOG_ERROR("Write pixelMap failed.");
return;
}
@ -102,7 +102,8 @@ void WindowManagerServiceHandlerProxy::StartingWindow(sptr<AbilityTransitionInfo
}
}
void WindowManagerServiceHandlerProxy::StartingWindow(sptr<AbilityTransitionInfo> info, sptr<Media::PixelMap> pixelMap)
void WindowManagerServiceHandlerProxy::StartingWindow(sptr<AbilityTransitionInfo> info,
std::shared_ptr<Media::PixelMap> pixelMap)
{
HILOG_DEBUG("%{public}s is called.", __func__);
MessageParcel data;
@ -114,7 +115,7 @@ void WindowManagerServiceHandlerProxy::StartingWindow(sptr<AbilityTransitionInfo
HILOG_ERROR("Write info failed.");
return;
}
if (!data.WriteParcelable(pixelMap.GetRefPtr())) {
if (!data.WriteParcelable(pixelMap.get())) {
HILOG_ERROR("Write pixelMap failed.");
return;
}

View File

@ -111,8 +111,9 @@ int WindowManagerServiceHandlerStub::StartingWindowCold(MessageParcel &data, Mes
HILOG_ERROR("To read info failed.");
return ERR_AAFWK_PARCEL_FAIL;
}
sptr<Media::PixelMap> pixelMap(data.ReadParcelable<Media::PixelMap>());
if (!pixelMap) {
std::shared_ptr<Media::PixelMap> pixelMap
= std::shared_ptr<Media::PixelMap>(data.ReadParcelable<Media::PixelMap>());
if (pixelMap == nullptr) {
HILOG_ERROR("To read pixelMap failed.");
return ERR_AAFWK_PARCEL_FAIL;
}
@ -129,8 +130,9 @@ int WindowManagerServiceHandlerStub::StartingWindowHot(MessageParcel &data, Mess
HILOG_ERROR("To read info failed.");
return ERR_AAFWK_PARCEL_FAIL;
}
sptr<Media::PixelMap> pixelMap(data.ReadParcelable<Media::PixelMap>());
if (!pixelMap) {
std::shared_ptr<Media::PixelMap> pixelMap
= std::shared_ptr<Media::PixelMap>(data.ReadParcelable<Media::PixelMap>());
if (pixelMap == nullptr) {
HILOG_ERROR("To read pixelMap failed.");
return ERR_AAFWK_PARCEL_FAIL;
}

View File

@ -868,7 +868,7 @@ private:
const std::shared_ptr<Want> &want, const AbilityRequest &abilityRequest);
std::shared_ptr<Global::Resource::ResourceManager> CreateResourceManager(
const AppExecFwk::AbilityInfo &abilityInfo) const;
sptr<Media::PixelMap> GetPixelMap(const uint32_t windowIconId,
std::shared_ptr<Media::PixelMap> GetPixelMap(const uint32_t windowIconId,
std::shared_ptr<Global::Resource::ResourceManager> resourceMgr) const;
void StartingWindowHot(const std::shared_ptr<StartOptions> &startOptions, const std::shared_ptr<Want> &want,
const AbilityRequest &abilityRequest);

View File

@ -99,7 +99,7 @@ public:
* @param missionId Indicates this mission id.
* @return Returns PixelMap of snapshot.
*/
sptr<Media::PixelMap> GetSnapshot(int missionId, bool isLowResolution = false) const;
std::shared_ptr<Media::PixelMap> GetSnapshot(int missionId, bool isLowResolution = false) const;
std::unique_ptr<Media::PixelMap> GetPixelMap(int missionId, bool isLowResolution) const;
#endif

View File

@ -149,7 +149,7 @@ public:
* @param missionId Indicates this mission id.
* @return Returns PixelMap of snapshot.
*/
sptr<Media::PixelMap> GetSnapshot(int32_t missionId) const;
std::shared_ptr<Media::PixelMap> GetSnapshot(int32_t missionId) const;
#endif
/**

View File

@ -82,7 +82,7 @@ public:
* @param missionId Indicates this mission id.
* @return Returns PixelMap of snapshot.
*/
sptr<Media::PixelMap> GetSnapshot(int missionId) const;
std::shared_ptr<Media::PixelMap> GetSnapshot(int missionId) const;
#endif
/**

View File

@ -613,7 +613,7 @@ std::shared_ptr<Global::Resource::ResourceManager> AbilityRecord::CreateResource
return resourceMgr;
}
sptr<Media::PixelMap> AbilityRecord::GetPixelMap(const uint32_t windowIconId,
std::shared_ptr<Media::PixelMap> AbilityRecord::GetPixelMap(const uint32_t windowIconId,
std::shared_ptr<Global::Resource::ResourceManager> resourceMgr) const
{
std::string iconPath;
@ -639,7 +639,7 @@ sptr<Media::PixelMap> AbilityRecord::GetPixelMap(const uint32_t windowIconId,
return nullptr;
}
HILOG_DEBUG("%{public}s OUT.", __func__);
return sptr<Media::PixelMap>(pixelMapPtr.release());
return std::shared_ptr<Media::PixelMap>(pixelMapPtr.release());
}
sptr<AbilityTransitionInfo> AbilityRecord::CreateAbilityTransitionInfo(

View File

@ -342,14 +342,14 @@ void MissionDataStorage::DeleteMissionSnapshot(int32_t missionId, bool isLowReso
}
}
sptr<Media::PixelMap> MissionDataStorage::GetSnapshot(int missionId, bool isLowResolution) const
std::shared_ptr<Media::PixelMap> MissionDataStorage::GetSnapshot(int missionId, bool isLowResolution) const
{
auto pixelMapPtr = GetPixelMap(missionId, isLowResolution);
if (!pixelMapPtr) {
HILOG_ERROR("%{public}s: GetPixelMap failed.", __func__);
return nullptr;
}
return sptr<Media::PixelMap>(pixelMapPtr.release());
return std::shared_ptr<Media::PixelMap>(pixelMapPtr.release());
}
std::unique_ptr<Media::PixelMap> MissionDataStorage::GetPixelMap(int missionId, bool isLowResolution) const

View File

@ -464,7 +464,7 @@ bool MissionInfoMgr::UpdateMissionSnapshot(int32_t missionId, const sptr<IRemote
}
#ifdef SUPPORT_GRAPHICS
sptr<Media::PixelMap> MissionInfoMgr::GetSnapshot(int32_t missionId) const
std::shared_ptr<Media::PixelMap> MissionInfoMgr::GetSnapshot(int32_t missionId) const
{
HILOG_INFO("mission_list_info GetSnapshot, missionId:%{public}d", missionId);
auto it = find_if(missionInfoList_.begin(), missionInfoList_.end(), [missionId](const InnerMissionInfo &info) {

View File

@ -140,7 +140,7 @@ bool TaskDataPersistenceMgr::SaveMissionSnapshot(int missionId, const MissionSna
}
#ifdef SUPPORT_GRAPHICS
sptr<Media::PixelMap> TaskDataPersistenceMgr::GetSnapshot(int missionId) const
std::shared_ptr<Media::PixelMap> TaskDataPersistenceMgr::GetSnapshot(int missionId) const
{
if (!currentMissionDataStorage_) {
HILOG_ERROR("snapshot: currentMissionDataStorage_ is nullptr");