~mir-team/mir/trunk

« back to all changes in this revision

Viewing changes to src/client/android/android_client_platform.cpp

  • Committer: Tarmac
  • Author(s): Christopher James Halse Rogers, Alan Griffiths
  • Date: 2013-03-25 00:16:56 UTC
  • mfrom: (452.2.43 client-side-buffer-age)
  • Revision ID: tarmac-20130325001656-2k870l2edmx0v5hw
Add an “age” field to MirBufferPackage

This is the number of frames submitted by the client since the buffer 
has been rendered to; 0 indicates that the client has not rendered to it before.

This allows clients which have only small changes between frames to do
significantly less rendering, by only rendering the difference.

See also: http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_buffer_age.txt.

Approved by Alan Griffiths, Alexandros Frantzis, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "mir_native_window.h"
20
20
#include "android_client_platform.h"
21
21
#include "android_registrar_gralloc.h"
22
 
#include "android_client_buffer_depository.h"
 
22
#include "android_client_buffer_factory.h"
23
23
#include "client_surface_interpreter.h"
24
24
#include "../mir_connection.h"
25
25
#include "../native_client_platform_factory.h"
36
36
 
37
37
struct EmptyDeleter
38
38
{
39
 
    void operator()(void* )
 
39
    void operator()(void*)
40
40
    {
41
41
    }
42
42
};
49
49
    return std::make_shared<mcla::AndroidClientPlatform>();
50
50
}
51
51
 
52
 
std::shared_ptr<mcl::ClientBufferDepository> mcla::AndroidClientPlatform::create_platform_depository()
 
52
std::shared_ptr<mcl::ClientBufferFactory> mcla::AndroidClientPlatform::create_buffer_factory()
53
53
{
54
54
    const hw_module_t *hw_module;
55
55
    int error = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &hw_module);
63
63
    EmptyDeleter empty_del;
64
64
    auto gralloc_dev = std::shared_ptr<gralloc_module_t>(gr_dev, empty_del);
65
65
    auto registrar = std::make_shared<mcla::AndroidRegistrarGralloc>(gralloc_dev);
66
 
    return std::make_shared<mcla::AndroidClientBufferDepository>(registrar);
 
66
    return std::make_shared<mcla::AndroidClientBufferFactory>(registrar);
67
67
}
68
68
 
69
69
namespace
73
73
    MirNativeWindowDeleter(mcla::MirNativeWindow* window)
74
74
     : window(window) {}
75
75
 
76
 
    void operator()(EGLNativeWindowType* type )
 
76
    void operator()(EGLNativeWindowType* type)
77
77
    {
78
78
        delete type;
79
79
        delete window;