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

Issue 165623002: Dynamically set CAOpenGLLAyer to be asynchronous (Closed)

Created:
6 years, 10 months ago by ccameron
Modified:
6 years, 10 months ago
Reviewers:
Avi (use Gerrit)
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, James Su, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Dynamically set CAOpenGLLAyer to be asynchronous The supported non-blocking path for drawing content that updates on the order of 60fps is to create a CAOpenGLLayer and set its asynchronous property to YES. In practice, just calling setNeedsDisplay about about 60fps results in noticeable jank. The downside to setting the CAOpenGLLayer to be asynchronous is that it will be asked, every vsync, if it has anything new to draw (via the canDrawInOpenGLContext callback), resulting in high CPU usage, even when idle. The solution to this is to dynamically set the isAsynchronous property to YES when new frames are seen, and leave it at NO when it has been a while (defined as a quarter second arbitrarily) since a new frame has been generated. Note that when a new frame is generated, the gotNewFrame call is made, while when a re-display is required (say, because the window became visible), only setNeedsDisplay is called. This is to avoid going in to asynchronous mode unnecessarily. Also note that the DelayTimer object is hung off the RWHVMac class instead of the CompositingIOSurfaceLayer object. This is because the DelayTimer class requires a C++ class to hang off of, instead of an Objective C interface. BUG=340133 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251323

Patch Set 1 #

Patch Set 2 : Unset needsDisplay_ in a more conservative place #

Total comments: 3

Patch Set 3 : Incorporate review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -1 line) Patch
M content/browser/renderer_host/compositing_iosurface_layer_mac.h View 1 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/compositing_iosurface_layer_mac.mm View 1 4 chunks +32 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.h View 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
ccameron
Getting close to turning this on again -- hoping to do it right after the ...
6 years, 10 months ago (2014-02-14 01:32:47 UTC) #1
Avi (use Gerrit)
To the extent that this seems plausible, LGTM. I'm no expert, so don't rely too ...
6 years, 10 months ago (2014-02-14 02:11:29 UTC) #2
ccameron
You're right -- complication is the price for not knowing what you're doing. Most applications ...
6 years, 10 months ago (2014-02-14 02:32:19 UTC) #3
ccameron
The CQ bit was checked by ccameron@chromium.org
6 years, 10 months ago (2014-02-14 06:49:18 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ccameron@chromium.org/165623002/80001
6 years, 10 months ago (2014-02-14 06:49:54 UTC) #5
commit-bot: I haz the power
6 years, 10 months ago (2014-02-14 15:11:02 UTC) #6
Message was sent while issue was closed.
Change committed as 251323

Powered by Google App Engine
This is Rietveld 408576698