scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_;
scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_;
+ // Timer used to dynamically transition the compositing layer in and out of
+ // asynchronous mode.
+ base::DelayTimer<RenderWidgetHostViewMac>
+ compositing_iosurface_layer_async_timer_;
+
// This holds the current software compositing framebuffer, if any.
scoped_ptr<SoftwareFrameManager> software_frame_manager_;
// Whether to use the CoreAnimation path to draw content.
bool use_core_animation_;
- std::vector<ui::LatencyInfo> software_latency_info_;
+ // Latency info to send back when the next frame appears on the
+ // screen.
+ std::vector<ui::LatencyInfo> pending_latency_info_;
+
+ // When taking a screenshot when using CoreAnimation, add a delay of
+ // a few frames to ensure that the contents have reached the screen
+ // before reporting latency info.
+ uint32 pending_latency_info_delay_;
+ base::WeakPtrFactory<RenderWidgetHostViewMac>
+ pending_latency_info_delay_weak_ptr_factory_;
NSWindow* pepper_fullscreen_window() const {
return pepper_fullscreen_window_;
float scale_factor() const;
- void SendSoftwareLatencyInfoToHost();
+ void AddPendingLatencyInfo(
+ const std::vector<ui::LatencyInfo>& latency_info);
+ void SendPendingLatencyInfoToHost();
+ void TickPendingLatencyInfoDelay();
private:
friend class RenderWidgetHostView;
// Called when a software DIB is received.
void GotSoftwareFrame();
+ // Called if it has been a quarter-second since a GPU SwapBuffers has been
+ // received. In this case, switch from polling for frames to pushing them.
+ void TimerSinceGotAcceleratedFrameFired();
+
void OnPluginFocusChanged(bool focused, int plugin_id);
void OnStartPluginIme();