John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | */ |
| 16 | |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 17 | #include <VectorDrawable.h> |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 18 | #include <gtest/gtest.h> |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 19 | |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 20 | #include "AnimationContext.h" |
| 21 | #include "DamageAccumulator.h" |
| 22 | #include "IContextFactory.h" |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 23 | #include "RenderNode.h" |
| 24 | #include "TreeInfo.h" |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 25 | #include "renderthread/CanvasContext.h" |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 26 | #include "tests/common/TestUtils.h" |
| 27 | #include "utils/Color.h" |
| 28 | |
| 29 | using namespace android; |
| 30 | using namespace android::uirenderer; |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 31 | using namespace android::uirenderer::renderthread; |
| 32 | |
| 33 | class ContextFactory : public android::uirenderer::IContextFactory { |
| 34 | public: |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 35 | android::uirenderer::AnimationContext* createAnimationContext( |
| 36 | android::uirenderer::renderthread::TimeLord& clock) override { |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 37 | return new android::uirenderer::AnimationContext(clock); |
| 38 | } |
| 39 | }; |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 40 | |
| 41 | TEST(RenderNode, hasParents) { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 42 | auto child = TestUtils::createNode(0, 0, 200, 400, [](RenderProperties& props, Canvas& canvas) { |
Mike Reed | 260ab72 | 2016-10-07 15:59:20 -0400 | [diff] [blame] | 43 | canvas.drawColor(Color::Red_500, SkBlendMode::kSrcOver); |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 44 | }); |
| 45 | auto parent = TestUtils::createNode(0, 0, 200, 400, |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 46 | [&child](RenderProperties& props, Canvas& canvas) { |
| 47 | canvas.drawRenderNode(child.get()); |
| 48 | }); |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 49 | |
| 50 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent); |
| 51 | |
| 52 | EXPECT_TRUE(child->hasParents()) << "Child node has no parent"; |
| 53 | EXPECT_FALSE(parent->hasParents()) << "Root node shouldn't have any parents"; |
| 54 | |
Stan Iliev | 06152cd | 2016-07-27 17:55:43 -0400 | [diff] [blame] | 55 | TestUtils::recordNode(*parent, [](Canvas& canvas) { |
Mike Reed | 260ab72 | 2016-10-07 15:59:20 -0400 | [diff] [blame] | 56 | canvas.drawColor(Color::Amber_500, SkBlendMode::kSrcOver); |
John Reck | 44b49f0 | 2016-03-25 14:29:48 -0700 | [diff] [blame] | 57 | }); |
| 58 | |
| 59 | EXPECT_TRUE(child->hasParents()) << "Child should still have a parent"; |
| 60 | EXPECT_FALSE(parent->hasParents()) << "Root node shouldn't have any parents"; |
| 61 | |
| 62 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent); |
| 63 | |
| 64 | EXPECT_FALSE(child->hasParents()) << "Child should be removed"; |
| 65 | EXPECT_FALSE(parent->hasParents()) << "Root node shouldn't have any parents"; |
| 66 | } |
John Reck | cd1c3eb | 2016-04-14 10:38:54 -0700 | [diff] [blame] | 67 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 68 | TEST(RenderNode, validity) { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 69 | auto child = TestUtils::createNode(0, 0, 200, 400, [](RenderProperties& props, Canvas& canvas) { |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 70 | canvas.drawColor(Color::Red_500, SkBlendMode::kSrcOver); |
| 71 | }); |
| 72 | auto parent = TestUtils::createNode(0, 0, 200, 400, |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 73 | [&child](RenderProperties& props, Canvas& canvas) { |
| 74 | canvas.drawRenderNode(child.get()); |
| 75 | }); |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 76 | |
| 77 | EXPECT_TRUE(child->isValid()); |
| 78 | EXPECT_TRUE(parent->isValid()); |
| 79 | EXPECT_TRUE(child->nothingToDraw()); |
| 80 | EXPECT_TRUE(parent->nothingToDraw()); |
| 81 | |
| 82 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent); |
| 83 | |
| 84 | EXPECT_TRUE(child->isValid()); |
| 85 | EXPECT_TRUE(parent->isValid()); |
| 86 | EXPECT_FALSE(child->nothingToDraw()); |
| 87 | EXPECT_FALSE(parent->nothingToDraw()); |
| 88 | |
| 89 | TestUtils::recordNode(*parent, [](Canvas& canvas) { |
| 90 | canvas.drawColor(Color::Amber_500, SkBlendMode::kSrcOver); |
| 91 | }); |
| 92 | |
| 93 | EXPECT_TRUE(child->isValid()); |
| 94 | EXPECT_TRUE(parent->isValid()); |
| 95 | EXPECT_FALSE(child->nothingToDraw()); |
| 96 | EXPECT_FALSE(parent->nothingToDraw()); |
| 97 | |
| 98 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent); |
| 99 | |
| 100 | EXPECT_FALSE(child->isValid()); |
| 101 | EXPECT_TRUE(parent->isValid()); |
| 102 | EXPECT_TRUE(child->nothingToDraw()); |
| 103 | EXPECT_FALSE(parent->nothingToDraw()); |
| 104 | |
| 105 | TestUtils::recordNode(*child, [](Canvas& canvas) { |
| 106 | canvas.drawColor(Color::Amber_500, SkBlendMode::kSrcOver); |
| 107 | }); |
| 108 | |
| 109 | EXPECT_TRUE(child->isValid()); |
| 110 | EXPECT_TRUE(child->nothingToDraw()); |
| 111 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 112 | TestUtils::recordNode(*parent, |
| 113 | [&child](Canvas& canvas) { canvas.drawRenderNode(child.get()); }); |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 114 | |
| 115 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent); |
| 116 | |
| 117 | EXPECT_TRUE(child->isValid()); |
| 118 | EXPECT_TRUE(parent->isValid()); |
| 119 | EXPECT_FALSE(child->nothingToDraw()); |
| 120 | EXPECT_FALSE(parent->nothingToDraw()); |
| 121 | |
| 122 | parent->destroyHardwareResources(); |
| 123 | |
| 124 | EXPECT_FALSE(child->isValid()); |
| 125 | EXPECT_FALSE(parent->isValid()); |
| 126 | EXPECT_TRUE(child->nothingToDraw()); |
| 127 | EXPECT_TRUE(parent->nothingToDraw()); |
| 128 | } |
| 129 | |
John Reck | 3afd637 | 2017-01-30 10:15:48 -0800 | [diff] [blame] | 130 | TEST(RenderNode, multiTreeValidity) { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 131 | auto child = TestUtils::createNode(0, 0, 200, 400, [](RenderProperties& props, Canvas& canvas) { |
John Reck | 3afd637 | 2017-01-30 10:15:48 -0800 | [diff] [blame] | 132 | canvas.drawColor(Color::Red_500, SkBlendMode::kSrcOver); |
| 133 | }); |
| 134 | auto parent1 = TestUtils::createNode(0, 0, 200, 400, |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 135 | [&child](RenderProperties& props, Canvas& canvas) { |
| 136 | canvas.drawRenderNode(child.get()); |
| 137 | }); |
John Reck | 3afd637 | 2017-01-30 10:15:48 -0800 | [diff] [blame] | 138 | auto parent2 = TestUtils::createNode(0, 0, 200, 400, |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 139 | [&child](RenderProperties& props, Canvas& canvas) { |
| 140 | canvas.drawRenderNode(child.get()); |
| 141 | }); |
John Reck | 3afd637 | 2017-01-30 10:15:48 -0800 | [diff] [blame] | 142 | |
| 143 | EXPECT_TRUE(child->isValid()); |
| 144 | EXPECT_TRUE(parent1->isValid()); |
| 145 | EXPECT_TRUE(parent2->isValid()); |
| 146 | EXPECT_TRUE(child->nothingToDraw()); |
| 147 | EXPECT_TRUE(parent1->nothingToDraw()); |
| 148 | EXPECT_TRUE(parent2->nothingToDraw()); |
| 149 | |
| 150 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent1); |
| 151 | |
| 152 | EXPECT_TRUE(child->isValid()); |
| 153 | EXPECT_TRUE(parent1->isValid()); |
| 154 | EXPECT_TRUE(parent2->isValid()); |
| 155 | EXPECT_FALSE(child->nothingToDraw()); |
| 156 | EXPECT_FALSE(parent1->nothingToDraw()); |
| 157 | EXPECT_TRUE(parent2->nothingToDraw()); |
| 158 | |
| 159 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent2); |
| 160 | |
| 161 | EXPECT_TRUE(child->isValid()); |
| 162 | EXPECT_TRUE(parent1->isValid()); |
| 163 | EXPECT_TRUE(parent2->isValid()); |
| 164 | EXPECT_FALSE(child->nothingToDraw()); |
| 165 | EXPECT_FALSE(parent1->nothingToDraw()); |
| 166 | EXPECT_FALSE(parent2->nothingToDraw()); |
| 167 | |
| 168 | TestUtils::recordNode(*parent1, [](Canvas& canvas) { |
| 169 | canvas.drawColor(Color::Amber_500, SkBlendMode::kSrcOver); |
| 170 | }); |
| 171 | |
| 172 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent1); |
| 173 | |
| 174 | EXPECT_TRUE(child->isValid()); |
| 175 | EXPECT_TRUE(parent1->isValid()); |
| 176 | EXPECT_TRUE(parent2->isValid()); |
| 177 | EXPECT_FALSE(child->nothingToDraw()); |
| 178 | EXPECT_FALSE(parent1->nothingToDraw()); |
| 179 | EXPECT_FALSE(parent2->nothingToDraw()); |
| 180 | |
| 181 | TestUtils::recordNode(*parent2, [](Canvas& canvas) { |
| 182 | canvas.drawColor(Color::Amber_500, SkBlendMode::kSrcOver); |
| 183 | }); |
| 184 | |
| 185 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent2); |
| 186 | |
| 187 | EXPECT_FALSE(child->isValid()); |
| 188 | EXPECT_TRUE(parent1->isValid()); |
| 189 | EXPECT_TRUE(parent2->isValid()); |
| 190 | EXPECT_TRUE(child->nothingToDraw()); |
| 191 | EXPECT_FALSE(parent1->nothingToDraw()); |
| 192 | EXPECT_FALSE(parent2->nothingToDraw()); |
| 193 | |
| 194 | TestUtils::recordNode(*child, [](Canvas& canvas) { |
| 195 | canvas.drawColor(Color::Red_500, SkBlendMode::kSrcOver); |
| 196 | }); |
| 197 | TestUtils::syncHierarchyPropertiesAndDisplayList(child); |
| 198 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 199 | TestUtils::recordNode(*parent1, |
| 200 | [&child](Canvas& canvas) { canvas.drawRenderNode(child.get()); }); |
John Reck | 3afd637 | 2017-01-30 10:15:48 -0800 | [diff] [blame] | 201 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent1); |
| 202 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 203 | TestUtils::recordNode(*parent2, |
| 204 | [&child](Canvas& canvas) { canvas.drawRenderNode(child.get()); }); |
John Reck | 3afd637 | 2017-01-30 10:15:48 -0800 | [diff] [blame] | 205 | TestUtils::syncHierarchyPropertiesAndDisplayList(parent2); |
| 206 | |
| 207 | EXPECT_TRUE(child->isValid()); |
| 208 | EXPECT_TRUE(parent1->isValid()); |
| 209 | EXPECT_TRUE(parent2->isValid()); |
| 210 | EXPECT_FALSE(child->nothingToDraw()); |
| 211 | EXPECT_FALSE(parent1->nothingToDraw()); |
| 212 | EXPECT_FALSE(parent2->nothingToDraw()); |
| 213 | |
| 214 | parent1->destroyHardwareResources(); |
| 215 | |
| 216 | EXPECT_TRUE(child->isValid()); |
| 217 | EXPECT_FALSE(parent1->isValid()); |
| 218 | EXPECT_TRUE(parent2->isValid()); |
| 219 | EXPECT_FALSE(child->nothingToDraw()); |
| 220 | EXPECT_TRUE(parent1->nothingToDraw()); |
| 221 | EXPECT_FALSE(parent2->nothingToDraw()); |
| 222 | |
| 223 | parent2->destroyHardwareResources(); |
| 224 | |
| 225 | EXPECT_FALSE(child->isValid()); |
| 226 | EXPECT_FALSE(parent1->isValid()); |
| 227 | EXPECT_FALSE(parent2->isValid()); |
| 228 | EXPECT_TRUE(child->nothingToDraw()); |
| 229 | EXPECT_TRUE(parent1->nothingToDraw()); |
| 230 | EXPECT_TRUE(parent2->nothingToDraw()); |
| 231 | } |
| 232 | |
John Reck | cd1c3eb | 2016-04-14 10:38:54 -0700 | [diff] [blame] | 233 | TEST(RenderNode, releasedCallback) { |
| 234 | class DecRefOnReleased : public GlFunctorLifecycleListener { |
| 235 | public: |
Chih-Hung Hsieh | d53e3be | 2016-05-03 10:02:51 -0700 | [diff] [blame] | 236 | explicit DecRefOnReleased(int* refcnt) : mRefCnt(refcnt) {} |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 237 | void onGlFunctorReleased(Functor* functor) override { *mRefCnt -= 1; } |
| 238 | |
John Reck | cd1c3eb | 2016-04-14 10:38:54 -0700 | [diff] [blame] | 239 | private: |
| 240 | int* mRefCnt; |
| 241 | }; |
| 242 | |
| 243 | int refcnt = 0; |
| 244 | sp<DecRefOnReleased> listener(new DecRefOnReleased(&refcnt)); |
| 245 | Functor noopFunctor; |
| 246 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 247 | auto node = TestUtils::createNode(0, 0, 200, 400, [&](RenderProperties& props, Canvas& canvas) { |
John Reck | cd1c3eb | 2016-04-14 10:38:54 -0700 | [diff] [blame] | 248 | refcnt++; |
| 249 | canvas.callDrawGLFunction(&noopFunctor, listener.get()); |
| 250 | }); |
| 251 | TestUtils::syncHierarchyPropertiesAndDisplayList(node); |
| 252 | EXPECT_EQ(1, refcnt); |
| 253 | |
Stan Iliev | 06152cd | 2016-07-27 17:55:43 -0400 | [diff] [blame] | 254 | TestUtils::recordNode(*node, [&](Canvas& canvas) { |
John Reck | cd1c3eb | 2016-04-14 10:38:54 -0700 | [diff] [blame] | 255 | refcnt++; |
| 256 | canvas.callDrawGLFunction(&noopFunctor, listener.get()); |
| 257 | }); |
| 258 | EXPECT_EQ(2, refcnt); |
| 259 | |
| 260 | TestUtils::syncHierarchyPropertiesAndDisplayList(node); |
| 261 | EXPECT_EQ(1, refcnt); |
| 262 | |
Stan Iliev | 06152cd | 2016-07-27 17:55:43 -0400 | [diff] [blame] | 263 | TestUtils::recordNode(*node, [](Canvas& canvas) {}); |
John Reck | cd1c3eb | 2016-04-14 10:38:54 -0700 | [diff] [blame] | 264 | EXPECT_EQ(1, refcnt); |
| 265 | TestUtils::syncHierarchyPropertiesAndDisplayList(node); |
| 266 | EXPECT_EQ(0, refcnt); |
| 267 | } |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 268 | |
| 269 | RENDERTHREAD_TEST(RenderNode, prepareTree_nullableDisplayList) { |
Derek Sollenberger | 56ad6ec | 2016-07-22 12:13:32 -0400 | [diff] [blame] | 270 | auto rootNode = TestUtils::createNode(0, 0, 200, 400, nullptr); |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 271 | ContextFactory contextFactory; |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 272 | std::unique_ptr<CanvasContext> canvasContext( |
| 273 | CanvasContext::create(renderThread, false, rootNode.get(), &contextFactory)); |
Stan Iliev | 03de074 | 2016-07-07 12:35:54 -0400 | [diff] [blame] | 274 | TreeInfo info(TreeInfo::MODE_RT_ONLY, *canvasContext.get()); |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 275 | DamageAccumulator damageAccumulator; |
| 276 | info.damageAccumulator = &damageAccumulator; |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 277 | |
| 278 | { |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 279 | auto nonNullDLNode = |
| 280 | TestUtils::createNode(0, 0, 200, 400, [](RenderProperties& props, Canvas& canvas) { |
| 281 | canvas.drawColor(Color::Red_500, SkBlendMode::kSrcOver); |
| 282 | }); |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 283 | TestUtils::syncHierarchyPropertiesAndDisplayList(nonNullDLNode); |
| 284 | EXPECT_TRUE(nonNullDLNode->getDisplayList()); |
| 285 | nonNullDLNode->prepareTree(info); |
| 286 | } |
| 287 | |
| 288 | { |
| 289 | auto nullDLNode = TestUtils::createNode(0, 0, 200, 400, nullptr); |
| 290 | TestUtils::syncHierarchyPropertiesAndDisplayList(nullDLNode); |
| 291 | EXPECT_FALSE(nullDLNode->getDisplayList()); |
| 292 | nullDLNode->prepareTree(info); |
| 293 | } |
| 294 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 295 | canvasContext->destroy(); |
Doris Liu | a7952b3 | 2016-06-13 14:49:26 -0700 | [diff] [blame] | 296 | } |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 297 | |
| 298 | RENDERTHREAD_TEST(RenderNode, prepareTree_HwLayer_AVD_enqueueDamage) { |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 299 | VectorDrawable::Group* group = new VectorDrawable::Group(); |
Greg Daniel | 98c78dad | 2017-01-04 14:45:56 -0500 | [diff] [blame] | 300 | sp<VectorDrawableRoot> vectorDrawable(new VectorDrawableRoot(group)); |
| 301 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 302 | auto rootNode = |
| 303 | TestUtils::createNode(0, 0, 200, 400, [&](RenderProperties& props, Canvas& canvas) { |
| 304 | canvas.drawVectorDrawable(vectorDrawable.get()); |
| 305 | }); |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 306 | ContextFactory contextFactory; |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 307 | std::unique_ptr<CanvasContext> canvasContext( |
| 308 | CanvasContext::create(renderThread, false, rootNode.get(), &contextFactory)); |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 309 | TreeInfo info(TreeInfo::MODE_RT_ONLY, *canvasContext.get()); |
| 310 | DamageAccumulator damageAccumulator; |
| 311 | LayerUpdateQueue layerUpdateQueue; |
| 312 | info.damageAccumulator = &damageAccumulator; |
| 313 | info.layerUpdateQueue = &layerUpdateQueue; |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 314 | |
| 315 | // Put node on HW layer |
| 316 | rootNode->mutateStagingProperties().mutateLayerProperties().setType(LayerType::RenderLayer); |
| 317 | |
| 318 | TestUtils::syncHierarchyPropertiesAndDisplayList(rootNode); |
| 319 | rootNode->prepareTree(info); |
| 320 | |
| 321 | // Check that the VD is in the dislay list, and the layer update queue contains the correct |
| 322 | // damage rect. |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 323 | EXPECT_TRUE(rootNode->getDisplayList()->hasVectorDrawables()); |
John Reck | 8e539ca | 2018-11-15 15:21:29 -0800 | [diff] [blame^] | 324 | ASSERT_FALSE(info.layerUpdateQueue->entries().empty()); |
John Reck | fc29f7acd | 2017-03-02 13:23:16 -0800 | [diff] [blame] | 325 | EXPECT_EQ(rootNode.get(), info.layerUpdateQueue->entries().at(0).renderNode.get()); |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 326 | EXPECT_EQ(uirenderer::Rect(0, 0, 200, 400), info.layerUpdateQueue->entries().at(0).damage); |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 327 | canvasContext->destroy(); |
Doris Liu | 5876e7d | 2016-08-02 17:28:30 -0700 | [diff] [blame] | 328 | } |