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

Unified Diff: content/browser/renderer_host/compositing_iosurface_layer_mac.h

Issue 310183002: Ack swap buffers after a timeout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/compositing_iosurface_layer_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositing_iosurface_layer_mac.h
diff --git a/content/browser/renderer_host/compositing_iosurface_layer_mac.h b/content/browser/renderer_host/compositing_iosurface_layer_mac.h
index 9b1b6aa3f8d9cfdc56263894ab4812e8b140aedc..80a152dd35c0cb4b92161fe732f492f6415f3de4 100644
--- a/content/browser/renderer_host/compositing_iosurface_layer_mac.h
+++ b/content/browser/renderer_host/compositing_iosurface_layer_mac.h
@@ -9,15 +9,16 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/ref_counted.h"
+#include "base/timer/timer.h"
namespace content {
class CompositingIOSurfaceMac;
class CompositingIOSurfaceContext;
+class CompositingIOSurfaceLayerHelper;
class CompositingIOSurfaceLayerClient {
public:
virtual void AcceleratedLayerDidDrawFrame(bool succeeded) = 0;
- virtual bool AcceleratedLayerHasNotAckedPendingFrame() const = 0;
};
}
@@ -29,11 +30,21 @@ class CompositingIOSurfaceLayerClient {
scoped_refptr<content::CompositingIOSurfaceMac> iosurface_;
scoped_refptr<content::CompositingIOSurfaceContext> context_;
+ // The browser places back-pressure on the GPU by not acknowledging swap
+ // calls until they appear on the screen. This can lead to hangs if the
+ // view is moved offscreen (among other things). Prevent hangs by always
+ // acknowledging the frame after timeout of 1/6th of a second has passed.
+ scoped_ptr<content::CompositingIOSurfaceLayerHelper> helper_;
+ scoped_ptr<base::DelayTimer<content::CompositingIOSurfaceLayerHelper>> timer_;
+
// Used to track when canDrawInCGLContext should return YES. This can be
// in response to receiving a new compositor frame, or from any of the events
// that cause setNeedsDisplay to be called on the layer.
BOOL needs_display_;
+ // This is set when a frame is received, and un-set when the frame is drawn.
+ BOOL has_pending_frame_;
+
// Incremented every time that this layer is asked to draw but does not have
// new content to draw.
uint64 did_not_draw_counter_;
« no previous file with comments | « no previous file | content/browser/renderer_host/compositing_iosurface_layer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698