Mir
Public Member Functions | List of all members
mir::compositor::TimeoutFrameDroppingPolicyFactory Class Reference

Creator of timeout-based FrameDroppingPolicies. More...

#include <timeout_frame_dropping_policy_factory.h>

Inheritance diagram for mir::compositor::TimeoutFrameDroppingPolicyFactory:
[legend]

Public Member Functions

 TimeoutFrameDroppingPolicyFactory (std::shared_ptr< mir::time::AlarmFactory > const &factory, std::chrono::milliseconds timeout)
 
std::unique_ptr< FrameDroppingPolicycreate_policy (std::shared_ptr< LockableCallback > const &drop_frame) const override
 Create a FrameDroppingPolicy that will call drop_frame when it decides to drop a frame. More...
 
- Public Member Functions inherited from mir::compositor::FrameDroppingPolicyFactory
 FrameDroppingPolicyFactory ()=default
 
virtual ~FrameDroppingPolicyFactory ()=default
 
 FrameDroppingPolicyFactory (FrameDroppingPolicyFactory const &)=delete
 
FrameDroppingPolicyFactoryoperator= (FrameDroppingPolicyFactory const &)=delete
 

Detailed Description

Creator of timeout-based FrameDroppingPolicies.

Constructor & Destructor Documentation

mir::compositor::TimeoutFrameDroppingPolicyFactory::TimeoutFrameDroppingPolicyFactory ( std::shared_ptr< mir::time::AlarmFactory > const &  factory,
std::chrono::milliseconds  timeout 
)
Parameters
factoryFactory which can create alarms used to schedule frame drops.
timeoutNumber of milliseconds to wait before dropping a frame

Member Function Documentation

std::unique_ptr< mc::FrameDroppingPolicy > mir::compositor::TimeoutFrameDroppingPolicyFactory::create_policy ( std::shared_ptr< LockableCallback > const &  drop_frame) const
overridevirtual

Create a FrameDroppingPolicy that will call drop_frame when it decides to drop a frame.

A LockableCallback allows the user to preserve lock ordering in situations where FrameDroppingPolicy methods need to be called under external lock and the callback implementation needs to run code protected by the same lock. A FrameDroppingPolicy implementation may have internal locks of its own, which maybe acquired during callback dispatching; to preserve lock ordering LockableCallback::lock will be invoked during callback dispatch before any internal locks are acquired.

Parameters
drop_frameFunction to call when a frame needs to be dropped
lockFunction called within the callback dispatcher context before any internal locks are acquired.
unlockFunction called within the callback dispatcher context after any internal locks are released.

Implements mir::compositor::FrameDroppingPolicyFactory.


The documentation for this class was generated from the following files:

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015