DescriptionDelete background tab IOSurfaces on Mac.
The deleting part is easy: just handle the AcceleratedSurfaceSuspend call by unrefing the IOSurface.
The hard part is dealing with a NSView drawRect when we don't have the IOSurface (or software BackingStore). To solve this, I reuse the GetBackingStore code to wait for a new frame from the renderer. When the BuffersSwapped message arrives on the IO thread for Mac, an UpdateRect message is synthesized with the SwapBuffers data. The UpdateRect message wakes up the UI thread and allows GetBackingStore to resume.
The accelerated path can have multiple frames in the pipeline, so it is rarely enough to just wait for the next UpdateRect. Instead, the GetBackingStore method is updated to wait up to 40ms to get the correctly-sized frame (whether it's accelerated or software).
The original GetBackingStore code waits for a frame that matches current_size_. However, this CL makes GetBackingStore wait for a frame that matches the view_->GetViewBounds(). current_size_ is equal to the last UpdateRect, which may or may not match GetViewBounds. (Anyone know why the original code doesn't use GetViewBounds?)
This allows us to recover from missing BackingStores or IOSurfaces if the renderer/GPU can produce a new frame within 40ms. We probably want to increase 40 to something like 60 or 100ms though because of the deep GPU pipeline.
In addition, thanks to the blocking GetBackingStore, this fixes some additional bugs:
- no more resize gutter jank on accelerated pages (Mac only for now, but should work on Windows with a followup patch).
- no more white flash while resizing flicker-test2.html.
BUG=117624, 58782, 85519, 124328, 106586
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=134033
Patch Set 1 #Patch Set 2 : checkpoint #Patch Set 3 : . #Patch Set 4 : checkpoint #Patch Set 5 : working #Patch Set 6 : review time #Patch Set 7 : review time #Patch Set 8 : compile #Patch Set 9 : unittests #Patch Set 10 : update / merge #Patch Set 11 : fixed some perf issues on mac #
Total comments: 20
Patch Set 12 : kbr, piman feedback, cleanup, popup deadlock fix #Patch Set 13 : separated SwapBuffers from UpdateRect msg #Patch Set 14 : no change - update/merge #Patch Set 15 : remove unused AboutToWaitForUpdateMsg #Patch Set 16 : changed 40ms timeout to 50ms for GetBackingStore #
Total comments: 2
Patch Set 17 : comments and piman feedback #
Total comments: 11
Patch Set 18 : darin feedback #Patch Set 19 : compile #Patch Set 20 : no change - update/merge #
Total comments: 4
Patch Set 21 : darin feedback #Patch Set 22 : darin feedback retry #Patch Set 23 : remove check for existing render_process_host_id in helper map #Patch Set 24 : fixed auto-resize and fullscreen toggle #Messages
Total messages: 22 (0 generated)
|