From 2d60fb09e07fcf932b0f2f586af2c9efeb31ff7a Mon Sep 17 00:00:00 2001 From: lixin Date: Wed, 10 May 2023 10:06:34 +0800 Subject: [PATCH] first push and second Signed-off-by: lixin Change-Id: I3716cc11038a7a3c80ef05b76e8f977cca4c5ab4 --- README.md | 2 +- include/gpu/GrConfig.h | 2 +- include/gpu/GrDirectContext.h | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d104781bd3..757cc9e286 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. +arong Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org. diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h index 9fe6629dd7..2712549ba3 100644 --- a/include/gpu/GrConfig.h +++ b/include/gpu/GrConfig.h @@ -14,7 +14,7 @@ /** * Gr defines are set to 0 or 1, rather than being undefined or defined */ - +#define SK_DUMP_STATS // open dump #if !defined(GR_CACHE_STATS) #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) #define GR_CACHE_STATS 1 diff --git a/include/gpu/GrDirectContext.h b/include/gpu/GrDirectContext.h index 4ff25b0f5f..e9b194c3fc 100644 --- a/include/gpu/GrDirectContext.h +++ b/include/gpu/GrDirectContext.h @@ -8,9 +8,12 @@ #ifndef GrDirectContext_DEFINED #define GrDirectContext_DEFINED +#include + #include "include/gpu/GrRecordingContext.h" #include "include/gpu/GrBackendSurface.h" +#include "src/gpu/GrGpuResource.h" // We shouldn't need this but currently Android is relying on this being include transitively. #include "include/core/SkUnPreMultiply.h" @@ -282,6 +285,7 @@ public: * resource types. */ void purgeUnlockedResources(size_t bytesToPurge, bool preferScratchResources); + void purgeUnlockedResourcesByTag(bool scratchResourcesOnly, const GrGpuResourceTag tag); /** * This entry point is intended for instances where an app has been backgrounded or @@ -405,6 +409,7 @@ public: /** Enumerates all cached GPU resources and dumps their memory to traceMemoryDump. */ // Chrome is using this! void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const; + void dumpMemoryStatisticsByTag(SkTraceMemoryDump* traceMemoryDump, GrGpuResourceTag tag) const; bool supportsDistanceFieldText() const; -- Gitee