summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2021-01-13 22:39:32 -0500
committerJohn Reck <jreck@google.com>2021-01-14 03:55:58 +0000
commitbe67195c44163c03d88af43b9d58b7e22139c0a9 (patch)
tree07d5f55ece853636eea9d7273b84fc2d7080dd2b /libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
parent844516c4946fa200afab9575cb154a962779b74f (diff)
Convert DisplayList to a value-type wrapper
Make DisplayList its own type instead of an alias, pushing the Skia aspect behind it mostly. Removes a bunch of manual memory management and opens the door to DisplayList being a union type with multiple implementations Test: builds (somehow), boots, hwuiunit passes, CtsUiRendering passes Change-Id: I1d7806aa3afc5d9ece08b06959920078a5814c59
Diffstat (limited to 'libs/hwui/pipeline/skia/RenderNodeDrawable.cpp')
-rw-r--r--libs/hwui/pipeline/skia/RenderNodeDrawable.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
index 1473b3e5abb7..070a765cf7ca 100644
--- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
+++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
@@ -61,12 +61,11 @@ void RenderNodeDrawable::drawBackwardsProjectedNodes(SkCanvas* canvas,
SkAutoCanvasRestore acr(canvas, true);
SkMatrix nodeMatrix;
mat4 hwuiMatrix(child.getRecordedMatrix());
- auto childNode = child.getRenderNode();
+ const RenderNode* childNode = child.getRenderNode();
childNode->applyViewPropertyTransforms(hwuiMatrix);
hwuiMatrix.copyTo(nodeMatrix);
canvas->concat(nodeMatrix);
- SkiaDisplayList* childDisplayList = static_cast<SkiaDisplayList*>(
- (const_cast<DisplayList*>(childNode->getDisplayList())));
+ const SkiaDisplayList* childDisplayList = childNode->getDisplayList().asSkiaDl();
if (childDisplayList) {
drawBackwardsProjectedNodes(canvas, *childDisplayList, nestLevel + 1);
}
@@ -144,7 +143,7 @@ void RenderNodeDrawable::forceDraw(SkCanvas* canvas) const {
return;
}
- SkiaDisplayList* displayList = (SkiaDisplayList*)renderNode->getDisplayList();
+ SkiaDisplayList* displayList = renderNode->getDisplayList().asSkiaDl();
SkAutoCanvasRestore acr(canvas, true);
const RenderProperties& properties = this->getNodeProperties();
@@ -213,14 +212,14 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const {
if (mComposeLayer) {
setViewProperties(properties, canvas, &alphaMultiplier);
}
- SkiaDisplayList* displayList = (SkiaDisplayList*)mRenderNode->getDisplayList();
+ SkiaDisplayList* displayList = mRenderNode->getDisplayList().asSkiaDl();
displayList->mParentMatrix = canvas->getTotalMatrix();
// TODO should we let the bound of the drawable do this for us?
const SkRect bounds = SkRect::MakeWH(properties.getWidth(), properties.getHeight());
bool quickRejected = properties.getClipToBounds() && canvas->quickReject(bounds);
if (!quickRejected) {
- SkiaDisplayList* displayList = (SkiaDisplayList*)renderNode->getDisplayList();
+ SkiaDisplayList* displayList = renderNode->getDisplayList().asSkiaDl();
const LayerProperties& layerProperties = properties.layerProperties();
// composing a hardware layer
if (renderNode->getLayerSurface() && mComposeLayer) {