Add missing getter & improve docs
Also fix SkiaDisplayList::getUsedSize()
Bug: 120865963
Test: atest android.uirendering.cts.testclasses.RenderNodeTests
Change-Id: I3cdbd8d330da9a00367199087c9ae1e0a2cacf46
diff --git a/libs/hwui/RecordingCanvas.h b/libs/hwui/RecordingCanvas.h
index 35cf707..de8777b 100644
--- a/libs/hwui/RecordingCanvas.h
+++ b/libs/hwui/RecordingCanvas.h
@@ -65,6 +65,7 @@
void applyColorTransform(ColorTransform transform);
bool hasText() const { return mHasText; }
+ size_t usedSize() const { return fUsed; }
private:
friend class RecordingCanvas;
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 04379ae..ddb7e4e 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -98,15 +98,15 @@
LayerProperties& operator=(const LayerProperties& other);
+ // Strongly recommend using effectiveLayerType instead
+ LayerType type() const { return mType; }
+
private:
LayerProperties();
~LayerProperties();
void reset();
bool setColorFilter(SkColorFilter* filter);
- // Private since external users should go through properties().effectiveLayerType()
- LayerType type() const { return mType; }
-
friend class RenderProperties;
LayerType mType = LayerType::None;
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.h b/libs/hwui/pipeline/skia/SkiaDisplayList.h
index d7879e7..45f3a4c 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.h
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.h
@@ -49,7 +49,7 @@
*/
class SkiaDisplayList {
public:
- size_t getUsedSize() { return allocator.usedSize(); }
+ size_t getUsedSize() { return allocator.usedSize() + mDisplayList.usedSize(); }
~SkiaDisplayList() {
/* Given that we are using a LinearStdAllocator to store some of the