Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Issue 10828104: fix mac frame-rate regression for non-threaded GPU compositing (Closed)

Created:
8 years, 4 months ago by jbates
Modified:
8 years, 4 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

fix mac frame-rate regression for non-threaded GPU compositing This change looks weird - sorry about that. On Mac, setNeedsDisplay-driven drawRect calls appear to be implemented with a software timer that is slightly slower than vsync. So in order to render aligned with Vsync we have to either use CVDisplayLink or call CGLFlushDrawable immediately when new frames arrive at the browser RWHVMac. CVDisplayLink adds a frame of latency, so we don't want to use that for rendering. So, we call CGLFlushDrawable immediately. Calling CGLFlushDrawable is fine except when the window becomes non-visible, during which undocumented behavior kicks in: CGLFlushDrawable returns immediately, no longer throttled to vsync. So, we have the unfortunate task of manually throttling CGLFlushDrawable so that chrome doesn't spin while the window is hidden. The implementation of manual throttling is to use CVDisplayLink to compute vsync frame counts, and compare that to the flush (swap) counts. If the swap count gets more than frames ahead of vsync, we sleep for 1 frame interval to simulate blocking on vsync. NOTE: this code path is only for the non-threaded accelerated compositing path. It will not be triggered for the threaded compositing path because we won't render frames at faster than vsync unless there's a bug in the compositor thread scheduling logic. BUG=139416 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150056

Patch Set 1 #

Patch Set 2 : remove DEPS change #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -35 lines) Patch
M content/browser/renderer_host/compositing_iosurface_mac.h View 5 chunks +49 lines, -1 line 0 comments Download
M content/browser/renderer_host/compositing_iosurface_mac.mm View 8 chunks +145 lines, -7 lines 3 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 4 chunks +4 lines, -27 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
jbates
8 years, 4 months ago (2012-08-01 00:11:22 UTC) #1
vangelis
https://chromiumcodereview.appspot.com/10828104/diff/2001/content/browser/renderer_host/compositing_iosurface_mac.mm File content/browser/renderer_host/compositing_iosurface_mac.mm (right): https://chromiumcodereview.appspot.com/10828104/diff/2001/content/browser/renderer_host/compositing_iosurface_mac.mm#newcode575 content/browser/renderer_host/compositing_iosurface_mac.mm:575: swap_count = ++swap_count_; Should these two values be reset ...
8 years, 4 months ago (2012-08-01 00:53:12 UTC) #2
jbates
https://chromiumcodereview.appspot.com/10828104/diff/2001/content/browser/renderer_host/compositing_iosurface_mac.mm File content/browser/renderer_host/compositing_iosurface_mac.mm (right): https://chromiumcodereview.appspot.com/10828104/diff/2001/content/browser/renderer_host/compositing_iosurface_mac.mm#newcode575 content/browser/renderer_host/compositing_iosurface_mac.mm:575: swap_count = ++swap_count_; On 2012/08/01 00:53:12, vangelis wrote: > ...
8 years, 4 months ago (2012-08-01 01:00:47 UTC) #3
vangelis
https://chromiumcodereview.appspot.com/10828104/diff/2001/content/browser/renderer_host/compositing_iosurface_mac.mm File content/browser/renderer_host/compositing_iosurface_mac.mm (right): https://chromiumcodereview.appspot.com/10828104/diff/2001/content/browser/renderer_host/compositing_iosurface_mac.mm#newcode575 content/browser/renderer_host/compositing_iosurface_mac.mm:575: swap_count = ++swap_count_; On 2012/08/01 01:00:47, jbates wrote: > ...
8 years, 4 months ago (2012-08-01 01:33:01 UTC) #4
jbates
8 years, 4 months ago (2012-08-02 17:18:38 UTC) #5
vangelis
LGTM from me. Nico, do you want to take a look at the more mac-specific ...
8 years, 4 months ago (2012-08-02 19:56:31 UTC) #6
Nico
On 2012/08/02 19:56:31, vangelis wrote: > LGTM from me. Nico, do you want to take ...
8 years, 4 months ago (2012-08-02 20:07:02 UTC) #7
jbates
sky: content/browser/OWNERS
8 years, 4 months ago (2012-08-02 20:08:39 UTC) #8
sky
LGTM
8 years, 4 months ago (2012-08-03 16:29:05 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jbates@chromium.org/10828104/2001
8 years, 4 months ago (2012-08-03 16:45:52 UTC) #10
commit-bot: I haz the power
Try job failure for 10828104-2001 (retry) on win_rel for step "interactive_ui_tests" (clobber build). It's a ...
8 years, 4 months ago (2012-08-03 20:30:50 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jbates@chromium.org/10828104/2001
8 years, 4 months ago (2012-08-05 20:20:56 UTC) #12
commit-bot: I haz the power
8 years, 4 months ago (2012-08-05 21:58:10 UTC) #13
Change committed as 150056

Powered by Google App Engine
This is Rietveld 408576698