~vanvugt/mir/enable-dynamic-queue-scaling

« back to all changes in this revision

Viewing changes to src/platforms/android/server/buffer.cpp

  • Committer: Daniel van Vugt
  • Date: 2016-02-10 06:30:37 UTC
  • mfrom: (3293.1.6 trunk)
  • Revision ID: daniel.van.vugt@canonical.com-20160210063037-r2gwpxc25ggyr9cg
Merge latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
void mga::Buffer::gl_bind_to_texture()
75
75
{
76
76
    std::unique_lock<std::mutex> lk(content_lock);
 
77
    bind(lk);
 
78
    secure_for_render(lk);
 
79
}
 
80
 
 
81
void mga::Buffer::bind()
 
82
{
 
83
    std::unique_lock<std::mutex> lk(content_lock);
 
84
    bind(lk);
 
85
}
 
86
 
 
87
void mga::Buffer::bind(std::unique_lock<std::mutex> const&)
 
88
{
77
89
    native_buffer->ensure_available_for(mga::BufferAccess::read);
78
90
 
79
91
    DispContextPair current
113
125
    }
114
126
 
115
127
    egl_extensions->glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
116
 
 
117
 
    //TODO: we should make use of the android egl fence extension here to update the fence.
118
 
    //      if the extension is not available, we should pass out a token that the user
119
 
    //      will have to keep until the completion of the gl draw
120
128
}
121
129
 
122
130
std::shared_ptr<mg::NativeBuffer> mga::Buffer::native_buffer_handle() const
196
204
{
197
205
    return this;
198
206
}
 
207
 
 
208
void mga::Buffer::secure_for_render()
 
209
{
 
210
    std::unique_lock<std::mutex> lk(content_lock);
 
211
    secure_for_render(lk);
 
212
}
 
213
 
 
214
void mga::Buffer::secure_for_render(std::unique_lock<std::mutex> const&)
 
215
{
 
216
    native_buffer->lock_for_gpu();
 
217
}