Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
| 17 | //#define LOG_NDEBUG 0 |
| 18 | #undef LOG_TAG |
| 19 | #define LOG_TAG "BufferStateLayer" |
| 20 | #define ATRACE_TAG ATRACE_TAG_GRAPHICS |
| 21 | |
| 22 | #include "BufferStateLayer.h" |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 23 | |
Yiwei Zhang | 7e666a5 | 2018-11-15 13:33:42 -0800 | [diff] [blame] | 24 | #include "TimeStats/TimeStats.h" |
| 25 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 26 | #include <private/gui/SyncFeatures.h> |
Peiyong Lin | cbc184f | 2018-08-22 13:24:10 -0700 | [diff] [blame] | 27 | #include <renderengine/Image.h> |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 28 | |
Valerie Hau | 0bc0915 | 2018-12-20 07:42:47 -0800 | [diff] [blame] | 29 | #include <limits> |
| 30 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 31 | namespace android { |
| 32 | |
Lloyd Pique | 42ab75e | 2018-09-12 20:46:03 -0700 | [diff] [blame] | 33 | // clang-format off |
| 34 | const std::array<float, 16> BufferStateLayer::IDENTITY_MATRIX{ |
| 35 | 1, 0, 0, 0, |
| 36 | 0, 1, 0, 0, |
| 37 | 0, 0, 1, 0, |
| 38 | 0, 0, 0, 1 |
| 39 | }; |
| 40 | // clang-format on |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 41 | |
Vishnu Nair | 6035634 | 2018-11-13 13:00:45 -0800 | [diff] [blame] | 42 | BufferStateLayer::BufferStateLayer(const LayerCreationArgs& args) : BufferLayer(args) { |
| 43 | mOverrideScalingMode = NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW; |
| 44 | } |
Lloyd Pique | 42ab75e | 2018-09-12 20:46:03 -0700 | [diff] [blame] | 45 | BufferStateLayer::~BufferStateLayer() = default; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 46 | |
| 47 | // ----------------------------------------------------------------------- |
| 48 | // Interface implementation for Layer |
| 49 | // ----------------------------------------------------------------------- |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 50 | void BufferStateLayer::onLayerDisplayed(const sp<Fence>& releaseFence) { |
| 51 | // The transaction completed callback can only be sent if the release fence from the PREVIOUS |
| 52 | // frame has fired. In practice, we should never actually wait on the previous release fence |
| 53 | // but we should store it just in case. |
| 54 | mPreviousReleaseFence = releaseFence; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | void BufferStateLayer::setTransformHint(uint32_t /*orientation*/) const { |
| 58 | // TODO(marissaw): send the transform hint to buffer owner |
| 59 | return; |
| 60 | } |
| 61 | |
| 62 | void BufferStateLayer::releasePendingBuffer(nsecs_t /*dequeueReadyTime*/) { |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 63 | return; |
| 64 | } |
| 65 | |
Ana Krulec | 010d219 | 2018-10-08 06:29:54 -0700 | [diff] [blame] | 66 | bool BufferStateLayer::shouldPresentNow(nsecs_t /*expectedPresentTime*/) const { |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 67 | if (getSidebandStreamChanged() || getAutoRefresh()) { |
| 68 | return true; |
| 69 | } |
| 70 | |
Marissa Wall | 024a191 | 2018-08-13 13:55:35 -0700 | [diff] [blame] | 71 | return hasFrameUpdate(); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 74 | bool BufferStateLayer::willPresentCurrentTransaction() const { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 75 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 76 | // Returns true if the most recent Transaction applied to CurrentState will be presented. |
| 77 | return getSidebandStreamChanged() || getAutoRefresh() || |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 78 | (mState.current.modified && mState.current.buffer != nullptr); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 79 | } |
| 80 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 81 | bool BufferStateLayer::getTransformToDisplayInverseLocked() const { |
| 82 | return mState.current.transformToDisplayInverse; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 85 | void BufferStateLayer::pushPendingStateLocked() { |
| 86 | if (!mState.current.modified) { |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 87 | return; |
| 88 | } |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 89 | mState.pending.push_back(mState.current); |
| 90 | ATRACE_INT(mTransactionName.string(), mState.pending.size()); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | bool BufferStateLayer::applyPendingStates(Layer::State* stateToCommit) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 94 | const bool stateUpdateAvailable = !mState.pending.empty(); |
| 95 | while (!mState.pending.empty()) { |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 96 | popPendingState(stateToCommit); |
| 97 | } |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 98 | mCurrentStateModified = stateUpdateAvailable && mState.current.modified; |
| 99 | mState.current.modified = false; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 100 | return stateUpdateAvailable; |
| 101 | } |
| 102 | |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 103 | // Crop that applies to the window |
| 104 | Rect BufferStateLayer::getCrop(const Layer::State& /*s*/) const { |
| 105 | return Rect::INVALID_RECT; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | bool BufferStateLayer::setTransform(uint32_t transform) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 109 | Mutex::Autolock lock(mStateMutex); |
| 110 | if (mState.current.transform == transform) return false; |
| 111 | mState.current.sequence++; |
| 112 | mState.current.transform = transform; |
| 113 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 114 | setTransactionFlags(eTransactionNeeded); |
| 115 | return true; |
| 116 | } |
| 117 | |
| 118 | bool BufferStateLayer::setTransformToDisplayInverse(bool transformToDisplayInverse) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 119 | Mutex::Autolock lock(mStateMutex); |
| 120 | if (mState.current.transformToDisplayInverse == transformToDisplayInverse) return false; |
| 121 | mState.current.sequence++; |
| 122 | mState.current.transformToDisplayInverse = transformToDisplayInverse; |
| 123 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 124 | setTransactionFlags(eTransactionNeeded); |
| 125 | return true; |
| 126 | } |
| 127 | |
| 128 | bool BufferStateLayer::setCrop(const Rect& crop) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 129 | Mutex::Autolock lock(mStateMutex); |
| 130 | if (mState.current.crop == crop) return false; |
| 131 | mState.current.sequence++; |
| 132 | mState.current.crop = crop; |
| 133 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 134 | setTransactionFlags(eTransactionNeeded); |
| 135 | return true; |
| 136 | } |
| 137 | |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 138 | bool BufferStateLayer::setFrame(const Rect& frame) { |
| 139 | int x = frame.left; |
| 140 | int y = frame.top; |
| 141 | int w = frame.getWidth(); |
| 142 | int h = frame.getHeight(); |
| 143 | |
Marissa Wall | 0f3242d | 2018-12-20 15:10:22 -0800 | [diff] [blame] | 144 | if (x < 0) { |
| 145 | x = 0; |
| 146 | w = frame.right; |
| 147 | } |
| 148 | |
| 149 | if (y < 0) { |
| 150 | y = 0; |
| 151 | h = frame.bottom; |
| 152 | } |
| 153 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 154 | Mutex::Autolock lock(mStateMutex); |
| 155 | if (mState.current.active.transform.tx() == x && mState.current.active.transform.ty() == y && |
| 156 | mState.current.active.w == w && mState.current.active.h == h) { |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 157 | return false; |
| 158 | } |
| 159 | |
| 160 | if (!frame.isValid()) { |
| 161 | x = y = w = h = 0; |
| 162 | } |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 163 | mState.current.active.transform.set(x, y); |
| 164 | mState.current.active.w = w; |
| 165 | mState.current.active.h = h; |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 166 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 167 | mState.current.sequence++; |
| 168 | mState.current.modified = true; |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 169 | setTransactionFlags(eTransactionNeeded); |
| 170 | return true; |
| 171 | } |
| 172 | |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 173 | bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 174 | Mutex::Autolock lock(mStateMutex); |
| 175 | if (mState.current.buffer) { |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 176 | mReleasePreviousBuffer = true; |
| 177 | } |
| 178 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 179 | mState.current.sequence++; |
| 180 | mState.current.buffer = buffer; |
| 181 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 182 | setTransactionFlags(eTransactionNeeded); |
| 183 | return true; |
| 184 | } |
| 185 | |
| 186 | bool BufferStateLayer::setAcquireFence(const sp<Fence>& fence) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 187 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 188 | // The acquire fences of BufferStateLayers have already signaled before they are set |
| 189 | mCallbackHandleAcquireTime = fence->getSignalTime(); |
| 190 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 191 | mState.current.acquireFence = fence; |
| 192 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 193 | setTransactionFlags(eTransactionNeeded); |
| 194 | return true; |
| 195 | } |
| 196 | |
| 197 | bool BufferStateLayer::setDataspace(ui::Dataspace dataspace) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 198 | Mutex::Autolock lock(mStateMutex); |
| 199 | if (mState.current.dataspace == dataspace) return false; |
| 200 | mState.current.sequence++; |
| 201 | mState.current.dataspace = dataspace; |
| 202 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 203 | setTransactionFlags(eTransactionNeeded); |
| 204 | return true; |
| 205 | } |
| 206 | |
| 207 | bool BufferStateLayer::setHdrMetadata(const HdrMetadata& hdrMetadata) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 208 | Mutex::Autolock lock(mStateMutex); |
| 209 | if (mState.current.hdrMetadata == hdrMetadata) return false; |
| 210 | mState.current.sequence++; |
| 211 | mState.current.hdrMetadata = hdrMetadata; |
| 212 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 213 | setTransactionFlags(eTransactionNeeded); |
| 214 | return true; |
| 215 | } |
| 216 | |
| 217 | bool BufferStateLayer::setSurfaceDamageRegion(const Region& surfaceDamage) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 218 | Mutex::Autolock lock(mStateMutex); |
| 219 | mState.current.sequence++; |
| 220 | mState.current.surfaceDamageRegion = surfaceDamage; |
| 221 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 222 | setTransactionFlags(eTransactionNeeded); |
| 223 | return true; |
| 224 | } |
| 225 | |
| 226 | bool BufferStateLayer::setApi(int32_t api) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 227 | Mutex::Autolock lock(mStateMutex); |
| 228 | if (mState.current.api == api) return false; |
| 229 | mState.current.sequence++; |
| 230 | mState.current.api = api; |
| 231 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 232 | setTransactionFlags(eTransactionNeeded); |
| 233 | return true; |
| 234 | } |
| 235 | |
| 236 | bool BufferStateLayer::setSidebandStream(const sp<NativeHandle>& sidebandStream) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 237 | Mutex::Autolock lock(mStateMutex); |
| 238 | if (mState.current.sidebandStream == sidebandStream) return false; |
| 239 | mState.current.sequence++; |
| 240 | mState.current.sidebandStream = sidebandStream; |
| 241 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 242 | setTransactionFlags(eTransactionNeeded); |
| 243 | |
| 244 | if (!mSidebandStreamChanged.exchange(true)) { |
| 245 | // mSidebandStreamChanged was false |
| 246 | mFlinger->signalLayerUpdate(); |
| 247 | } |
| 248 | return true; |
| 249 | } |
| 250 | |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 251 | bool BufferStateLayer::setTransactionCompletedListeners( |
| 252 | const std::vector<sp<CallbackHandle>>& handles) { |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 253 | // If there is no handle, we will not send a callback so reset mReleasePreviousBuffer and return |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 254 | if (handles.empty()) { |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 255 | mReleasePreviousBuffer = false; |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 256 | return false; |
| 257 | } |
| 258 | |
| 259 | const bool willPresent = willPresentCurrentTransaction(); |
| 260 | |
| 261 | for (const auto& handle : handles) { |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 262 | // If this transaction set a buffer on this layer, release its previous buffer |
| 263 | handle->releasePreviousBuffer = mReleasePreviousBuffer; |
| 264 | |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 265 | // If this layer will be presented in this frame |
| 266 | if (willPresent) { |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 267 | // If this transaction set an acquire fence on this layer, set its acquire time |
| 268 | handle->acquireTime = mCallbackHandleAcquireTime; |
| 269 | |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 270 | // Notify the transaction completed thread that there is a pending latched callback |
| 271 | // handle |
| 272 | mFlinger->getTransactionCompletedThread().registerPendingLatchedCallbackHandle(handle); |
| 273 | |
| 274 | // Store so latched time and release fence can be set |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 275 | { |
| 276 | Mutex::Autolock lock(mStateMutex); |
| 277 | mState.current.callbackHandles.push_back(handle); |
| 278 | } |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 279 | |
| 280 | } else { // If this layer will NOT need to be relatched and presented this frame |
| 281 | // Notify the transaction completed thread this handle is done |
| 282 | mFlinger->getTransactionCompletedThread().addUnlatchedCallbackHandle(handle); |
| 283 | } |
| 284 | } |
| 285 | |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 286 | mReleasePreviousBuffer = false; |
| 287 | mCallbackHandleAcquireTime = -1; |
| 288 | |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 289 | return willPresent; |
| 290 | } |
| 291 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 292 | bool BufferStateLayer::setTransparentRegionHint(const Region& transparent) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 293 | Mutex::Autolock lock(mStateMutex); |
| 294 | mState.current.transparentRegionHint = transparent; |
| 295 | mState.current.modified = true; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 296 | setTransactionFlags(eTransactionNeeded); |
| 297 | return true; |
| 298 | } |
| 299 | |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 300 | Rect BufferStateLayer::getBufferSize(const State& s) const { |
| 301 | // for buffer state layers we use the display frame size as the buffer size. |
| 302 | if (getActiveWidth(s) < UINT32_MAX && getActiveHeight(s) < UINT32_MAX) { |
| 303 | return Rect(getActiveWidth(s), getActiveHeight(s)); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 306 | // if the display frame is not defined, use the parent bounds as the buffer size. |
| 307 | const auto& p = mDrawingParent.promote(); |
| 308 | if (p != nullptr) { |
| 309 | Rect parentBounds = Rect(p->computeBounds(Region())); |
| 310 | if (!parentBounds.isEmpty()) { |
| 311 | return parentBounds; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | // if there is no parent layer, use the buffer's bounds as the buffer size |
| 316 | if (s.buffer) { |
| 317 | return s.buffer->getBounds(); |
| 318 | } |
| 319 | return Rect::INVALID_RECT; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 320 | } |
| 321 | // ----------------------------------------------------------------------- |
| 322 | |
| 323 | // ----------------------------------------------------------------------- |
| 324 | // Interface implementation for BufferLayer |
| 325 | // ----------------------------------------------------------------------- |
| 326 | bool BufferStateLayer::fenceHasSignaled() const { |
| 327 | if (latchUnsignaledBuffers()) { |
| 328 | return true; |
| 329 | } |
| 330 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 331 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 332 | return getDrawingState().acquireFence->getStatus() == Fence::Status::Signaled; |
| 333 | } |
| 334 | |
| 335 | nsecs_t BufferStateLayer::getDesiredPresentTime() { |
| 336 | // TODO(marissaw): support an equivalent to desiredPresentTime for timestats metrics |
| 337 | return 0; |
| 338 | } |
| 339 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 340 | std::shared_ptr<FenceTime> BufferStateLayer::getCurrentFenceTimeLocked() const { |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 341 | return std::make_shared<FenceTime>(getDrawingState().acquireFence); |
| 342 | } |
| 343 | |
| 344 | void BufferStateLayer::getDrawingTransformMatrix(float *matrix) { |
| 345 | std::copy(std::begin(mTransformMatrix), std::end(mTransformMatrix), matrix); |
| 346 | } |
| 347 | |
| 348 | uint32_t BufferStateLayer::getDrawingTransform() const { |
| 349 | return getDrawingState().transform; |
| 350 | } |
| 351 | |
| 352 | ui::Dataspace BufferStateLayer::getDrawingDataSpace() const { |
| 353 | return getDrawingState().dataspace; |
| 354 | } |
| 355 | |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 356 | // Crop that applies to the buffer |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 357 | Rect BufferStateLayer::getDrawingCrop() const { |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 358 | const State& s(getDrawingState()); |
| 359 | |
| 360 | if (s.crop.isEmpty() && s.buffer) { |
| 361 | return s.buffer->getBounds(); |
Valerie Hau | 0bc0915 | 2018-12-20 07:42:47 -0800 | [diff] [blame] | 362 | } else if (s.buffer) { |
| 363 | Rect crop = s.crop; |
| 364 | crop.left = std::max(crop.left, 0); |
| 365 | crop.top = std::max(crop.top, 0); |
| 366 | uint32_t bufferWidth = s.buffer->getWidth(); |
| 367 | uint32_t bufferHeight = s.buffer->getHeight(); |
| 368 | if (bufferHeight <= std::numeric_limits<int32_t>::max() && |
| 369 | bufferWidth <= std::numeric_limits<int32_t>::max()) { |
| 370 | crop.right = std::min(crop.right, static_cast<int32_t>(bufferWidth)); |
| 371 | crop.bottom = std::min(crop.bottom, static_cast<int32_t>(bufferHeight)); |
| 372 | } |
| 373 | if (!crop.isValid()) { |
| 374 | // Crop rect is out of bounds, return whole buffer |
| 375 | return s.buffer->getBounds(); |
| 376 | } |
| 377 | return crop; |
Marissa Wall | 861616d | 2018-10-22 12:52:23 -0700 | [diff] [blame] | 378 | } |
| 379 | return s.crop; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | uint32_t BufferStateLayer::getDrawingScalingMode() const { |
Marissa Wall | ec463ac | 2018-10-08 12:35:04 -0700 | [diff] [blame] | 383 | return NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 384 | } |
| 385 | |
| 386 | Region BufferStateLayer::getDrawingSurfaceDamage() const { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 387 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 388 | return getDrawingState().surfaceDamageRegion; |
| 389 | } |
| 390 | |
| 391 | const HdrMetadata& BufferStateLayer::getDrawingHdrMetadata() const { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 392 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 393 | return getDrawingState().hdrMetadata; |
| 394 | } |
| 395 | |
| 396 | int BufferStateLayer::getDrawingApi() const { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 397 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 398 | return getDrawingState().api; |
| 399 | } |
| 400 | |
| 401 | PixelFormat BufferStateLayer::getPixelFormat() const { |
Marissa Wall | 5aec641 | 2018-11-14 11:49:18 -0800 | [diff] [blame] | 402 | if (!mActiveBuffer) { |
| 403 | return PIXEL_FORMAT_NONE; |
| 404 | } |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 405 | return mActiveBuffer->format; |
| 406 | } |
| 407 | |
| 408 | uint64_t BufferStateLayer::getFrameNumber() const { |
| 409 | return mFrameNumber; |
| 410 | } |
| 411 | |
| 412 | bool BufferStateLayer::getAutoRefresh() const { |
| 413 | // TODO(marissaw): support shared buffer mode |
| 414 | return false; |
| 415 | } |
| 416 | |
| 417 | bool BufferStateLayer::getSidebandStreamChanged() const { |
| 418 | return mSidebandStreamChanged.load(); |
| 419 | } |
| 420 | |
| 421 | std::optional<Region> BufferStateLayer::latchSidebandStream(bool& recomputeVisibleRegions) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 422 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 423 | if (mSidebandStreamChanged.exchange(false)) { |
| 424 | const State& s(getDrawingState()); |
| 425 | // mSidebandStreamChanged was true |
| 426 | // replicated in LayerBE until FE/BE is ready to be synchronized |
| 427 | getBE().compositionInfo.hwc.sidebandStream = s.sidebandStream; |
| 428 | if (getBE().compositionInfo.hwc.sidebandStream != nullptr) { |
| 429 | setTransactionFlags(eTransactionNeeded); |
| 430 | mFlinger->setTransactionFlags(eTraversalNeeded); |
| 431 | } |
| 432 | recomputeVisibleRegions = true; |
| 433 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 434 | return getTransformLocked().transform(Region(Rect(s.active.w, s.active.h))); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 435 | } |
| 436 | return {}; |
| 437 | } |
| 438 | |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 439 | bool BufferStateLayer::hasFrameUpdateLocked() const { |
Marissa Wall | 024a191 | 2018-08-13 13:55:35 -0700 | [diff] [blame] | 440 | return mCurrentStateModified && getCurrentState().buffer != nullptr; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 441 | } |
| 442 | |
| 443 | void BufferStateLayer::setFilteringEnabled(bool enabled) { |
| 444 | GLConsumer::computeTransformMatrix(mTransformMatrix.data(), mActiveBuffer, mCurrentCrop, |
| 445 | mCurrentTransform, enabled); |
| 446 | } |
| 447 | |
Alec Mouri | 39801c0 | 2018-10-10 10:44:47 -0700 | [diff] [blame] | 448 | status_t BufferStateLayer::bindTextureImage() { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 449 | Mutex::Autolock lock(mStateMutex); |
| 450 | return bindTextureImageLocked(); |
| 451 | } |
| 452 | status_t BufferStateLayer::bindTextureImageLocked() { |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 453 | const State& s(getDrawingState()); |
| 454 | auto& engine(mFlinger->getRenderEngine()); |
| 455 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 456 | engine.checkErrors(); |
| 457 | |
Alec Mouri | 39801c0 | 2018-10-10 10:44:47 -0700 | [diff] [blame] | 458 | // TODO(marissaw): once buffers are cached, don't create a new image everytime |
| 459 | mTextureImage = engine.createImage(); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 460 | |
| 461 | bool created = |
| 462 | mTextureImage->setNativeWindowBuffer(s.buffer->getNativeBuffer(), |
| 463 | s.buffer->getUsage() & GRALLOC_USAGE_PROTECTED); |
| 464 | if (!created) { |
| 465 | ALOGE("Failed to create image. size=%ux%u st=%u usage=%#" PRIx64 " fmt=%d", |
| 466 | s.buffer->getWidth(), s.buffer->getHeight(), s.buffer->getStride(), |
| 467 | s.buffer->getUsage(), s.buffer->getPixelFormat()); |
| 468 | engine.bindExternalTextureImage(mTextureName, *engine.createImage()); |
| 469 | return NO_INIT; |
| 470 | } |
| 471 | |
| 472 | engine.bindExternalTextureImage(mTextureName, *mTextureImage); |
| 473 | |
| 474 | // Wait for the new buffer to be ready. |
| 475 | if (s.acquireFence->isValid()) { |
| 476 | if (SyncFeatures::getInstance().useWaitSync()) { |
| 477 | base::unique_fd fenceFd(s.acquireFence->dup()); |
| 478 | if (fenceFd == -1) { |
| 479 | ALOGE("error dup'ing fence fd: %d", errno); |
| 480 | return -errno; |
| 481 | } |
| 482 | if (!engine.waitFence(std::move(fenceFd))) { |
| 483 | ALOGE("failed to wait on fence fd"); |
| 484 | return UNKNOWN_ERROR; |
| 485 | } |
| 486 | } else { |
| 487 | status_t err = s.acquireFence->waitForever("BufferStateLayer::bindTextureImage"); |
| 488 | if (err != NO_ERROR) { |
| 489 | ALOGE("error waiting for fence: %d", err); |
| 490 | return err; |
| 491 | } |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | return NO_ERROR; |
| 496 | } |
| 497 | |
Alec Mouri | 86770e5 | 2018-09-24 22:40:58 +0000 | [diff] [blame] | 498 | status_t BufferStateLayer::updateTexImage(bool& /*recomputeVisibleRegions*/, nsecs_t latchTime, |
| 499 | const sp<Fence>& releaseFence) { |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 500 | const State& s(getDrawingState()); |
| 501 | |
| 502 | if (!s.buffer) { |
| 503 | return NO_ERROR; |
| 504 | } |
| 505 | |
Yiwei Zhang | 9689e2f | 2018-05-11 12:33:23 -0700 | [diff] [blame] | 506 | const int32_t layerID = getSequence(); |
| 507 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 508 | // Reject if the layer is invalid |
| 509 | uint32_t bufferWidth = s.buffer->width; |
| 510 | uint32_t bufferHeight = s.buffer->height; |
| 511 | |
Peiyong Lin | efefaac | 2018-08-17 12:27:51 -0700 | [diff] [blame] | 512 | if (s.transform & ui::Transform::ROT_90) { |
Peiyong Lin | 3db4234 | 2018-08-16 09:15:59 -0700 | [diff] [blame] | 513 | std::swap(bufferWidth, bufferHeight); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | if (s.transformToDisplayInverse) { |
| 517 | uint32_t invTransform = DisplayDevice::getPrimaryDisplayOrientationTransform(); |
Peiyong Lin | efefaac | 2018-08-17 12:27:51 -0700 | [diff] [blame] | 518 | if (invTransform & ui::Transform::ROT_90) { |
Peiyong Lin | 3db4234 | 2018-08-16 09:15:59 -0700 | [diff] [blame] | 519 | std::swap(bufferWidth, bufferHeight); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 520 | } |
| 521 | } |
| 522 | |
Vishnu Nair | 6035634 | 2018-11-13 13:00:45 -0800 | [diff] [blame] | 523 | if (getEffectiveScalingMode() == NATIVE_WINDOW_SCALING_MODE_FREEZE && |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 524 | (s.active.w != bufferWidth || s.active.h != bufferHeight)) { |
| 525 | ALOGE("[%s] rejecting buffer: " |
| 526 | "bufferWidth=%d, bufferHeight=%d, front.active.{w=%d, h=%d}", |
| 527 | mName.string(), bufferWidth, bufferHeight, s.active.w, s.active.h); |
Yiwei Zhang | 7e666a5 | 2018-11-15 13:33:42 -0800 | [diff] [blame] | 528 | mFlinger->mTimeStats->removeTimeRecord(layerID, getFrameNumber()); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 529 | return BAD_VALUE; |
| 530 | } |
| 531 | |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 532 | mFlinger->getTransactionCompletedThread() |
| 533 | .addLatchedCallbackHandles(getDrawingState().callbackHandles, latchTime, |
| 534 | mPreviousReleaseFence); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 535 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 536 | // Handle sync fences |
Alec Mouri | 86770e5 | 2018-09-24 22:40:58 +0000 | [diff] [blame] | 537 | if (SyncFeatures::getInstance().useNativeFenceSync() && releaseFence != Fence::NO_FENCE) { |
| 538 | // TODO(alecmouri): Fail somewhere upstream if the fence is invalid. |
| 539 | if (!releaseFence->isValid()) { |
Yiwei Zhang | af8ee94 | 2018-11-22 00:15:23 -0800 | [diff] [blame] | 540 | mFlinger->mTimeStats->onDestroy(layerID); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 541 | return UNKNOWN_ERROR; |
| 542 | } |
| 543 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 544 | // Check status of fences first because merging is expensive. |
| 545 | // Merging an invalid fence with any other fence results in an |
| 546 | // invalid fence. |
| 547 | auto currentStatus = s.acquireFence->getStatus(); |
| 548 | if (currentStatus == Fence::Status::Invalid) { |
| 549 | ALOGE("Existing fence has invalid state"); |
Yiwei Zhang | af8ee94 | 2018-11-22 00:15:23 -0800 | [diff] [blame] | 550 | mFlinger->mTimeStats->onDestroy(layerID); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 551 | return BAD_VALUE; |
| 552 | } |
| 553 | |
Alec Mouri | 86770e5 | 2018-09-24 22:40:58 +0000 | [diff] [blame] | 554 | auto incomingStatus = releaseFence->getStatus(); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 555 | if (incomingStatus == Fence::Status::Invalid) { |
| 556 | ALOGE("New fence has invalid state"); |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 557 | mState.drawing.acquireFence = releaseFence; |
Yiwei Zhang | af8ee94 | 2018-11-22 00:15:23 -0800 | [diff] [blame] | 558 | mFlinger->mTimeStats->onDestroy(layerID); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 559 | return BAD_VALUE; |
| 560 | } |
| 561 | |
| 562 | // If both fences are signaled or both are unsignaled, we need to merge |
| 563 | // them to get an accurate timestamp. |
| 564 | if (currentStatus == incomingStatus) { |
| 565 | char fenceName[32] = {}; |
| 566 | snprintf(fenceName, 32, "%.28s:%d", mName.string(), mFrameNumber); |
Alec Mouri | 86770e5 | 2018-09-24 22:40:58 +0000 | [diff] [blame] | 567 | sp<Fence> mergedFence = |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 568 | Fence::merge(fenceName, mState.drawing.acquireFence, releaseFence); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 569 | if (!mergedFence.get()) { |
| 570 | ALOGE("failed to merge release fences"); |
| 571 | // synchronization is broken, the best we can do is hope fences |
| 572 | // signal in order so the new fence will act like a union |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 573 | mState.drawing.acquireFence = releaseFence; |
Yiwei Zhang | af8ee94 | 2018-11-22 00:15:23 -0800 | [diff] [blame] | 574 | mFlinger->mTimeStats->onDestroy(layerID); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 575 | return BAD_VALUE; |
| 576 | } |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 577 | mState.drawing.acquireFence = mergedFence; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 578 | } else if (incomingStatus == Fence::Status::Unsignaled) { |
| 579 | // If one fence has signaled and the other hasn't, the unsignaled |
| 580 | // fence will approximately correspond with the correct timestamp. |
| 581 | // There's a small race if both fences signal at about the same time |
| 582 | // and their statuses are retrieved with unfortunate timing. However, |
| 583 | // by this point, they will have both signaled and only the timestamp |
| 584 | // will be slightly off; any dependencies after this point will |
| 585 | // already have been met. |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 586 | mState.drawing.acquireFence = releaseFence; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 587 | } |
| 588 | } else { |
| 589 | // Bind the new buffer to the GL texture. |
| 590 | // |
| 591 | // Older devices require the "implicit" synchronization provided |
| 592 | // by glEGLImageTargetTexture2DOES, which this method calls. Newer |
| 593 | // devices will either call this in Layer::onDraw, or (if it's not |
| 594 | // a GL-composited layer) not at all. |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 595 | status_t err = bindTextureImageLocked(); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 596 | if (err != NO_ERROR) { |
Yiwei Zhang | af8ee94 | 2018-11-22 00:15:23 -0800 | [diff] [blame] | 597 | mFlinger->mTimeStats->onDestroy(layerID); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 598 | return BAD_VALUE; |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | // TODO(marissaw): properly support mTimeStats |
Yiwei Zhang | 7e666a5 | 2018-11-15 13:33:42 -0800 | [diff] [blame] | 603 | mFlinger->mTimeStats->setPostTime(layerID, getFrameNumber(), getName().c_str(), latchTime); |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 604 | mFlinger->mTimeStats->setAcquireFence(layerID, getFrameNumber(), getCurrentFenceTimeLocked()); |
Yiwei Zhang | 7e666a5 | 2018-11-15 13:33:42 -0800 | [diff] [blame] | 605 | mFlinger->mTimeStats->setLatchTime(layerID, getFrameNumber(), latchTime); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 606 | |
| 607 | return NO_ERROR; |
| 608 | } |
| 609 | |
| 610 | status_t BufferStateLayer::updateActiveBuffer() { |
| 611 | const State& s(getDrawingState()); |
| 612 | |
| 613 | if (s.buffer == nullptr) { |
| 614 | return BAD_VALUE; |
| 615 | } |
| 616 | |
| 617 | mActiveBuffer = s.buffer; |
| 618 | getBE().compositionInfo.mBuffer = mActiveBuffer; |
| 619 | getBE().compositionInfo.mBufferSlot = 0; |
| 620 | |
| 621 | return NO_ERROR; |
| 622 | } |
| 623 | |
| 624 | status_t BufferStateLayer::updateFrameNumber(nsecs_t /*latchTime*/) { |
| 625 | // TODO(marissaw): support frame history events |
| 626 | mCurrentFrameNumber = mFrameNumber; |
| 627 | return NO_ERROR; |
| 628 | } |
| 629 | |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 630 | void BufferStateLayer::setHwcLayerBuffer(DisplayId displayId) { |
Ady Abraham | 8372988 | 2018-12-07 12:26:48 -0800 | [diff] [blame] | 631 | Mutex::Autolock lock(mStateMutex); |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 632 | auto& hwcInfo = getBE().mHwcLayers[displayId]; |
| 633 | auto& hwcLayer = hwcInfo.layer; |
| 634 | |
| 635 | const State& s(getDrawingState()); |
| 636 | |
| 637 | // TODO(marissaw): support more than one slot |
| 638 | uint32_t hwcSlot = 0; |
| 639 | |
| 640 | auto error = hwcLayer->setBuffer(hwcSlot, s.buffer, s.acquireFence); |
| 641 | if (error != HWC2::Error::None) { |
| 642 | ALOGE("[%s] Failed to set buffer %p: %s (%d)", mName.string(), |
| 643 | s.buffer->handle, to_string(error).c_str(), static_cast<int32_t>(error)); |
| 644 | } |
| 645 | |
Marissa Wall | 024a191 | 2018-08-13 13:55:35 -0700 | [diff] [blame] | 646 | mCurrentStateModified = false; |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 647 | mFrameNumber++; |
| 648 | } |
| 649 | |
| 650 | void BufferStateLayer::onFirstRef() { |
Dan Stoza | 7b1b5a8 | 2018-07-31 16:00:21 -0700 | [diff] [blame] | 651 | BufferLayer::onFirstRef(); |
| 652 | |
Marissa Wall | 61c5862 | 2018-07-18 10:12:20 -0700 | [diff] [blame] | 653 | if (const auto display = mFlinger->getDefaultDisplayDevice()) { |
| 654 | updateTransformHint(display); |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | } // namespace android |