John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 17 | #include "RenderNode.h" |
| 18 | |
Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 19 | #include "BakedOpRenderer.h" |
John Reck | e4267ea | 2014-06-03 15:53:15 -0700 | [diff] [blame] | 20 | #include "DamageAccumulator.h" |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 21 | #include "Debug.h" |
Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 22 | #include "RecordedOp.h" |
Tom Hudson | 2dc236b | 2014-10-15 15:46:42 -0400 | [diff] [blame] | 23 | #include "TreeInfo.h" |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 24 | #include "utils/FatVector.h" |
Chris Craik | e0bb87d | 2014-04-22 17:55:41 -0700 | [diff] [blame] | 25 | #include "utils/MathUtils.h" |
sergeyv | c3849aa | 2016-08-08 13:22:06 -0700 | [diff] [blame] | 26 | #include "utils/StringUtils.h" |
Chris Craik | 70850ea | 2014-11-18 10:49:23 -0800 | [diff] [blame] | 27 | #include "utils/TraceUtils.h" |
Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 28 | #include "VectorDrawable.h" |
| 29 | #include "renderstate/RenderState.h" |
John Reck | 998a6d8 | 2014-08-28 15:35:53 -0700 | [diff] [blame] | 30 | #include "renderthread/CanvasContext.h" |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 31 | |
John Reck | e248bd1 | 2015-08-05 13:53:53 -0700 | [diff] [blame] | 32 | #include "protos/hwui.pb.h" |
| 33 | #include "protos/ProtoHelpers.h" |
| 34 | |
John Reck | 77c4010 | 2015-10-26 15:49:47 -0700 | [diff] [blame] | 35 | #include <algorithm> |
| 36 | #include <sstream> |
| 37 | #include <string> |
| 38 | |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 39 | namespace android { |
| 40 | namespace uirenderer { |
| 41 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 42 | // Used for tree mutations that are purely destructive. |
| 43 | // Generic tree mutations should use MarkAndSweepObserver instead |
| 44 | class ImmediateRemoved : public TreeObserver { |
| 45 | public: |
| 46 | explicit ImmediateRemoved(TreeInfo* info) : mTreeInfo(info) {} |
| 47 | |
| 48 | void onMaybeRemovedFromTree(RenderNode* node) override { |
| 49 | node->onRemovedFromTree(mTreeInfo); |
| 50 | } |
| 51 | |
| 52 | private: |
| 53 | TreeInfo* mTreeInfo; |
| 54 | }; |
| 55 | |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 56 | RenderNode::RenderNode() |
John Reck | ff941dc | 2014-05-14 16:34:14 -0700 | [diff] [blame] | 57 | : mDirtyPropertyFields(0) |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 58 | , mNeedsDisplayListSync(false) |
| 59 | , mDisplayList(nullptr) |
| 60 | , mStagingDisplayList(nullptr) |
John Reck | 68bfe0a | 2014-06-24 15:34:58 -0700 | [diff] [blame] | 61 | , mAnimatorManager(*this) |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 62 | , mParentCount(0) { |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | RenderNode::~RenderNode() { |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 66 | ImmediateRemoved observer(nullptr); |
| 67 | deleteDisplayList(observer); |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 68 | delete mStagingDisplayList; |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 69 | LOG_ALWAYS_FATAL_IF(hasLayer(), "layer missed detachment!"); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 70 | } |
| 71 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 72 | void RenderNode::setStagingDisplayList(DisplayList* displayList) { |
| 73 | mValid = (displayList != nullptr); |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 74 | mNeedsDisplayListSync = true; |
| 75 | delete mStagingDisplayList; |
| 76 | mStagingDisplayList = displayList; |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | /** |
| 80 | * This function is a simplified version of replay(), where we simply retrieve and log the |
| 81 | * display list. This function should remain in sync with the replay() function. |
| 82 | */ |
sergeyv | c3849aa | 2016-08-08 13:22:06 -0700 | [diff] [blame] | 83 | void RenderNode::output() { |
| 84 | LogcatStream strout; |
| 85 | strout << "Root"; |
| 86 | output(strout, 0); |
| 87 | } |
| 88 | |
| 89 | void RenderNode::output(std::ostream& output, uint32_t level) { |
| 90 | output << " (" << getName() << " " << this |
| 91 | << (MathUtils::isZero(properties().getAlpha()) ? ", zero alpha" : "") |
| 92 | << (properties().hasShadow() ? ", casting shadow" : "") |
| 93 | << (isRenderable() ? "" : ", empty") |
| 94 | << (properties().getProjectBackwards() ? ", projected" : "") |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 95 | << (hasLayer() ? ", on HW Layer" : "") |
sergeyv | c3849aa | 2016-08-08 13:22:06 -0700 | [diff] [blame] | 96 | << ")" << std::endl; |
| 97 | |
| 98 | properties().debugOutputProperties(output, level + 1); |
Chris Craik | 91eff22 | 2016-02-22 13:39:33 -0800 | [diff] [blame] | 99 | |
| 100 | if (mDisplayList) { |
Stan Iliev | d217237 | 2017-02-09 16:59:27 -0500 | [diff] [blame] | 101 | mDisplayList->output(output, level); |
Chris Craik | 91eff22 | 2016-02-22 13:39:33 -0800 | [diff] [blame] | 102 | } |
sergeyv | c3849aa | 2016-08-08 13:22:06 -0700 | [diff] [blame] | 103 | output << std::string(level * 2, ' ') << "/RenderNode(" << getName() << " " << this << ")"; |
| 104 | output << std::endl; |
Chris Craik | 91eff22 | 2016-02-22 13:39:33 -0800 | [diff] [blame] | 105 | } |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 106 | |
John Reck | e248bd1 | 2015-08-05 13:53:53 -0700 | [diff] [blame] | 107 | void RenderNode::copyTo(proto::RenderNode *pnode) { |
| 108 | pnode->set_id(static_cast<uint64_t>( |
| 109 | reinterpret_cast<uintptr_t>(this))); |
| 110 | pnode->set_name(mName.string(), mName.length()); |
| 111 | |
| 112 | proto::RenderProperties* pprops = pnode->mutable_properties(); |
| 113 | pprops->set_left(properties().getLeft()); |
| 114 | pprops->set_top(properties().getTop()); |
| 115 | pprops->set_right(properties().getRight()); |
| 116 | pprops->set_bottom(properties().getBottom()); |
| 117 | pprops->set_clip_flags(properties().getClippingFlags()); |
| 118 | pprops->set_alpha(properties().getAlpha()); |
| 119 | pprops->set_translation_x(properties().getTranslationX()); |
| 120 | pprops->set_translation_y(properties().getTranslationY()); |
| 121 | pprops->set_translation_z(properties().getTranslationZ()); |
| 122 | pprops->set_elevation(properties().getElevation()); |
| 123 | pprops->set_rotation(properties().getRotation()); |
| 124 | pprops->set_rotation_x(properties().getRotationX()); |
| 125 | pprops->set_rotation_y(properties().getRotationY()); |
| 126 | pprops->set_scale_x(properties().getScaleX()); |
| 127 | pprops->set_scale_y(properties().getScaleY()); |
| 128 | pprops->set_pivot_x(properties().getPivotX()); |
| 129 | pprops->set_pivot_y(properties().getPivotY()); |
| 130 | pprops->set_has_overlapping_rendering(properties().getHasOverlappingRendering()); |
| 131 | pprops->set_pivot_explicitly_set(properties().isPivotExplicitlySet()); |
| 132 | pprops->set_project_backwards(properties().getProjectBackwards()); |
| 133 | pprops->set_projection_receiver(properties().isProjectionReceiver()); |
| 134 | set(pprops->mutable_clip_bounds(), properties().getClipBounds()); |
| 135 | |
| 136 | const Outline& outline = properties().getOutline(); |
| 137 | if (outline.getType() != Outline::Type::None) { |
| 138 | proto::Outline* poutline = pprops->mutable_outline(); |
| 139 | poutline->clear_path(); |
| 140 | if (outline.getType() == Outline::Type::Empty) { |
| 141 | poutline->set_type(proto::Outline_Type_Empty); |
| 142 | } else if (outline.getType() == Outline::Type::ConvexPath) { |
| 143 | poutline->set_type(proto::Outline_Type_ConvexPath); |
| 144 | if (const SkPath* path = outline.getPath()) { |
| 145 | set(poutline->mutable_path(), *path); |
| 146 | } |
| 147 | } else if (outline.getType() == Outline::Type::RoundRect) { |
| 148 | poutline->set_type(proto::Outline_Type_RoundRect); |
| 149 | } else { |
| 150 | ALOGW("Uknown outline type! %d", static_cast<int>(outline.getType())); |
| 151 | poutline->set_type(proto::Outline_Type_None); |
| 152 | } |
| 153 | poutline->set_should_clip(outline.getShouldClip()); |
| 154 | poutline->set_alpha(outline.getAlpha()); |
| 155 | poutline->set_radius(outline.getRadius()); |
| 156 | set(poutline->mutable_bounds(), outline.getBounds()); |
| 157 | } else { |
| 158 | pprops->clear_outline(); |
| 159 | } |
| 160 | |
| 161 | const RevealClip& revealClip = properties().getRevealClip(); |
| 162 | if (revealClip.willClip()) { |
| 163 | proto::RevealClip* prevealClip = pprops->mutable_reveal_clip(); |
| 164 | prevealClip->set_x(revealClip.getX()); |
| 165 | prevealClip->set_y(revealClip.getY()); |
| 166 | prevealClip->set_radius(revealClip.getRadius()); |
| 167 | } else { |
| 168 | pprops->clear_reveal_clip(); |
| 169 | } |
| 170 | |
| 171 | pnode->clear_children(); |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 172 | if (mDisplayList) { |
Chris Craik | b36af87 | 2015-10-16 14:23:12 -0700 | [diff] [blame] | 173 | for (auto&& child : mDisplayList->getChildren()) { |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 174 | child->renderNode->copyTo(pnode->add_children()); |
John Reck | e248bd1 | 2015-08-05 13:53:53 -0700 | [diff] [blame] | 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 179 | int RenderNode::getDebugSize() { |
| 180 | int size = sizeof(RenderNode); |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 181 | if (mStagingDisplayList) { |
| 182 | size += mStagingDisplayList->getUsedSize(); |
John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 183 | } |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 184 | if (mDisplayList && mDisplayList != mStagingDisplayList) { |
| 185 | size += mDisplayList->getUsedSize(); |
John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 186 | } |
| 187 | return size; |
| 188 | } |
| 189 | |
John Reck | f4198b7 | 2014-04-09 17:00:04 -0700 | [diff] [blame] | 190 | void RenderNode::prepareTree(TreeInfo& info) { |
| 191 | ATRACE_CALL(); |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 192 | LOG_ALWAYS_FATAL_IF(!info.damageAccumulator, "DamageAccumulator missing"); |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 193 | MarkAndSweepRemoved observer(&info); |
John Reck | f4198b7 | 2014-04-09 17:00:04 -0700 | [diff] [blame] | 194 | |
Matt Sarett | f58cc92 | 2016-11-14 18:33:38 -0500 | [diff] [blame] | 195 | // The OpenGL renderer reserves the stencil buffer for overdraw debugging. Functors |
| 196 | // will need to be drawn in a layer. |
| 197 | bool functorsNeedLayer = Properties::debugOverdraw && !Properties::isSkiaEnabled(); |
Chris Craik | a766cb2 | 2015-06-08 16:49:43 -0700 | [diff] [blame] | 198 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 199 | prepareTreeImpl(observer, info, functorsNeedLayer); |
John Reck | f4198b7 | 2014-04-09 17:00:04 -0700 | [diff] [blame] | 200 | } |
| 201 | |
John Reck | 68bfe0a | 2014-06-24 15:34:58 -0700 | [diff] [blame] | 202 | void RenderNode::addAnimator(const sp<BaseRenderNodeAnimator>& animator) { |
| 203 | mAnimatorManager.addAnimator(animator); |
| 204 | } |
| 205 | |
Doris Liu | 8b08320 | 2016-02-19 21:46:06 +0000 | [diff] [blame] | 206 | void RenderNode::removeAnimator(const sp<BaseRenderNodeAnimator>& animator) { |
| 207 | mAnimatorManager.removeAnimator(animator); |
| 208 | } |
| 209 | |
John Reck | e4267ea | 2014-06-03 15:53:15 -0700 | [diff] [blame] | 210 | void RenderNode::damageSelf(TreeInfo& info) { |
John Reck | ce9f308 | 2014-06-17 16:18:09 -0700 | [diff] [blame] | 211 | if (isRenderable()) { |
John Reck | 293e868 | 2014-06-17 10:34:02 -0700 | [diff] [blame] | 212 | if (properties().getClipDamageToBounds()) { |
John Reck | a447d29 | 2014-06-11 18:39:44 -0700 | [diff] [blame] | 213 | info.damageAccumulator->dirty(0, 0, properties().getWidth(), properties().getHeight()); |
| 214 | } else { |
| 215 | // Hope this is big enough? |
| 216 | // TODO: Get this from the display list ops or something |
John Reck | c128823 | 2015-08-12 13:39:11 -0700 | [diff] [blame] | 217 | info.damageAccumulator->dirty(DIRTY_MIN, DIRTY_MIN, DIRTY_MAX, DIRTY_MAX); |
John Reck | a447d29 | 2014-06-11 18:39:44 -0700 | [diff] [blame] | 218 | } |
John Reck | e4267ea | 2014-06-03 15:53:15 -0700 | [diff] [blame] | 219 | } |
| 220 | } |
| 221 | |
John Reck | a7c2ea2 | 2014-08-08 13:21:00 -0700 | [diff] [blame] | 222 | void RenderNode::prepareLayer(TreeInfo& info, uint32_t dirtyMask) { |
Chris Craik | 856f0cc | 2015-04-21 15:13:29 -0700 | [diff] [blame] | 223 | LayerType layerType = properties().effectiveLayerType(); |
Chris Craik | 182952f | 2015-03-09 14:17:29 -0700 | [diff] [blame] | 224 | if (CC_UNLIKELY(layerType == LayerType::RenderLayer)) { |
John Reck | a7c2ea2 | 2014-08-08 13:21:00 -0700 | [diff] [blame] | 225 | // Damage applied so far needs to affect our parent, but does not require |
| 226 | // the layer to be updated. So we pop/push here to clear out the current |
| 227 | // damage and get a clean state for display list or children updates to |
| 228 | // affect, which will require the layer to be updated |
| 229 | info.damageAccumulator->popTransform(); |
| 230 | info.damageAccumulator->pushTransform(this); |
| 231 | if (dirtyMask & DISPLAY_LIST) { |
| 232 | damageSelf(info); |
| 233 | } |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 234 | } |
| 235 | } |
| 236 | |
| 237 | void RenderNode::pushLayerUpdate(TreeInfo& info) { |
Chris Craik | 856f0cc | 2015-04-21 15:13:29 -0700 | [diff] [blame] | 238 | LayerType layerType = properties().effectiveLayerType(); |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 239 | // If we are not a layer OR we cannot be rendered (eg, view was detached) |
| 240 | // we need to destroy any Layers we may have had previously |
Chris Craik | e3e481d | 2016-07-11 12:20:51 -0700 | [diff] [blame] | 241 | if (CC_LIKELY(layerType != LayerType::RenderLayer) |
| 242 | || CC_UNLIKELY(!isRenderable()) |
| 243 | || CC_UNLIKELY(properties().getWidth() == 0) |
| 244 | || CC_UNLIKELY(properties().getHeight() == 0)) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 245 | if (CC_UNLIKELY(hasLayer())) { |
Derek Sollenberger | 6a21ca5 | 2016-09-28 13:39:55 -0400 | [diff] [blame] | 246 | renderthread::CanvasContext::destroyLayer(this); |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 247 | } |
| 248 | return; |
| 249 | } |
| 250 | |
Derek Sollenberger | 6a21ca5 | 2016-09-28 13:39:55 -0400 | [diff] [blame] | 251 | if(info.canvasContext.createOrUpdateLayer(this, *info.damageAccumulator)) { |
Chris Craik | 9fded23 | 2015-11-11 16:42:34 -0800 | [diff] [blame] | 252 | damageSelf(info); |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 253 | } |
| 254 | |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 255 | if (!hasLayer()) { |
John Reck | 0e89e2b | 2014-10-31 14:49:06 -0700 | [diff] [blame] | 256 | Caches::getInstance().dumpMemoryUsage(); |
John Reck | c25e506 | 2014-06-18 14:21:29 -0700 | [diff] [blame] | 257 | if (info.errorHandler) { |
John Reck | 77c4010 | 2015-10-26 15:49:47 -0700 | [diff] [blame] | 258 | std::ostringstream err; |
| 259 | err << "Unable to create layer for " << getName(); |
Chris Craik | 76caecf | 2015-11-02 19:17:45 -0800 | [diff] [blame] | 260 | const int maxTextureSize = Caches::getInstance().maxTextureSize; |
John Reck | 77c4010 | 2015-10-26 15:49:47 -0700 | [diff] [blame] | 261 | if (getWidth() > maxTextureSize || getHeight() > maxTextureSize) { |
| 262 | err << ", size " << getWidth() << "x" << getHeight() |
| 263 | << " exceeds max size " << maxTextureSize; |
| 264 | } else { |
| 265 | err << ", see logcat for more info"; |
| 266 | } |
| 267 | info.errorHandler->onError(err.str()); |
John Reck | c25e506 | 2014-06-18 14:21:29 -0700 | [diff] [blame] | 268 | } |
| 269 | return; |
| 270 | } |
| 271 | |
Derek Sollenberger | 6a21ca5 | 2016-09-28 13:39:55 -0400 | [diff] [blame] | 272 | SkRect dirty; |
| 273 | info.damageAccumulator->peekAtDirty(&dirty); |
Chris Craik | 0b7e824 | 2015-10-28 16:50:44 -0700 | [diff] [blame] | 274 | info.layerUpdateQueue->enqueueLayerWithDamage(this, dirty); |
John Reck | 998a6d8 | 2014-08-28 15:35:53 -0700 | [diff] [blame] | 275 | |
Chris Craik | e2e53a7 | 2015-10-28 15:55:40 -0700 | [diff] [blame] | 276 | // There might be prefetched layers that need to be accounted for. |
| 277 | // That might be us, so tell CanvasContext that this layer is in the |
| 278 | // tree and should not be destroyed. |
| 279 | info.canvasContext.markLayerInUse(this); |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 280 | } |
| 281 | |
Chris Craik | a766cb2 | 2015-06-08 16:49:43 -0700 | [diff] [blame] | 282 | /** |
| 283 | * Traverse down the the draw tree to prepare for a frame. |
| 284 | * |
| 285 | * MODE_FULL = UI Thread-driven (thus properties must be synced), otherwise RT driven |
| 286 | * |
| 287 | * While traversing down the tree, functorsNeedLayer flag is set to true if anything that uses the |
| 288 | * stencil buffer may be needed. Views that use a functor to draw will be forced onto a layer. |
| 289 | */ |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 290 | void RenderNode::prepareTreeImpl(TreeObserver& observer, TreeInfo& info, bool functorsNeedLayer) { |
John Reck | a447d29 | 2014-06-11 18:39:44 -0700 | [diff] [blame] | 291 | info.damageAccumulator->pushTransform(this); |
John Reck | f47a594 | 2014-06-30 16:20:04 -0700 | [diff] [blame] | 292 | |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 293 | if (info.mode == TreeInfo::MODE_FULL) { |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 294 | pushStagingPropertiesChanges(info); |
John Reck | e45b1fd | 2014-04-15 09:50:16 -0700 | [diff] [blame] | 295 | } |
John Reck | 9eb9f6f | 2014-08-21 11:23:05 -0700 | [diff] [blame] | 296 | uint32_t animatorDirtyMask = 0; |
| 297 | if (CC_LIKELY(info.runAnimations)) { |
| 298 | animatorDirtyMask = mAnimatorManager.animate(info); |
| 299 | } |
Chris Craik | a766cb2 | 2015-06-08 16:49:43 -0700 | [diff] [blame] | 300 | |
John Reck | 3f725f0 | 2015-06-16 10:29:31 -0700 | [diff] [blame] | 301 | bool willHaveFunctor = false; |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 302 | if (info.mode == TreeInfo::MODE_FULL && mStagingDisplayList) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 303 | willHaveFunctor = mStagingDisplayList->hasFunctor(); |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 304 | } else if (mDisplayList) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 305 | willHaveFunctor = mDisplayList->hasFunctor(); |
John Reck | 3f725f0 | 2015-06-16 10:29:31 -0700 | [diff] [blame] | 306 | } |
Chris Craik | a766cb2 | 2015-06-08 16:49:43 -0700 | [diff] [blame] | 307 | bool childFunctorsNeedLayer = mProperties.prepareForFunctorPresence( |
| 308 | willHaveFunctor, functorsNeedLayer); |
| 309 | |
John Reck | f648108 | 2016-02-02 15:18:23 -0800 | [diff] [blame] | 310 | if (CC_UNLIKELY(mPositionListener.get())) { |
| 311 | mPositionListener->onPositionUpdated(*this, info); |
| 312 | } |
| 313 | |
John Reck | a7c2ea2 | 2014-08-08 13:21:00 -0700 | [diff] [blame] | 314 | prepareLayer(info, animatorDirtyMask); |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 315 | if (info.mode == TreeInfo::MODE_FULL) { |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 316 | pushStagingDisplayListChanges(observer, info); |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 317 | } |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 318 | |
Doris Liu | 07c056d | 2016-06-13 12:52:44 -0700 | [diff] [blame] | 319 | if (mDisplayList) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 320 | info.out.hasFunctors |= mDisplayList->hasFunctor(); |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 321 | bool isDirty = mDisplayList->prepareListAndChildren(observer, info, childFunctorsNeedLayer, |
| 322 | [](RenderNode* child, TreeObserver& observer, TreeInfo& info, bool functorsNeedLayer) { |
| 323 | child->prepareTreeImpl(observer, info, functorsNeedLayer); |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 324 | }); |
| 325 | if (isDirty) { |
| 326 | damageSelf(info); |
Doris Liu | 718cd3e | 2016-05-17 16:50:31 -0700 | [diff] [blame] | 327 | } |
Doris Liu | 718cd3e | 2016-05-17 16:50:31 -0700 | [diff] [blame] | 328 | } |
Doris Liu | b51b286 | 2016-08-01 19:56:47 -0700 | [diff] [blame] | 329 | pushLayerUpdate(info); |
Doris Liu | 718cd3e | 2016-05-17 16:50:31 -0700 | [diff] [blame] | 330 | |
John Reck | a447d29 | 2014-06-11 18:39:44 -0700 | [diff] [blame] | 331 | info.damageAccumulator->popTransform(); |
John Reck | f4198b7 | 2014-04-09 17:00:04 -0700 | [diff] [blame] | 332 | } |
| 333 | |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 334 | void RenderNode::syncProperties() { |
| 335 | mProperties = mStagingProperties; |
| 336 | } |
| 337 | |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 338 | void RenderNode::pushStagingPropertiesChanges(TreeInfo& info) { |
John Reck | ff941dc | 2014-05-14 16:34:14 -0700 | [diff] [blame] | 339 | // Push the animators first so that setupStartValueIfNecessary() is called |
| 340 | // before properties() is trampled by stagingProperties(), as they are |
| 341 | // required by some animators. |
John Reck | 9eb9f6f | 2014-08-21 11:23:05 -0700 | [diff] [blame] | 342 | if (CC_LIKELY(info.runAnimations)) { |
John Reck | 119907c | 2014-08-14 09:02:01 -0700 | [diff] [blame] | 343 | mAnimatorManager.pushStaging(); |
John Reck | 9eb9f6f | 2014-08-21 11:23:05 -0700 | [diff] [blame] | 344 | } |
John Reck | ff941dc | 2014-05-14 16:34:14 -0700 | [diff] [blame] | 345 | if (mDirtyPropertyFields) { |
| 346 | mDirtyPropertyFields = 0; |
John Reck | e4267ea | 2014-06-03 15:53:15 -0700 | [diff] [blame] | 347 | damageSelf(info); |
John Reck | a447d29 | 2014-06-11 18:39:44 -0700 | [diff] [blame] | 348 | info.damageAccumulator->popTransform(); |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 349 | syncProperties(); |
John Reck | e4267ea | 2014-06-03 15:53:15 -0700 | [diff] [blame] | 350 | // We could try to be clever and only re-damage if the matrix changed. |
| 351 | // However, we don't need to worry about that. The cost of over-damaging |
| 352 | // here is only going to be a single additional map rect of this node |
| 353 | // plus a rect join(). The parent's transform (and up) will only be |
| 354 | // performed once. |
John Reck | a447d29 | 2014-06-11 18:39:44 -0700 | [diff] [blame] | 355 | info.damageAccumulator->pushTransform(this); |
John Reck | e4267ea | 2014-06-03 15:53:15 -0700 | [diff] [blame] | 356 | damageSelf(info); |
John Reck | ff941dc | 2014-05-14 16:34:14 -0700 | [diff] [blame] | 357 | } |
John Reck | 25fbb3f | 2014-06-12 13:46:45 -0700 | [diff] [blame] | 358 | } |
| 359 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 360 | void RenderNode::syncDisplayList(TreeObserver& observer, TreeInfo* info) { |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 361 | // Make sure we inc first so that we don't fluctuate between 0 and 1, |
| 362 | // which would thrash the layer cache |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 363 | if (mStagingDisplayList) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 364 | mStagingDisplayList->updateChildren([](RenderNode* child) { |
| 365 | child->incParentRefCount(); |
| 366 | }); |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 367 | } |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 368 | deleteDisplayList(observer, info); |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 369 | mDisplayList = mStagingDisplayList; |
| 370 | mStagingDisplayList = nullptr; |
| 371 | if (mDisplayList) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 372 | mDisplayList->syncContents(); |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 373 | } |
| 374 | } |
| 375 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 376 | void RenderNode::pushStagingDisplayListChanges(TreeObserver& observer, TreeInfo& info) { |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 377 | if (mNeedsDisplayListSync) { |
| 378 | mNeedsDisplayListSync = false; |
John Reck | 5c9d717 | 2014-10-22 11:32:27 -0700 | [diff] [blame] | 379 | // Damage with the old display list first then the new one to catch any |
| 380 | // changes in isRenderable or, in the future, bounds |
| 381 | damageSelf(info); |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 382 | syncDisplayList(observer, &info); |
John Reck | e4267ea | 2014-06-03 15:53:15 -0700 | [diff] [blame] | 383 | damageSelf(info); |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 384 | } |
John Reck | 8de65a8 | 2014-04-09 15:23:38 -0700 | [diff] [blame] | 385 | } |
| 386 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 387 | void RenderNode::deleteDisplayList(TreeObserver& observer, TreeInfo* info) { |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 388 | if (mDisplayList) { |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 389 | mDisplayList->updateChildren([&observer, info](RenderNode* child) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 390 | child->decParentRefCount(observer, info); |
| 391 | }); |
| 392 | if (!mDisplayList->reuseDisplayList(this, info ? &info->canvasContext : nullptr)) { |
| 393 | delete mDisplayList; |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 394 | } |
| 395 | } |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 396 | mDisplayList = nullptr; |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 397 | } |
| 398 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 399 | void RenderNode::destroyHardwareResources(TreeInfo* info) { |
Derek Sollenberger | 0df6209 | 2016-09-27 16:04:42 -0400 | [diff] [blame] | 400 | if (hasLayer()) { |
Derek Sollenberger | 6a21ca5 | 2016-09-28 13:39:55 -0400 | [diff] [blame] | 401 | renderthread::CanvasContext::destroyLayer(this); |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 402 | } |
John Reck | 3afd637 | 2017-01-30 10:15:48 -0800 | [diff] [blame] | 403 | setStagingDisplayList(nullptr); |
| 404 | |
| 405 | ImmediateRemoved observer(info); |
| 406 | deleteDisplayList(observer, info); |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 407 | } |
| 408 | |
| 409 | void RenderNode::destroyLayers() { |
| 410 | if (hasLayer()) { |
| 411 | renderthread::CanvasContext::destroyLayer(this); |
| 412 | } |
| 413 | if (mDisplayList) { |
| 414 | mDisplayList->updateChildren([](RenderNode* child) { |
| 415 | child->destroyLayers(); |
| 416 | }); |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | void RenderNode::decParentRefCount(TreeObserver& observer, TreeInfo* info) { |
| 421 | LOG_ALWAYS_FATAL_IF(!mParentCount, "already 0!"); |
| 422 | mParentCount--; |
| 423 | if (!mParentCount) { |
| 424 | observer.onMaybeRemovedFromTree(this); |
| 425 | if (CC_UNLIKELY(mPositionListener.get())) { |
| 426 | mPositionListener->onPositionLost(*this, info); |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
John Reck | 2de950d | 2017-01-25 10:58:30 -0800 | [diff] [blame] | 431 | void RenderNode::onRemovedFromTree(TreeInfo* info) { |
| 432 | destroyHardwareResources(info); |
| 433 | } |
| 434 | |
| 435 | void RenderNode::clearRoot() { |
| 436 | ImmediateRemoved observer(nullptr); |
| 437 | decParentRefCount(observer); |
John Reck | dcba672 | 2014-07-08 13:59:49 -0700 | [diff] [blame] | 438 | } |
| 439 | |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 440 | /** |
| 441 | * Apply property-based transformations to input matrix |
| 442 | * |
| 443 | * If true3dTransform is set to true, the transform applied to the input matrix will use true 4x4 |
| 444 | * matrix computation instead of the Skia 3x3 matrix + camera hackery. |
| 445 | */ |
Chris Craik | 69e5adf | 2014-08-14 13:34:01 -0700 | [diff] [blame] | 446 | void RenderNode::applyViewPropertyTransforms(mat4& matrix, bool true3dTransform) const { |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 447 | if (properties().getLeft() != 0 || properties().getTop() != 0) { |
| 448 | matrix.translate(properties().getLeft(), properties().getTop()); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 449 | } |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 450 | if (properties().getStaticMatrix()) { |
| 451 | mat4 stat(*properties().getStaticMatrix()); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 452 | matrix.multiply(stat); |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 453 | } else if (properties().getAnimationMatrix()) { |
| 454 | mat4 anim(*properties().getAnimationMatrix()); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 455 | matrix.multiply(anim); |
| 456 | } |
Chris Craik | e0bb87d | 2014-04-22 17:55:41 -0700 | [diff] [blame] | 457 | |
Chris Craik | cc39e16 | 2014-04-25 18:34:11 -0700 | [diff] [blame] | 458 | bool applyTranslationZ = true3dTransform && !MathUtils::isZero(properties().getZ()); |
Chris Craik | e0bb87d | 2014-04-22 17:55:41 -0700 | [diff] [blame] | 459 | if (properties().hasTransformMatrix() || applyTranslationZ) { |
John Reck | f7483e3 | 2014-04-11 08:54:47 -0700 | [diff] [blame] | 460 | if (properties().isTransformTranslateOnly()) { |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 461 | matrix.translate(properties().getTranslationX(), properties().getTranslationY(), |
Chris Craik | cc39e16 | 2014-04-25 18:34:11 -0700 | [diff] [blame] | 462 | true3dTransform ? properties().getZ() : 0.0f); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 463 | } else { |
| 464 | if (!true3dTransform) { |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 465 | matrix.multiply(*properties().getTransformMatrix()); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 466 | } else { |
| 467 | mat4 true3dMat; |
| 468 | true3dMat.loadTranslate( |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 469 | properties().getPivotX() + properties().getTranslationX(), |
| 470 | properties().getPivotY() + properties().getTranslationY(), |
Chris Craik | cc39e16 | 2014-04-25 18:34:11 -0700 | [diff] [blame] | 471 | properties().getZ()); |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 472 | true3dMat.rotate(properties().getRotationX(), 1, 0, 0); |
| 473 | true3dMat.rotate(properties().getRotationY(), 0, 1, 0); |
| 474 | true3dMat.rotate(properties().getRotation(), 0, 0, 1); |
| 475 | true3dMat.scale(properties().getScaleX(), properties().getScaleY(), 1); |
| 476 | true3dMat.translate(-properties().getPivotX(), -properties().getPivotY()); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 477 | |
| 478 | matrix.multiply(true3dMat); |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | /** |
| 485 | * Organizes the DisplayList hierarchy to prepare for background projection reordering. |
| 486 | * |
| 487 | * This should be called before a call to defer() or drawDisplayList() |
| 488 | * |
| 489 | * Each DisplayList that serves as a 3d root builds its list of composited children, |
| 490 | * which are flagged to not draw in the standard draw loop. |
| 491 | */ |
| 492 | void RenderNode::computeOrdering() { |
| 493 | ATRACE_CALL(); |
| 494 | mProjectedNodes.clear(); |
| 495 | |
| 496 | // TODO: create temporary DDLOp and call computeOrderingImpl on top DisplayList so that |
| 497 | // transform properties are applied correctly to top level children |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 498 | if (mDisplayList == nullptr) return; |
Chris Craik | b36af87 | 2015-10-16 14:23:12 -0700 | [diff] [blame] | 499 | for (unsigned int i = 0; i < mDisplayList->getChildren().size(); i++) { |
Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 500 | RenderNodeOp* childOp = mDisplayList->getChildren()[i]; |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 501 | childOp->renderNode->computeOrderingImpl(childOp, &mProjectedNodes, &mat4::identity()); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 502 | } |
| 503 | } |
| 504 | |
| 505 | void RenderNode::computeOrderingImpl( |
Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 506 | RenderNodeOp* opState, |
| 507 | std::vector<RenderNodeOp*>* compositedChildrenOfProjectionSurface, |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 508 | const mat4* transformFromProjectionSurface) { |
| 509 | mProjectedNodes.clear(); |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 510 | if (mDisplayList == nullptr || mDisplayList->isEmpty()) return; |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 511 | |
| 512 | // TODO: should avoid this calculation in most cases |
| 513 | // TODO: just calculate single matrix, down to all leaf composited elements |
| 514 | Matrix4 localTransformFromProjectionSurface(*transformFromProjectionSurface); |
Chris Craik | 8d1f212 | 2015-11-24 16:40:09 -0800 | [diff] [blame] | 515 | localTransformFromProjectionSurface.multiply(opState->localMatrix); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 516 | |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 517 | if (properties().getProjectBackwards()) { |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 518 | // composited projectee, flag for out of order draw, save matrix, and store in proj surface |
Chris Craik | 8d1f212 | 2015-11-24 16:40:09 -0800 | [diff] [blame] | 519 | opState->skipInOrderDraw = true; |
| 520 | opState->transformFromCompositingAncestor = localTransformFromProjectionSurface; |
John Reck | 272a685 | 2015-07-29 16:48:58 -0700 | [diff] [blame] | 521 | compositedChildrenOfProjectionSurface->push_back(opState); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 522 | } else { |
| 523 | // standard in order draw |
Chris Craik | 8d1f212 | 2015-11-24 16:40:09 -0800 | [diff] [blame] | 524 | opState->skipInOrderDraw = false; |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 525 | } |
| 526 | |
Chris Craik | b36af87 | 2015-10-16 14:23:12 -0700 | [diff] [blame] | 527 | if (mDisplayList->getChildren().size() > 0) { |
Chris Craik | 003cc3d | 2015-10-16 10:24:55 -0700 | [diff] [blame] | 528 | const bool isProjectionReceiver = mDisplayList->projectionReceiveIndex >= 0; |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 529 | bool haveAppliedPropertiesToProjection = false; |
Chris Craik | b36af87 | 2015-10-16 14:23:12 -0700 | [diff] [blame] | 530 | for (unsigned int i = 0; i < mDisplayList->getChildren().size(); i++) { |
Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 531 | RenderNodeOp* childOp = mDisplayList->getChildren()[i]; |
Chris Craik | b565df1 | 2015-10-05 13:00:52 -0700 | [diff] [blame] | 532 | RenderNode* child = childOp->renderNode; |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 533 | |
Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 534 | std::vector<RenderNodeOp*>* projectionChildren = nullptr; |
Chris Craik | d41c4d8 | 2015-01-05 15:51:13 -0800 | [diff] [blame] | 535 | const mat4* projectionTransform = nullptr; |
John Reck | d0a0b2a | 2014-03-20 16:28:56 -0700 | [diff] [blame] | 536 | if (isProjectionReceiver && !child->properties().getProjectBackwards()) { |
Chris Craik | bf72eb8 | 2015-06-08 11:30:44 -0700 | [diff] [blame] | 537 | // if receiving projections, collect projecting descendant |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 538 | |
Chris Craik | bf72eb8 | 2015-06-08 11:30:44 -0700 | [diff] [blame] | 539 | // Note that if a direct descendant is projecting backwards, we pass its |
| 540 | // grandparent projection collection, since it shouldn't project onto its |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 541 | // parent, where it will already be drawing. |
| 542 | projectionChildren = &mProjectedNodes; |
| 543 | projectionTransform = &mat4::identity(); |
| 544 | } else { |
| 545 | if (!haveAppliedPropertiesToProjection) { |
| 546 | applyViewPropertyTransforms(localTransformFromProjectionSurface); |
| 547 | haveAppliedPropertiesToProjection = true; |
| 548 | } |
| 549 | projectionChildren = compositedChildrenOfProjectionSurface; |
| 550 | projectionTransform = &localTransformFromProjectionSurface; |
| 551 | } |
Derek Sollenberger | f293259 | 2015-08-13 14:59:33 -0400 | [diff] [blame] | 552 | child->computeOrderingImpl(childOp, projectionChildren, projectionTransform); |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 553 | } |
| 554 | } |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 555 | } |
| 556 | |
John Reck | 113e082 | 2014-03-18 09:22:59 -0700 | [diff] [blame] | 557 | } /* namespace uirenderer */ |
| 558 | } /* namespace android */ |