blob: 1bfa046eff6327b6dfe9feb98fc9fd80929a9b26 [file] [log] [blame]
Chris Craikb565df12015-10-05 13:00:52 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Chris Craik5e00c7c2016-07-06 16:10:09 -070016
17#pragma once
Chris Craikb565df12015-10-05 13:00:52 -070018
Chris Craik76caecf2015-11-02 19:17:45 -080019#include <DeviceInfo.h>
Chris Craik161f54b2015-11-05 11:08:52 -080020#include <DisplayList.h>
Chris Craikb565df12015-10-05 13:00:52 -070021#include <Matrix.h>
Greg Daniel98c78dad2017-01-04 14:45:56 -050022#include <Properties.h>
Chris Craik0a24b142015-10-19 17:10:19 -070023#include <Rect.h>
Chris Craikb565df12015-10-05 13:00:52 -070024#include <RenderNode.h>
John Reck1bcacfd2017-11-03 10:12:19 -070025#include <Snapshot.h>
sergeyvc1c54062016-10-19 18:47:26 -070026#include <hwui/Bitmap.h>
Stan Iliev500a0c32016-10-26 10:30:09 -040027#include <pipeline/skia/SkiaRecordingCanvas.h>
Chris Craik0a24b142015-10-19 17:10:19 -070028#include <renderstate/RenderState.h>
29#include <renderthread/RenderThread.h>
Chris Craikb565df12015-10-05 13:00:52 -070030
Chris Craik161f54b2015-11-05 11:08:52 -080031#include <RecordedOp.h>
John Reck16c9d6a2015-11-17 15:51:08 -080032#include <RecordingCanvas.h>
Chris Craik161f54b2015-11-05 11:08:52 -080033
Chris Craikb565df12015-10-05 13:00:52 -070034#include <memory>
35
36namespace android {
37namespace uirenderer {
38
John Reck1bcacfd2017-11-03 10:12:19 -070039#define EXPECT_MATRIX_APPROX_EQ(a, b) EXPECT_TRUE(TestUtils::matricesAreApproxEqual(a, b))
Chris Craikb565df12015-10-05 13:00:52 -070040
John Reck1bcacfd2017-11-03 10:12:19 -070041#define EXPECT_RECT_APPROX_EQ(a, b) \
42 EXPECT_TRUE(MathUtils::areEqual((a).left, (b).left) && \
43 MathUtils::areEqual((a).top, (b).top) && \
44 MathUtils::areEqual((a).right, (b).right) && \
45 MathUtils::areEqual((a).bottom, (b).bottom));
Chris Craik6fe991e52015-10-20 09:39:42 -070046
John Reck1bcacfd2017-11-03 10:12:19 -070047#define EXPECT_CLIP_RECT(expRect, clipStatePtr) \
48 EXPECT_NE(nullptr, (clipStatePtr)) << "Op is unclipped"; \
49 if ((clipStatePtr)->mode == ClipMode::Rectangle) { \
50 EXPECT_EQ((expRect), reinterpret_cast<const ClipRect*>(clipStatePtr)->rect); \
51 } else { \
52 ADD_FAILURE() << "ClipState not a rect"; \
53 }
Greg Daniel98c78dad2017-01-04 14:45:56 -050054
55#define INNER_PIPELINE_TEST(test_case_name, test_name, pipeline, functionCall) \
John Reck1bcacfd2017-11-03 10:12:19 -070056 TEST(test_case_name, test_name##_##pipeline) { \
57 RenderPipelineType oldType = Properties::getRenderPipelineType(); \
58 Properties::overrideRenderPipelineType(RenderPipelineType::pipeline); \
59 functionCall; \
60 Properties::overrideRenderPipelineType(oldType); \
Greg Daniel98c78dad2017-01-04 14:45:56 -050061 };
62
63/**
64 * Like gtests' TEST, but only runs with the OpenGL RenderPipelineType
65 */
John Reck1bcacfd2017-11-03 10:12:19 -070066#define OPENGL_PIPELINE_TEST(test_case_name, test_name) \
67 class test_case_name##_##test_name##_HwuiTest { \
68 public: \
69 static void doTheThing(); \
70 }; \
71 INNER_PIPELINE_TEST(test_case_name, test_name, OpenGL, \
72 test_case_name##_##test_name##_HwuiTest::doTheThing()) \
Greg Daniel98c78dad2017-01-04 14:45:56 -050073 void test_case_name##_##test_name##_HwuiTest::doTheThing()
74
75#define INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, pipeline) \
John Reck1bcacfd2017-11-03 10:12:19 -070076 INNER_PIPELINE_TEST(test_case_name, test_name, pipeline, \
77 TestUtils::runOnRenderThread( \
78 test_case_name##_##test_name##_RenderThreadTest::doTheThing))
Greg Daniel98c78dad2017-01-04 14:45:56 -050079
Chris Craik98787e62015-11-13 10:55:30 -080080/**
81 * Like gtest's TEST, but runs on the RenderThread, and 'renderThread' is passed, in top level scope
82 * (for e.g. accessing its RenderState)
83 */
John Reck1bcacfd2017-11-03 10:12:19 -070084#define RENDERTHREAD_TEST(test_case_name, test_name) \
85 class test_case_name##_##test_name##_RenderThreadTest { \
86 public: \
87 static void doTheThing(renderthread::RenderThread& renderThread); \
88 }; \
89 INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, OpenGL); \
90 INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaGL); \
Derek Sollenberger0f895392017-04-27 11:30:20 -040091 /* Temporarily disabling Vulkan until we can figure out a way to stub out the driver */ \
John Reck1bcacfd2017-11-03 10:12:19 -070092 /* INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); */ \
93 void test_case_name##_##test_name##_RenderThreadTest::doTheThing( \
94 renderthread::RenderThread& renderThread)
Greg Daniel98c78dad2017-01-04 14:45:56 -050095
96/**
97 * Like RENDERTHREAD_TEST, but only runs with the OpenGL RenderPipelineType
98 */
John Reck1bcacfd2017-11-03 10:12:19 -070099#define RENDERTHREAD_OPENGL_PIPELINE_TEST(test_case_name, test_name) \
100 class test_case_name##_##test_name##_RenderThreadTest { \
101 public: \
Greg Daniel98c78dad2017-01-04 14:45:56 -0500102 static void doTheThing(renderthread::RenderThread& renderThread); \
John Reck1bcacfd2017-11-03 10:12:19 -0700103 }; \
104 INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, OpenGL); \
105 void test_case_name##_##test_name##_RenderThreadTest::doTheThing( \
106 renderthread::RenderThread& renderThread)
Greg Daniel98c78dad2017-01-04 14:45:56 -0500107
108/**
109 * Like RENDERTHREAD_TEST, but only runs with the Skia RenderPipelineTypes
110 */
John Reck1bcacfd2017-11-03 10:12:19 -0700111#define RENDERTHREAD_SKIA_PIPELINE_TEST(test_case_name, test_name) \
112 class test_case_name##_##test_name##_RenderThreadTest { \
113 public: \
114 static void doTheThing(renderthread::RenderThread& renderThread); \
115 }; \
116 INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaGL); \
Derek Sollenberger0f895392017-04-27 11:30:20 -0400117 /* Temporarily disabling Vulkan until we can figure out a way to stub out the driver */ \
John Reck1bcacfd2017-11-03 10:12:19 -0700118 /* INNER_PIPELINE_RENDERTHREAD_TEST(test_case_name, test_name, SkiaVulkan); */ \
119 void test_case_name##_##test_name##_RenderThreadTest::doTheThing( \
120 renderthread::RenderThread& renderThread)
Chris Craik98787e62015-11-13 10:55:30 -0800121
Chris Craik37413282016-05-12 17:48:51 -0700122/**
123 * Sets a property value temporarily, generally for the duration of a test, restoring the previous
124 * value when going out of scope.
125 *
126 * Can be used e.g. to test behavior only active while Properties::debugOverdraw is enabled.
127 */
128template <typename T>
129class ScopedProperty {
130public:
John Reck1bcacfd2017-11-03 10:12:19 -0700131 ScopedProperty(T& property, T newValue) : mPropertyPtr(&property), mOldValue(property) {
Chris Craik37413282016-05-12 17:48:51 -0700132 property = newValue;
133 }
John Reck1bcacfd2017-11-03 10:12:19 -0700134 ~ScopedProperty() { *mPropertyPtr = mOldValue; }
135
Chris Craik37413282016-05-12 17:48:51 -0700136private:
137 T* mPropertyPtr;
138 T mOldValue;
139};
140
Chris Craikb565df12015-10-05 13:00:52 -0700141class TestUtils {
142public:
Chris Craik76ace112015-10-29 12:46:19 -0700143 class SignalingDtor {
144 public:
John Reck1bcacfd2017-11-03 10:12:19 -0700145 SignalingDtor() : mSignal(nullptr) {}
146 explicit SignalingDtor(int* signal) : mSignal(signal) {}
147 void setSignal(int* signal) { mSignal = signal; }
Chris Craik76ace112015-10-29 12:46:19 -0700148 ~SignalingDtor() {
149 if (mSignal) {
150 (*mSignal)++;
151 }
152 }
John Reck1bcacfd2017-11-03 10:12:19 -0700153
Chris Craik76ace112015-10-29 12:46:19 -0700154 private:
155 int* mSignal;
156 };
157
John Reck2de950d2017-01-25 10:58:30 -0800158 class MockTreeObserver : public TreeObserver {
159 public:
160 virtual void onMaybeRemovedFromTree(RenderNode* node) {}
161 };
162
Chris Craikb565df12015-10-05 13:00:52 -0700163 static bool matricesAreApproxEqual(const Matrix4& a, const Matrix4& b) {
164 for (int i = 0; i < 16; i++) {
165 if (!MathUtils::areEqual(a[i], b[i])) {
166 return false;
167 }
168 }
169 return true;
170 }
171
172 static std::unique_ptr<Snapshot> makeSnapshot(const Matrix4& transform, const Rect& clip) {
173 std::unique_ptr<Snapshot> snapshot(new Snapshot());
Mike Reed6e49c9f2016-12-02 15:36:59 -0500174 // store clip first, so it isn't transformed
175 snapshot->setClip(clip.left, clip.top, clip.right, clip.bottom);
Chris Craikb565df12015-10-05 13:00:52 -0700176 *(snapshot->transform) = transform;
177 return snapshot;
178 }
179
sergeyvaed7f582016-10-14 16:30:21 -0700180 static sk_sp<Bitmap> createBitmap(int width, int height,
John Reck1bcacfd2017-11-03 10:12:19 -0700181 SkColorType colorType = kN32_SkColorType) {
sergeyvaed7f582016-10-14 16:30:21 -0700182 SkImageInfo info = SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType);
sergeyvfc9999502016-10-17 13:07:38 -0700183 return Bitmap::allocateHeapBitmap(info);
sergeyvaed7f582016-10-14 16:30:21 -0700184 }
185
186 static sk_sp<Bitmap> createBitmap(int width, int height, SkBitmap* outBitmap) {
187 SkImageInfo info = SkImageInfo::Make(width, height, kN32_SkColorType, kPremul_SkAlphaType);
188 outBitmap->setInfo(info);
Leon Scroggins IIIf51a80d2017-07-12 10:46:35 -0400189 return Bitmap::allocateHeapBitmap(outBitmap);
sergeyvaed7f582016-10-14 16:30:21 -0700190 }
191
Chris Craikd2dfd8f2015-12-16 14:27:20 -0800192 static sp<DeferredLayerUpdater> createTextureLayerUpdater(
Greg Daniel98c78dad2017-01-04 14:45:56 -0500193 renderthread::RenderThread& renderThread);
194
195 static sp<DeferredLayerUpdater> createTextureLayerUpdater(
Chris Craikd2dfd8f2015-12-16 14:27:20 -0800196 renderthread::RenderThread& renderThread, uint32_t width, uint32_t height,
Chris Craik243e85b2016-03-25 15:26:11 -0700197 const SkMatrix& transform);
Chris Craikd2dfd8f2015-12-16 14:27:20 -0800198
John Reck1bcacfd2017-11-03 10:12:19 -0700199 template <class CanvasType>
200 static std::unique_ptr<DisplayList> createDisplayList(
201 int width, int height, std::function<void(CanvasType& canvas)> canvasCallback) {
Chris Craikb565df12015-10-05 13:00:52 -0700202 CanvasType canvas(width, height);
203 canvasCallback(canvas);
Chris Craik003cc3d2015-10-16 10:24:55 -0700204 return std::unique_ptr<DisplayList>(canvas.finishRecording());
Chris Craikb565df12015-10-05 13:00:52 -0700205 }
206
John Reck1bcacfd2017-11-03 10:12:19 -0700207 static sp<RenderNode> createNode(
208 int left, int top, int right, int bottom,
Stan Iliev06152cd2016-07-27 17:55:43 -0400209 std::function<void(RenderProperties& props, Canvas& canvas)> setup) {
Chris Craik9fded232015-11-11 16:42:34 -0800210#if HWUI_NULL_GPU
Chris Craik76caecf2015-11-02 19:17:45 -0800211 // if RenderNodes are being sync'd/used, device info will be needed, since
212 // DeviceInfo::maxTextureSize() affects layer property
213 DeviceInfo::initialize();
Chris Craik9fded232015-11-11 16:42:34 -0800214#endif
Chris Craik76caecf2015-11-02 19:17:45 -0800215
Chris Craikb565df12015-10-05 13:00:52 -0700216 sp<RenderNode> node = new RenderNode();
John Reck16c9d6a2015-11-17 15:51:08 -0800217 RenderProperties& props = node->mutateStagingProperties();
218 props.setLeftTopRightBottom(left, top, right, bottom);
219 if (setup) {
John Reck1bcacfd2017-11-03 10:12:19 -0700220 std::unique_ptr<Canvas> canvas(
221 Canvas::create_recording_canvas(props.getWidth(), props.getHeight()));
Stan Iliev06152cd2016-07-27 17:55:43 -0400222 setup(props, *canvas.get());
John Reck2de950d2017-01-25 10:58:30 -0800223 node->setStagingDisplayList(canvas->finishRecording());
Stan Iliev06152cd2016-07-27 17:55:43 -0400224 }
225 node->setPropertyFieldsDirty(0xFFFFFFFF);
226 return node;
227 }
228
John Reck1bcacfd2017-11-03 10:12:19 -0700229 template <class RecordingCanvasType>
230 static sp<RenderNode> createNode(
231 int left, int top, int right, int bottom,
Stan Iliev06152cd2016-07-27 17:55:43 -0400232 std::function<void(RenderProperties& props, RecordingCanvasType& canvas)> setup) {
233#if HWUI_NULL_GPU
234 // if RenderNodes are being sync'd/used, device info will be needed, since
235 // DeviceInfo::maxTextureSize() affects layer property
236 DeviceInfo::initialize();
237#endif
238
239 sp<RenderNode> node = new RenderNode();
240 RenderProperties& props = node->mutateStagingProperties();
241 props.setLeftTopRightBottom(left, top, right, bottom);
242 if (setup) {
243 RecordingCanvasType canvas(props.getWidth(), props.getHeight());
John Reck16c9d6a2015-11-17 15:51:08 -0800244 setup(props, canvas);
John Reck2de950d2017-01-25 10:58:30 -0800245 node->setStagingDisplayList(canvas.finishRecording());
Chris Craik0b7e8242015-10-28 16:50:44 -0700246 }
John Reck16c9d6a2015-11-17 15:51:08 -0800247 node->setPropertyFieldsDirty(0xFFFFFFFF);
Chris Craik0b7e8242015-10-28 16:50:44 -0700248 return node;
249 }
Chris Craikb565df12015-10-05 13:00:52 -0700250
John Reck1bcacfd2017-11-03 10:12:19 -0700251 static void recordNode(RenderNode& node, std::function<void(Canvas&)> contentCallback) {
252 std::unique_ptr<Canvas> canvas(Canvas::create_recording_canvas(
253 node.stagingProperties().getWidth(), node.stagingProperties().getHeight()));
254 contentCallback(*canvas.get());
255 node.setStagingDisplayList(canvas->finishRecording());
Chris Craikb565df12015-10-05 13:00:52 -0700256 }
257
John Reck1bcacfd2017-11-03 10:12:19 -0700258 static sp<RenderNode> createSkiaNode(
259 int left, int top, int right, int bottom,
260 std::function<void(RenderProperties& props, skiapipeline::SkiaRecordingCanvas& canvas)>
261 setup,
Stan Iliev500a0c32016-10-26 10:30:09 -0400262 const char* name = nullptr, skiapipeline::SkiaDisplayList* displayList = nullptr) {
John Reck1bcacfd2017-11-03 10:12:19 -0700263#if HWUI_NULL_GPU
Stan Iliev500a0c32016-10-26 10:30:09 -0400264 // if RenderNodes are being sync'd/used, device info will be needed, since
265 // DeviceInfo::maxTextureSize() affects layer property
266 DeviceInfo::initialize();
John Reck1bcacfd2017-11-03 10:12:19 -0700267#endif
Stan Iliev500a0c32016-10-26 10:30:09 -0400268 sp<RenderNode> node = new RenderNode();
269 if (name) {
270 node->setName(name);
271 }
272 RenderProperties& props = node->mutateStagingProperties();
273 props.setLeftTopRightBottom(left, top, right, bottom);
274 if (displayList) {
John Reck2de950d2017-01-25 10:58:30 -0800275 node->setStagingDisplayList(displayList);
Stan Iliev500a0c32016-10-26 10:30:09 -0400276 }
277 if (setup) {
278 std::unique_ptr<skiapipeline::SkiaRecordingCanvas> canvas(
John Reck1bcacfd2017-11-03 10:12:19 -0700279 new skiapipeline::SkiaRecordingCanvas(nullptr, props.getWidth(),
280 props.getHeight()));
Stan Iliev500a0c32016-10-26 10:30:09 -0400281 setup(props, *canvas.get());
John Reck2de950d2017-01-25 10:58:30 -0800282 node->setStagingDisplayList(canvas->finishRecording());
Stan Iliev500a0c32016-10-26 10:30:09 -0400283 }
284 node->setPropertyFieldsDirty(0xFFFFFFFF);
285 TestUtils::syncHierarchyPropertiesAndDisplayList(node);
286 return node;
287 }
288
Chris Craik8d1f2122015-11-24 16:40:09 -0800289 /**
290 * Forces a sync of a tree of RenderNode, such that every descendant will have its staging
291 * properties and DisplayList moved to the render copies.
292 *
293 * Note: does not check dirtiness bits, so any non-staging DisplayLists will be discarded.
294 * For this reason, this should generally only be called once on a tree.
295 */
Chris Craik161f54b2015-11-05 11:08:52 -0800296 static void syncHierarchyPropertiesAndDisplayList(sp<RenderNode>& node) {
297 syncHierarchyPropertiesAndDisplayListImpl(node.get());
Chris Craikb565df12015-10-05 13:00:52 -0700298 }
Chris Craik0a24b142015-10-19 17:10:19 -0700299
Chris Craik9cd1bbe2016-04-14 16:08:25 -0700300 static sp<RenderNode>& getSyncedNode(sp<RenderNode>& node) {
301 syncHierarchyPropertiesAndDisplayList(node);
302 return node;
John Reck7db5ffb2016-01-15 13:17:09 -0800303 }
304
Chris Craik0b7e8242015-10-28 16:50:44 -0700305 typedef std::function<void(renderthread::RenderThread& thread)> RtCallback;
Chris Craik0a24b142015-10-19 17:10:19 -0700306
307 class TestTask : public renderthread::RenderTask {
308 public:
John Reck1bcacfd2017-11-03 10:12:19 -0700309 explicit TestTask(RtCallback rtCallback) : rtCallback(rtCallback) {}
Chris Craik0a24b142015-10-19 17:10:19 -0700310 virtual ~TestTask() {}
John Recke5da4ef2016-01-14 12:34:46 -0800311 virtual void run() override;
Chris Craik0a24b142015-10-19 17:10:19 -0700312 RtCallback rtCallback;
313 };
314
315 /**
316 * NOTE: requires surfaceflinger to run, otherwise this method will wait indefinitely.
317 */
318 static void runOnRenderThread(RtCallback rtCallback) {
319 TestTask task(rtCallback);
John Reck1bcacfd2017-11-03 10:12:19 -0700320 renderthread::RenderThread::getInstance().queue().runSync([&]() { task.run(); });
Chris Craik0a24b142015-10-19 17:10:19 -0700321 }
John Reck16c9d6a2015-11-17 15:51:08 -0800322
John Reck1bcacfd2017-11-03 10:12:19 -0700323 static bool isRenderThreadRunning() { return renderthread::RenderThread::hasInstance(); }
John Reck38e0c322015-11-10 12:19:17 -0800324
John Reck16c9d6a2015-11-17 15:51:08 -0800325 static SkColor interpolateColor(float fraction, SkColor start, SkColor end);
326
Chris Craike8c3c812016-02-05 20:10:50 -0800327 static void layoutTextUnscaled(const SkPaint& paint, const char* text,
John Reck1bcacfd2017-11-03 10:12:19 -0700328 std::vector<glyph_t>* outGlyphs,
329 std::vector<float>* outPositions, float* outTotalAdvance,
330 Rect* outBounds);
Chris Craike8c3c812016-02-05 20:10:50 -0800331
John Reck1bcacfd2017-11-03 10:12:19 -0700332 static void drawUtf8ToCanvas(Canvas* canvas, const char* text, const SkPaint& paint, float x,
333 float y);
Chris Craika1717272015-11-19 13:02:43 -0800334
John Reck1bcacfd2017-11-03 10:12:19 -0700335 static void drawUtf8ToCanvas(Canvas* canvas, const char* text, const SkPaint& paint,
336 const SkPath& path);
Chris Craikd7448e62015-12-15 10:34:36 -0800337
Derek Sollenberger79abbf22016-03-24 11:07:19 -0400338 static std::unique_ptr<uint16_t[]> asciiToUtf16(const char* str);
sergeyvdccca442016-03-21 15:38:21 -0700339
Derek Sollenberger835b3a692016-10-28 13:57:14 -0400340 class MockFunctor : public Functor {
John Reck1bcacfd2017-11-03 10:12:19 -0700341 public:
342 virtual status_t operator()(int what, void* data) {
343 mLastMode = what;
344 return DrawGlInfo::kStatusDone;
345 }
346 int getLastMode() const { return mLastMode; }
347
348 private:
349 int mLastMode = -1;
350 };
Derek Sollenberger835b3a692016-10-28 13:57:14 -0400351
Stan Iliev021693b2016-10-17 16:26:15 -0400352 static SkColor getColor(const sk_sp<SkSurface>& surface, int x, int y);
353
Stan Iliev52771272016-11-17 09:54:38 -0500354 static SkRect getClipBounds(const SkCanvas* canvas);
355 static SkRect getLocalClipBounds(const SkCanvas* canvas);
356
Chris Craik161f54b2015-11-05 11:08:52 -0800357private:
358 static void syncHierarchyPropertiesAndDisplayListImpl(RenderNode* node) {
John Reck2de950d2017-01-25 10:58:30 -0800359 MarkAndSweepRemoved observer(nullptr);
Chris Craik161f54b2015-11-05 11:08:52 -0800360 node->syncProperties();
John Reck3afd6372017-01-30 10:15:48 -0800361 if (node->mNeedsDisplayListSync) {
362 node->mNeedsDisplayListSync = false;
363 node->syncDisplayList(observer, nullptr);
364 }
Chris Craik161f54b2015-11-05 11:08:52 -0800365 auto displayList = node->getDisplayList();
366 if (displayList) {
Stan Iliev25912c72017-03-31 14:00:20 -0400367 if (displayList->isSkiaDL()) {
368 for (auto&& childDr : static_cast<skiapipeline::SkiaDisplayList*>(
John Reck1bcacfd2017-11-03 10:12:19 -0700369 const_cast<DisplayList*>(displayList))
370 ->mChildNodes) {
Stan Iliev25912c72017-03-31 14:00:20 -0400371 syncHierarchyPropertiesAndDisplayListImpl(childDr.getRenderNode());
372 }
373 } else {
374 for (auto&& childOp : displayList->getChildren()) {
375 syncHierarchyPropertiesAndDisplayListImpl(childOp->renderNode);
376 }
Chris Craik161f54b2015-11-05 11:08:52 -0800377 }
378 }
379 }
380
John Reck1bcacfd2017-11-03 10:12:19 -0700381}; // class TestUtils
Chris Craikb565df12015-10-05 13:00:52 -0700382
383} /* namespace uirenderer */
384} /* namespace android */