From d8c43d052f3adada8a8ad70e2241b135a5b8b4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=96=87=E9=9F=AC?= Date: Wed, 18 Dec 2024 14:23:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?trace=E7=82=B9=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡文韬 --- src/core/SkCanvas.cpp | 2 -- src/core/SkChromeRemoteGlyphCache.cpp | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index fe2d4bfb..511b8375 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2382,7 +2382,6 @@ void SkCanvas::onDrawGlyphRunList(const sktext::GlyphRunList& glyphRunList, cons #if (defined(SK_GANESH) || defined(SK_GRAPHITE)) sk_sp SkCanvas::convertBlobToSlug( const SkTextBlob& blob, SkPoint origin, const SkPaint& paint) { - TRACE_EVENT0("skia", TRACE_FUNC); auto glyphRunList = fScratchGlyphRunBuilder->blobToGlyphRunList(blob, origin); return this->onConvertGlyphRunListToSlug(glyphRunList, paint); } @@ -2499,7 +2498,6 @@ bool gSkBlobAsSlugTesting = false; void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint) { - TRACE_EVENT0("skia", TRACE_FUNC); RETURN_ON_NULL(blob); RETURN_ON_FALSE(blob->bounds().makeOffset(x, y).isFinite()); diff --git a/src/core/SkChromeRemoteGlyphCache.cpp b/src/core/SkChromeRemoteGlyphCache.cpp index 9ef89ccf..b542f9d2 100644 --- a/src/core/SkChromeRemoteGlyphCache.cpp +++ b/src/core/SkChromeRemoteGlyphCache.cpp @@ -665,17 +665,6 @@ void SkStrikeServerImpl::checkForDeletedEntries() { sk_sp SkStrikeServerImpl::getOrCreateCache(const SkStrikeSpec& strikeSpec) { // In cases where tracing is turned off, make sure not to get an unused function warning. // Lambdaize the function. - TRACE_EVENT1("skia", "RecForDesc", "rec", - TRACE_STR_COPY( - [&strikeSpec](){ - auto ptr = - strikeSpec.descriptor().findEntry(kRec_SkDescriptorTag, nullptr); - SkScalerContextRec rec; - std::memcpy((void*)&rec, ptr, sizeof(rec)); - return rec.dump(); - }().c_str() - ) - ); if (auto it = fDescToRemoteStrike.find(&strikeSpec.descriptor()); it != fDescToRemoteStrike.end()) -- Gitee From a07cefcb96291542fd68a4117e43c5ac2ac5e082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=96=87=E9=9F=AC?= Date: Thu, 19 Dec 2024 03:01:12 +0000 Subject: [PATCH 2/3] update src/core/SkCanvas.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡文韬 --- src/core/SkCanvas.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 511b8375..29af01e9 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2382,6 +2382,10 @@ void SkCanvas::onDrawGlyphRunList(const sktext::GlyphRunList& glyphRunList, cons #if (defined(SK_GANESH) || defined(SK_GRAPHITE)) sk_sp SkCanvas::convertBlobToSlug( const SkTextBlob& blob, SkPoint origin, const SkPaint& paint) { +#if defined(IS_OHOS) +#else + TRACE_EVENT0("skia", TRACE_FUNC); +#endif auto glyphRunList = fScratchGlyphRunBuilder->blobToGlyphRunList(blob, origin); return this->onConvertGlyphRunListToSlug(glyphRunList, paint); } @@ -2498,6 +2502,10 @@ bool gSkBlobAsSlugTesting = false; void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint) { +#if defined(IS_OHOS) +#else + TRACE_EVENT0("skia", TRACE_FUNC); +#endif RETURN_ON_NULL(blob); RETURN_ON_FALSE(blob->bounds().makeOffset(x, y).isFinite()); -- Gitee From 6a54891c639cecf469759b1775e0e66b5c3a6fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=96=87=E9=9F=AC?= Date: Thu, 19 Dec 2024 03:02:30 +0000 Subject: [PATCH 3/3] update src/core/SkChromeRemoteGlyphCache.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡文韬 --- src/core/SkChromeRemoteGlyphCache.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/core/SkChromeRemoteGlyphCache.cpp b/src/core/SkChromeRemoteGlyphCache.cpp index b542f9d2..1117c012 100644 --- a/src/core/SkChromeRemoteGlyphCache.cpp +++ b/src/core/SkChromeRemoteGlyphCache.cpp @@ -665,6 +665,20 @@ void SkStrikeServerImpl::checkForDeletedEntries() { sk_sp SkStrikeServerImpl::getOrCreateCache(const SkStrikeSpec& strikeSpec) { // In cases where tracing is turned off, make sure not to get an unused function warning. // Lambdaize the function. +#if defined(IS_OHOS) +#else + TRACE_EVENT1("skia", "RecForDesc", "rec", + TRACE_STR_COPY( + [&strikeSpec](){ + auto ptr = + strikeSpec.descriptor().findEntry(kRec_SkDescriptorTag, nullptr); + SkScalerContextRec rec; + std::memcpy((void*)&rec, ptr, sizeof(rec)); + return rec.dump(); + }().c_str() + ) + ); +#endif if (auto it = fDescToRemoteStrike.find(&strikeSpec.descriptor()); it != fDescToRemoteStrike.end()) -- Gitee