mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 09:10:54 +00:00
Drawing日志修改
Signed-off-by: yzj688 <yuzejun1@huawei.com>
This commit is contained in:
parent
bc9eb55a79
commit
f15cc6ec4c
@ -107,7 +107,7 @@ void SkiaColorFilter::SetColorFilter(const sk_sp<SkColorFilter>& filter)
|
||||
std::shared_ptr<Data> SkiaColorFilter::Serialize() const
|
||||
{
|
||||
if (filter_ == nullptr) {
|
||||
LOGD("SkiaColorFilter::Serialize, filter_ is nullptr!");
|
||||
LOGE("SkiaColorFilter::Serialize, filter_ is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ std::shared_ptr<Data> SkiaColorFilter::Serialize() const
|
||||
bool SkiaColorFilter::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaColorFilter::Deserialize, data is invalid!");
|
||||
LOGE("SkiaColorFilter::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ sk_sp<SkColorSpace> SkiaColorSpace::GetSkColorSpace() const
|
||||
std::shared_ptr<Data> SkiaColorSpace::Serialize() const
|
||||
{
|
||||
if (colorSpace_ == nullptr) {
|
||||
LOGD("SkiaColorSpace::Serialize, colorSpace_ is nullptr!");
|
||||
LOGE("SkiaColorSpace::Serialize, colorSpace_ is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ std::shared_ptr<Data> SkiaColorSpace::Serialize() const
|
||||
bool SkiaColorSpace::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaColorSpace::Deserialize, data is invalid!");
|
||||
LOGE("SkiaColorSpace::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -111,8 +111,8 @@ void SkiaData::SetSkData(const sk_sp<SkData>& data)
|
||||
std::shared_ptr<Data> SkiaData::Serialize() const
|
||||
{
|
||||
#ifdef ROSEN_OHOS
|
||||
if (skData_ == nullptr) {
|
||||
LOGD("SkiaData::Serialize, skData_ is nullptr!");
|
||||
if (skData_ == nullptr || skData_->isEmpty()) {
|
||||
LOGE("SkiaData::Serialize, skData_ is invalid!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ sk_sp<GrDirectContext> SkiaImage::GetGrContext() const
|
||||
std::shared_ptr<Data> SkiaImage::Serialize() const
|
||||
{
|
||||
if (skiaImage_ == nullptr) {
|
||||
LOGD("SkiaImage::Serialize, SkImage is nullptr!");
|
||||
LOGE("SkiaImage::Serialize, SkImage is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -577,18 +577,21 @@ std::shared_ptr<Data> SkiaImage::Serialize() const
|
||||
|
||||
auto context = as_IB(skiaImage_.get())->directContext();
|
||||
if (!as_IB(skiaImage_.get())->getROPixels(context, &bitmap)) {
|
||||
LOGD("SkiaImage::SerializeNoLazyImage SkImage getROPixels failed");
|
||||
LOGE("SkiaImage::SerializeNoLazyImage SkImage getROPixels failed");
|
||||
return nullptr;
|
||||
}
|
||||
SkPixmap pixmap;
|
||||
if (!bitmap.peekPixels(&pixmap)) {
|
||||
LOGD("SkiaImage::SerializeNoLazyImage SkImage peekPixels failed");
|
||||
LOGE("SkiaImage::SerializeNoLazyImage SkImage peekPixels failed");
|
||||
return nullptr;
|
||||
}
|
||||
size_t rb = pixmap.rowBytes();
|
||||
int32_t width = pixmap.width();
|
||||
int32_t height = pixmap.height();
|
||||
const void* addr = pixmap.addr();
|
||||
if (addr == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
size_t size = pixmap.computeByteSize();
|
||||
|
||||
writer.writeUInt(size);
|
||||
@ -618,7 +621,7 @@ std::shared_ptr<Data> SkiaImage::Serialize() const
|
||||
bool SkiaImage::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaImage::Deserialize, data is invalid!");
|
||||
LOGE("SkiaImage::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ void SkiaMaskFilter::SetSkMaskFilter(const sk_sp<SkMaskFilter>& filter)
|
||||
std::shared_ptr<Data> SkiaMaskFilter::Serialize() const
|
||||
{
|
||||
if (filter_ == nullptr) {
|
||||
LOGE("SkiaMaskFilter::Serialize, filter is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -51,7 +52,7 @@ std::shared_ptr<Data> SkiaMaskFilter::Serialize() const
|
||||
bool SkiaMaskFilter::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaMaskFilter::Deserialize, data is invalid!");
|
||||
LOGE("SkiaMaskFilter::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -469,6 +469,10 @@ bool SkiaPath::GetMatrix(bool forceClosed, float distance, Matrix* matrix, PathM
|
||||
|
||||
std::shared_ptr<Data> SkiaPath::Serialize() const
|
||||
{
|
||||
if (path_.isEmpty()) {
|
||||
LOGE("SkiaPath::Serialize, path is empty!");
|
||||
return nullptr;
|
||||
}
|
||||
SkBinaryWriteBuffer writer;
|
||||
writer.writePath(path_);
|
||||
size_t length = writer.bytesWritten();
|
||||
@ -481,7 +485,7 @@ std::shared_ptr<Data> SkiaPath::Serialize() const
|
||||
bool SkiaPath::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaPath::Deserialize, data is invalid!");
|
||||
LOGE("SkiaPath::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ void SkiaPathEffect::SetSkPathEffect(const sk_sp<SkPathEffect>& pathEffect)
|
||||
std::shared_ptr<Data> SkiaPathEffect::Serialize() const
|
||||
{
|
||||
if (pathEffect_ == nullptr) {
|
||||
LOGD("SkiaPathEffect::Serialize, pathEffect_ is nullptr!");
|
||||
LOGE("SkiaPathEffect::Serialize, pathEffect_ is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ std::shared_ptr<Data> SkiaPathEffect::Serialize() const
|
||||
bool SkiaPathEffect::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaPathEffect::Deserialize, data is invalid!");
|
||||
LOGE("SkiaPathEffect::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ const sk_sp<SkPicture> SkiaPicture::GetPicture() const
|
||||
std::shared_ptr<Data> SkiaPicture::Serialize() const
|
||||
{
|
||||
if (skiaPicture_ == nullptr) {
|
||||
LOGD("SkiaPicture::Serialize, SkPicture is nullptr!");
|
||||
LOGE("SkiaPicture::Serialize, SkPicture is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -44,6 +44,7 @@ std::shared_ptr<Data> SkiaPicture::Serialize() const
|
||||
bool SkiaPicture::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGE("SkiaPicture::Deserialize, data is nullptr!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,10 @@ void SkiaRegion::Clone(const Region& other)
|
||||
|
||||
std::shared_ptr<Data> SkiaRegion::Serialize() const
|
||||
{
|
||||
if (skRegion_ == nullptr || skRegion_->isEmpty()) {
|
||||
LOGE("SkiaRegion::Serialize, region is empty!");
|
||||
return nullptr;
|
||||
}
|
||||
SkBinaryWriteBuffer writer;
|
||||
writer.writeRegion(*skRegion_);
|
||||
size_t length = writer.bytesWritten();
|
||||
@ -142,7 +146,7 @@ std::shared_ptr<Data> SkiaRegion::Serialize() const
|
||||
bool SkiaRegion::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaRegion::Deserialize, data is invalid!");
|
||||
LOGE("SkiaRegion::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
SkReadBuffer reader(data->GetData(), data->GetSize());
|
||||
|
@ -274,7 +274,7 @@ void SkiaShaderEffect::SetSkShader(const sk_sp<SkShader>& skShader)
|
||||
std::shared_ptr<Data> SkiaShaderEffect::Serialize() const
|
||||
{
|
||||
if (shader_ == nullptr) {
|
||||
LOGD("SkiaShaderEffect::Serialize, shader_ is nullptr!");
|
||||
LOGE("SkiaShaderEffect::Serialize, shader_ is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ std::shared_ptr<Data> SkiaShaderEffect::Serialize() const
|
||||
bool SkiaShaderEffect::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaShaderEffect::Deserialize, data is invalid!");
|
||||
LOGE("SkiaShaderEffect::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
SkReadBuffer reader(data->GetData(), data->GetSize());
|
||||
|
@ -113,7 +113,7 @@ std::shared_ptr<TextBlob> SkiaTextBlob::MakeFromRSXform(const void* text, size_t
|
||||
std::shared_ptr<Data> SkiaTextBlob::Serialize(void* ctx) const
|
||||
{
|
||||
if (!skTextBlob_) {
|
||||
LOGD("skTextBlob nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("skTextBlob nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
SkSerialProcs procs;
|
||||
@ -123,7 +123,7 @@ std::shared_ptr<Data> SkiaTextBlob::Serialize(void* ctx) const
|
||||
auto data = std::make_shared<Data>();
|
||||
auto skiaData = data->GetImpl<SkiaData>();
|
||||
if (!skiaData) {
|
||||
LOGD("skiaData nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("skiaData nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
skiaData->SetSkData(skData);
|
||||
@ -137,7 +137,7 @@ std::shared_ptr<TextBlob> SkiaTextBlob::Deserialize(const void* data, size_t siz
|
||||
procs.fTypefaceCtx = ctx;
|
||||
sk_sp<SkTextBlob> skTextBlob = SkTextBlob::Deserialize(data, size, procs);
|
||||
if (!skTextBlob) {
|
||||
LOGD("skTextBlob nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("skTextBlob nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
std::shared_ptr<TextBlobImpl> textBlobImpl = std::make_shared<SkiaTextBlob>(skTextBlob);
|
||||
|
@ -252,7 +252,7 @@ std::shared_ptr<Typeface> SkiaTypeface::MakeFromName(const char familyName[], Fo
|
||||
sk_sp<SkData> SkiaTypeface::SerializeTypeface(SkTypeface* typeface, void* ctx)
|
||||
{
|
||||
if (!typeface) {
|
||||
LOGD("typeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("typeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
TextBlob::Context* textblobCtx = reinterpret_cast<TextBlob::Context*>(ctx);
|
||||
@ -268,7 +268,7 @@ sk_sp<SkData> SkiaTypeface::SerializeTypeface(SkTypeface* typeface, void* ctx)
|
||||
sk_sp<SkTypeface> SkiaTypeface::DeserializeTypeface(const void* data, size_t length, void* ctx)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("data nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("data nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -279,12 +279,12 @@ sk_sp<SkTypeface> SkiaTypeface::DeserializeTypeface(const void* data, size_t len
|
||||
}
|
||||
auto& typeface = textblobCtx->GetTypeface();
|
||||
if (typeface == nullptr) {
|
||||
LOGD("typeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("typeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
auto skiaTypeface = typeface->GetImpl<SkiaTypeface>();
|
||||
if (skiaTypeface == nullptr) {
|
||||
LOGD("skiaTypeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("skiaTypeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
auto skTypeface = skiaTypeface->GetSkTypeface();
|
||||
@ -294,14 +294,14 @@ sk_sp<SkTypeface> SkiaTypeface::DeserializeTypeface(const void* data, size_t len
|
||||
std::shared_ptr<Data> SkiaTypeface::Serialize() const
|
||||
{
|
||||
if (!skTypeface_) {
|
||||
LOGD("skTypeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("skTypeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
auto skData = skTypeface_->serialize(SkTypeface::SerializeBehavior::kDoIncludeData);
|
||||
auto data = std::make_shared<Data>();
|
||||
auto skiaData = data->GetImpl<SkiaData>();
|
||||
if (!skiaData) {
|
||||
LOGD("skiaData nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("skiaData nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
skiaData->SetSkData(skData);
|
||||
@ -313,7 +313,7 @@ std::shared_ptr<Typeface> SkiaTypeface::Deserialize(const void* data, size_t siz
|
||||
SkMemoryStream stream(data, size);
|
||||
auto skTypeface = SkTypeface::MakeDeserialize(&stream);
|
||||
if (!skTypeface) {
|
||||
LOGD("skTypeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("skTypeface nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
auto typefaceImpl = std::make_shared<SkiaTypeface>(skTypeface);
|
||||
|
@ -115,7 +115,7 @@ bool SkiaVertices::MakeCopy(VertexMode mode,
|
||||
std::shared_ptr<Data> SkiaVertices::Serialize() const
|
||||
{
|
||||
if (skiaVertices_ == nullptr) {
|
||||
LOGD("SkiaVertices::Serialize, SkVertices is nullptr!");
|
||||
LOGE("SkiaVertices::Serialize, SkVertices is nullptr!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ std::shared_ptr<Data> SkiaVertices::Serialize() const
|
||||
bool SkiaVertices::Deserialize(std::shared_ptr<Data> data)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
LOGD("SkiaVertices::Deserialize, data is invalid!");
|
||||
LOGE("SkiaVertices::Deserialize, data is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ OpDataHandle CmdListHelper::AddImageToCmdList(CmdList& cmdList, const Image& ima
|
||||
OpDataHandle CmdListHelper::AddImageToCmdList(CmdList& cmdList, const std::shared_ptr<Image>& image)
|
||||
{
|
||||
if (image == nullptr) {
|
||||
LOGD("image is nullptr!");
|
||||
LOGE("image is nullptr!");
|
||||
return { 0 };
|
||||
}
|
||||
return CmdListHelper::AddImageToCmdList(cmdList, *image);
|
||||
@ -80,7 +80,7 @@ OpDataHandle CmdListHelper::AddVerticesToCmdList(CmdList& cmdList, const Vertice
|
||||
{
|
||||
auto data = vertices.Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("vertices is valid!");
|
||||
LOGE("vertices is valid!");
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ std::shared_ptr<Vertices> CmdListHelper::GetVerticesFromCmdList(
|
||||
|
||||
const void* ptr = cmdList.GetImageData(opDataHandle.offset);
|
||||
if (ptr == nullptr) {
|
||||
LOGD("get vertices data failed!");
|
||||
LOGE("get vertices data failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ std::shared_ptr<Vertices> CmdListHelper::GetVerticesFromCmdList(
|
||||
verticesData->BuildWithoutCopy(ptr, opDataHandle.size);
|
||||
auto vertices = std::make_shared<Vertices>();
|
||||
if (vertices->Deserialize(verticesData) == false) {
|
||||
LOGD("vertices deserialize failed!");
|
||||
LOGE("vertices deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
return vertices;
|
||||
@ -117,7 +117,7 @@ ImageHandle CmdListHelper::AddBitmapToCmdList(CmdList& cmdList, const Bitmap& bi
|
||||
auto bpp = ColorTypeToBytesPerPixel(format.colorType);
|
||||
auto bitmapSize = bitmap.GetHeight() * bitmap.GetWidth() * bpp;
|
||||
if (bitmapSize == 0) {
|
||||
LOGD("bitmap is valid!");
|
||||
LOGE("bitmap is valid!");
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ std::shared_ptr<Bitmap> CmdListHelper::GetBitmapFromCmdList(const CmdList& cmdLi
|
||||
|
||||
const void* ptr = cmdList.GetBitmapData(bitmapHandle.offset);
|
||||
if (ptr == nullptr) {
|
||||
LOGD("get bitmap data failed!");
|
||||
LOGE("get bitmap data failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ OpDataHandle CmdListHelper::AddPictureToCmdList(CmdList& cmdList, const Picture&
|
||||
{
|
||||
auto data = picture.Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("picture is valid!");
|
||||
LOGE("picture is valid!");
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ std::shared_ptr<Picture> CmdListHelper::GetPictureFromCmdList(const CmdList& cmd
|
||||
|
||||
const void* ptr = cmdList.GetImageData(pictureHandle.offset);
|
||||
if (ptr == nullptr) {
|
||||
LOGD("get picture data failed!");
|
||||
LOGE("get picture data failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ std::shared_ptr<Picture> CmdListHelper::GetPictureFromCmdList(const CmdList& cmd
|
||||
pictureData->BuildWithoutCopy(ptr, pictureHandle.size);
|
||||
auto picture = std::make_shared<Picture>();
|
||||
if (picture->Deserialize(pictureData) == false) {
|
||||
LOGD("picture deserialize failed!");
|
||||
LOGE("picture deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
return picture;
|
||||
@ -220,7 +220,7 @@ std::shared_ptr<Picture> CmdListHelper::GetPictureFromCmdList(const CmdList& cmd
|
||||
OpDataHandle CmdListHelper::AddCompressDataToCmdList(CmdList& cmdList, const std::shared_ptr<Data>& data)
|
||||
{
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("data is valid!");
|
||||
LOGE("data is valid!");
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ std::shared_ptr<Data> CmdListHelper::GetCompressDataFromCmdList(const CmdList& c
|
||||
|
||||
const void* ptr = cmdList.GetImageData(imageHandle.offset);
|
||||
if (ptr == nullptr) {
|
||||
LOGD("get image data failed!");
|
||||
LOGE("get image data failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ OpDataHandle CmdListHelper::AddTextBlobToCmdList(CmdList& cmdList, const TextBlo
|
||||
}
|
||||
auto data = textBlob->Serialize(ctx);
|
||||
if (!data || data->GetSize() == 0) {
|
||||
LOGD("textBlob serialize invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("textBlob serialize invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ std::shared_ptr<TextBlob> CmdListHelper::GetTextBlobFromCmdList(const CmdList& c
|
||||
|
||||
const void* data = cmdList.GetImageData(textBlobHandle.offset);
|
||||
if (!data) {
|
||||
LOGD("textBlob data nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("textBlob data nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -453,13 +453,13 @@ std::shared_ptr<TextBlob> CmdListHelper::GetTextBlobFromCmdList(const CmdList& c
|
||||
OpDataHandle CmdListHelper::AddDataToCmdList(CmdList& cmdList, const Data* srcData)
|
||||
{
|
||||
if (!srcData) {
|
||||
LOGD("data nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("data nullptr, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
auto data = srcData->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("srcData is invalid!");
|
||||
LOGE("srcData is invalid!");
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -475,7 +475,7 @@ std::shared_ptr<Data> CmdListHelper::GetDataFromCmdList(const CmdList& cmdList,
|
||||
|
||||
const void* ptr = cmdList.GetImageData(imageHandle.offset);
|
||||
if (ptr == nullptr) {
|
||||
LOGD("get data failed!");
|
||||
LOGE("get data failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -488,7 +488,7 @@ OpDataHandle CmdListHelper::AddPathToCmdList(CmdList& cmdList, const Path& path)
|
||||
{
|
||||
auto data = path.Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("path is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("path is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -505,7 +505,7 @@ std::shared_ptr<Path> CmdListHelper::GetPathFromCmdList(const CmdList& cmdList,
|
||||
|
||||
const void* ptr = cmdList.GetImageData(pathHandle.offset);
|
||||
if (ptr == nullptr) {
|
||||
LOGD("get path data failed!");
|
||||
LOGE("get path data failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@ std::shared_ptr<Path> CmdListHelper::GetPathFromCmdList(const CmdList& cmdList,
|
||||
pathData->BuildWithoutCopy(ptr, pathHandle.size);
|
||||
auto path = std::make_shared<Path>();
|
||||
if (path->Deserialize(pathData) == false) {
|
||||
LOGD("path deserialize failed!");
|
||||
LOGE("path deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -524,7 +524,7 @@ OpDataHandle CmdListHelper::AddRegionToCmdList(CmdList& cmdList, const Region& r
|
||||
{
|
||||
auto data = region.Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("region is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("region is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -540,7 +540,7 @@ std::shared_ptr<Region> CmdListHelper::GetRegionFromCmdList(const CmdList& cmdLi
|
||||
|
||||
const void* ptr = cmdList.GetImageData(regionHandle.offset);
|
||||
if (ptr == nullptr) {
|
||||
LOGD("get region data failed!");
|
||||
LOGE("get region data failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ std::shared_ptr<Region> CmdListHelper::GetRegionFromCmdList(const CmdList& cmdLi
|
||||
regionData->BuildWithoutCopy(ptr, regionHandle.size);
|
||||
auto region = std::make_shared<Region>();
|
||||
if (region->Deserialize(regionData) == false) {
|
||||
LOGD("region deserialize failed!");
|
||||
LOGE("region deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -563,7 +563,7 @@ OpDataHandle CmdListHelper::AddColorSpaceToCmdList(CmdList& cmdList, const std::
|
||||
|
||||
auto data = colorSpace->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("colorSpace is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("colorSpace is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
@ -586,7 +586,7 @@ std::shared_ptr<ColorSpace> CmdListHelper::GetColorSpaceFromCmdList(const CmdLis
|
||||
colorSpaceData->BuildWithoutCopy(ptr, imageHandle.size);
|
||||
auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::REF_IMAGE);
|
||||
if (colorSpace->Deserialize(colorSpaceData) == false) {
|
||||
LOGD("colorSpace deserialize failed!");
|
||||
LOGE("colorSpace deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -609,7 +609,7 @@ FlattenableHandle CmdListHelper::AddShaderEffectToCmdList(CmdList& cmdList, std:
|
||||
}
|
||||
auto data = shaderEffect->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("shaderEffect is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("shaderEffect is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
auto offset = cmdList.AddImageData(data->GetData(), data->GetSize());
|
||||
@ -646,7 +646,7 @@ std::shared_ptr<ShaderEffect> CmdListHelper::GetShaderEffectFromCmdList(const Cm
|
||||
shaderEffectData->BuildWithoutCopy(ptr, shaderEffectHandle.size);
|
||||
auto shaderEffect = std::make_shared<ShaderEffect>(type);
|
||||
if (shaderEffect->Deserialize(shaderEffectData) == false) {
|
||||
LOGD("shaderEffect deserialize failed!");
|
||||
LOGE("shaderEffect deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -661,7 +661,7 @@ FlattenableHandle CmdListHelper::AddPathEffectToCmdList(CmdList& cmdList, std::s
|
||||
PathEffect::PathEffectType type = pathEffect->GetType();
|
||||
auto data = pathEffect->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("pathEffect is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("pathEffect is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
auto offset = cmdList.AddImageData(data->GetData(), data->GetSize());
|
||||
@ -685,7 +685,7 @@ std::shared_ptr<PathEffect> CmdListHelper::GetPathEffectFromCmdList(const CmdLis
|
||||
auto pathEffect = std::make_shared<PathEffect>
|
||||
(static_cast<PathEffect::PathEffectType>(pathEffectHandle.type));
|
||||
if (pathEffect->Deserialize(pathEffectData) == false) {
|
||||
LOGD("pathEffect deserialize failed!");
|
||||
LOGE("pathEffect deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -700,6 +700,7 @@ FlattenableHandle CmdListHelper::AddMaskFilterToCmdList(CmdList& cmdList, std::s
|
||||
MaskFilter::FilterType type = maskFilter->GetType();
|
||||
auto data = maskFilter->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGE("maskFilter is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
auto offset = cmdList.AddImageData(data->GetData(), data->GetSize());
|
||||
@ -723,7 +724,7 @@ std::shared_ptr<MaskFilter> CmdListHelper::GetMaskFilterFromCmdList(const CmdLis
|
||||
auto maskFilter = std::make_shared<MaskFilter>
|
||||
(static_cast<MaskFilter::FilterType>(maskFilterHandle.type));
|
||||
if (maskFilter->Deserialize(maskFilterData) == false) {
|
||||
LOGD("maskFilter deserialize failed!");
|
||||
LOGE("maskFilter deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -738,7 +739,7 @@ FlattenableHandle CmdListHelper::AddColorFilterToCmdList(CmdList& cmdList, std::
|
||||
ColorFilter::FilterType type = colorFilter->GetType();
|
||||
auto data = colorFilter->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("colorFilter is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
LOGE("colorFilter is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
auto offset = cmdList.AddImageData(data->GetData(), data->GetSize());
|
||||
@ -762,7 +763,7 @@ std::shared_ptr<ColorFilter> CmdListHelper::GetColorFilterFromCmdList(const CmdL
|
||||
auto colorFilter = std::make_shared<ColorFilter>
|
||||
(static_cast<ColorFilter::FilterType>(colorFilterHandle.type));
|
||||
if (colorFilter->Deserialize(colorFilterData) == false) {
|
||||
LOGD("colorFilter deserialize failed!");
|
||||
LOGE("colorFilter deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -777,6 +778,7 @@ FlattenableHandle CmdListHelper::AddImageFilterToCmdList(CmdList& cmdList, const
|
||||
ImageFilter::FilterType type = imageFilter->GetType();
|
||||
auto data = imageFilter->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGE("imageFilter is invalid, %{public}s, %{public}d", __FUNCTION__, __LINE__);
|
||||
return { 0 };
|
||||
}
|
||||
auto offset = cmdList.AddImageData(data->GetData(), data->GetSize());
|
||||
@ -806,7 +808,7 @@ std::shared_ptr<ImageFilter> CmdListHelper::GetImageFilterFromCmdList(const CmdL
|
||||
auto imageFilter = std::make_shared<ImageFilter>
|
||||
(static_cast<ImageFilter::FilterType>(imageFilterHandle.type));
|
||||
if (imageFilter->Deserialize(imageFilterData) == false) {
|
||||
LOGD("imageFilter deserialize failed!");
|
||||
LOGE("imageFilter deserialize failed!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -817,13 +819,13 @@ OpDataHandle CmdListHelper::AddBlurDrawLooperToCmdList(CmdList& cmdList,
|
||||
std::shared_ptr<BlurDrawLooper> blurDrawLooper)
|
||||
{
|
||||
if (blurDrawLooper == nullptr) {
|
||||
LOGD("blurDrawLooper is nullptr");
|
||||
LOGE("blurDrawLooper is nullptr");
|
||||
return { 0 };
|
||||
}
|
||||
|
||||
auto data = blurDrawLooper->Serialize();
|
||||
if (data == nullptr || data->GetSize() == 0) {
|
||||
LOGD("blurDrawLooper serialize failed!");
|
||||
LOGE("blurDrawLooper serialize failed!");
|
||||
return { 0 };
|
||||
}
|
||||
auto offset = cmdList.AddImageData(data->GetData(), data->GetSize());
|
||||
|
Loading…
Reference in New Issue
Block a user