~loic.molinari/qtmir/multi-bufferstream-support-fixes

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/mirbuffersgtexture.cpp

  • Committer: CI Train Bot
  • Author(s): Cemil Azizoglu
  • Date: 2015-09-23 15:17:10 UTC
  • mfrom: (377.1.5 qtmir)
  • Revision ID: ci-train-bot@canonical.com-20150923151710-0mwrkvqe0f25sdn9
Port gl_bind_to_texture to the new TextureSource interface.
Update for Mir 0.16 release.
Approved by: Alan Griffiths

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
// Mir
20
20
#include <mir/graphics/buffer.h>
21
21
#include <mir/geometry/size.h>
 
22
#include <mir/renderer/gl/texture_source.h>
22
23
 
23
24
namespace mg = mir::geometry;
 
25
namespace mrg = mir::renderer::gl;
24
26
 
25
27
MirBufferSGTexture::MirBufferSGTexture()
26
28
    : QSGTexture()
77
79
{
78
80
    glBindTexture(GL_TEXTURE_2D, m_textureId);
79
81
    updateBindOptions(true/* force */);
80
 
    m_mirBuffer->gl_bind_to_texture();
 
82
 
 
83
    auto const texture_source =
 
84
        dynamic_cast<mrg::TextureSource*>(m_mirBuffer->native_buffer_base());
 
85
    if (!texture_source)
 
86
        throw std::logic_error("Buffer does not support GL rendering");
 
87
 
 
88
    texture_source->gl_bind_to_texture();
81
89
}