~kgunn72/mir/dont-crash-when-shooting-invalid-surface

« back to all changes in this revision

Viewing changes to src/platform/graphics/android/resource_factory.cpp

  • Committer: Tarmac
  • Author(s): Alan Griffiths, Alexandros Frantzis, Daniel van Vugt, Kevin DuBois, Christopher James Halse Rogers, chris.gagnon, Mathieu Trudel-Lapierre, Robert Carr, Automatic PS uploader, Kevin Gunn, Daniel d'Andrada, Christopher James Halse Rogers, Michael Terry, Brandon Schaefer, Timo Jyrinki, Mir Team, Andreas Pokorny
  • Date: 2013-12-20 11:11:22 UTC
  • mfrom: (1169.1.1 version-0.1.3)
  • Revision ID: tarmac-20131220111122-h503fd1fnq7pn9za
Latest upstream release: Mir 0.1.3 (r1298).

Approved by Alan Griffiths, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Copyright © 2013 Canonical Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU General Public License version 3,
 
5
 * under the terms of the GNU Lesser General Public License version 3,
6
6
 * as published by the Free Software Foundation.
7
7
 *
8
8
 * This program is distributed in the hope that it will be useful,
9
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
 
11
 * GNU Lesser General Public License for more details.
12
12
 *
13
 
 * You should have received a copy of the GNU General Public License
 
13
 * You should have received a copy of the GNU Lesser General Public License
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 *
16
16
 * Authored by:
45
45
    auto rc = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
46
46
    if ((rc != 0) || (module == nullptr) || (framebuffer_open(module, &fbdev_raw) != 0) )
47
47
    {
48
 
        BOOST_THROW_EXCEPTION(std::runtime_error("display factory cannot create fb display")); 
 
48
        BOOST_THROW_EXCEPTION(std::runtime_error("display factory cannot create fb display"));
49
49
    }
50
50
 
51
51
    return std::shared_ptr<framebuffer_device_t>(fbdev_raw,
65
65
       module->methods->open(module, HWC_HARDWARE_COMPOSER, reinterpret_cast<hw_device_t**>(&hwc_device_raw)) ||
66
66
       (hwc_device_raw == nullptr))
67
67
    {
68
 
        BOOST_THROW_EXCEPTION(std::runtime_error("error opening hwc hal")); 
 
68
        BOOST_THROW_EXCEPTION(std::runtime_error("error opening hwc hal"));
69
69
    }
70
70
 
71
71
    return std::shared_ptr<hwc_composer_device_1>(
78
78
{
79
79
    auto cache = std::make_shared<mga::InterpreterCache>();
80
80
    auto interpreter = std::make_shared<ServerRenderWindow>(fb_bundle, cache);
81
 
    return std::make_shared<MirNativeWindow>(interpreter); 
 
81
    return std::make_shared<MirNativeWindow>(interpreter);
82
82
}
83
83
 
84
84
std::shared_ptr<mga::DisplayDevice> mga::ResourceFactory::create_fb_device(