summaryrefslogtreecommitdiff
path: root/docs/html/sdk/api_diff/12/changes
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2012-10-02 10:30:41 -0700
committerRaph Levien <raph@google.com>2012-10-02 12:32:40 -0700
commit832815cb53e951485ff5a0e6c705446d0bfb5883 (patch)
treeb2abfbb56ef396f867f5a5ba6008b53f829215d0 /docs/html/sdk/api_diff/12/changes
parent48315436eece69f4d047c2b14ac63e62f757b88c (diff)
Fix for bug 7234184 F/TextLayoutCache: Failed to put an entry...
This bug was triggered by user code concurrently mutating the character array while calling into a drawText method in another thread. When the value of the array changed, it caused inconsistent state, leading to assert failures. This is arguably bad behavior by the user code, but it shouldn't cause a native crash. The fix is to do a defensive copy of the text into the key, so the value is guaranteed to remain constant throughout the text layout process. The change is mostly deletion of code, because there was an optimization to try to avoid such a copy. That optimization was not actually effective, however, because the indexOfKey() operation in the KeyedVector underlying the TextLayoutCache did the copy anyway. Thus, even though this change looks like it's introducing a copy where there wasn't one before, the actual performance impact should be nil. Note that the ability to handle a mutating argument is now part of the contract for TextLayoutEngine::getValue(), and is now documented. That contract may change, as the result of future optimization. Also, care was taken to only use the value after the copy. Other performance issues with TextLayoutCache are tracked in bug 7271109. Change-Id: I9c90e8e4d501f3f37e2f22a7851f032808d46fbe
Diffstat (limited to 'docs/html/sdk/api_diff/12/changes')
0 files changed, 0 insertions, 0 deletions