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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 165623002: Dynamically set CAOpenGLLAyer to be asynchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 years, 10 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 | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 510dec1e135d990e89ed2b10e04093964c7e7f18..a2d991d4600eca9e6c46b5a5298b71385909f129 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -408,6 +408,9 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget)
last_frame_was_accelerated_(false),
text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
can_compose_inline_(true),
+ compositing_iosurface_layer_async_timer_(
+ FROM_HERE, base::TimeDelta::FromMilliseconds(250),
+ this, &RenderWidgetHostViewMac::TimerSinceGotAcceleratedFrameFired),
allow_overlapping_views_(false),
use_core_animation_(false),
pending_latency_info_delay_(0),
@@ -1405,7 +1408,8 @@ void RenderWidgetHostViewMac::CompositorSwapBuffers(
if (!about_to_validate_and_paint_) {
if (use_core_animation_) {
DCHECK(compositing_iosurface_layer_);
- [compositing_iosurface_layer_ setNeedsDisplay];
+ compositing_iosurface_layer_async_timer_.Reset();
+ [compositing_iosurface_layer_ gotNewFrame];
} else {
if (!DrawIOSurfaceWithoutCoreAnimation()) {
[cocoa_view_ setNeedsDisplay:YES];
@@ -1903,6 +1907,10 @@ void RenderWidgetHostViewMac::GotSoftwareFrame() {
}
}
+void RenderWidgetHostViewMac::TimerSinceGotAcceleratedFrameFired() {
+ [compositing_iosurface_layer_ timerSinceGotNewFrameFired];
+}
+
void RenderWidgetHostViewMac::SetActive(bool active) {
if (render_widget_host_) {
render_widget_host_->SetActive(active);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698