diff options
author | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
commit | 628590d7ec80e10a3fc24b1c18a1afb55cca10a8 (patch) | |
tree | 4b1c3f52d86d7fb53afbe9e9438468588fa489f8 /libs/hwui/renderthread/CacheManager.h | |
parent | b11b8ec3aec8bb42f2c07e1c5ac7942da293baa8 (diff) | |
parent | d2d3a20624d968199353ccf6ddbae6f3ac39c9af (diff) |
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
Diffstat (limited to 'libs/hwui/renderthread/CacheManager.h')
-rw-r--r-- | libs/hwui/renderthread/CacheManager.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/libs/hwui/renderthread/CacheManager.h b/libs/hwui/renderthread/CacheManager.h index 9a5a00fcf762..b009cc4f48f2 100644 --- a/libs/hwui/renderthread/CacheManager.h +++ b/libs/hwui/renderthread/CacheManager.h @@ -17,14 +17,13 @@ #ifndef CACHEMANAGER_H #define CACHEMANAGER_H +#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration #include <GrContext.h> +#endif #include <SkSurface.h> -#include <ui/DisplayInfo.h> #include <utils/String8.h> #include <vector> -#include "pipeline/skia/VectorDrawableAtlas.h" - namespace android { class Surface; @@ -42,41 +41,38 @@ class CacheManager { public: enum class TrimMemoryMode { Complete, UiHidden }; +#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration void configureContext(GrContextOptions* context, const void* identity, ssize_t size); +#endif void trimMemory(TrimMemoryMode mode); void trimStaleResources(); void dumpMemoryUsage(String8& log, const RenderState* renderState = nullptr); - sp<skiapipeline::VectorDrawableAtlas> acquireVectorDrawableAtlas(); - size_t getCacheSize() const { return mMaxResourceBytes; } size_t getBackgroundCacheSize() const { return mBackgroundResourceBytes; } + void onFrameCompleted(); private: friend class RenderThread; - explicit CacheManager(const DisplayInfo& display); + explicit CacheManager(); +#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration void reset(sk_sp<GrContext> grContext); +#endif void destroy(); const size_t mMaxSurfaceArea; +#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration sk_sp<GrContext> mGrContext; +#endif - int mMaxResources = 0; const size_t mMaxResourceBytes; const size_t mBackgroundResourceBytes; const size_t mMaxGpuFontAtlasBytes; const size_t mMaxCpuFontCacheBytes; const size_t mBackgroundCpuFontCacheBytes; - - struct PipelineProps { - const void* pipelineKey = nullptr; - size_t surfaceArea = 0; - }; - - sp<skiapipeline::VectorDrawableAtlas> mVectorDrawableAtlas; }; } /* namespace renderthread */ |