Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // DisplayImpl.cpp: Implementation methods of egl::Display |
| 8 | |
| 9 | #include "libANGLE/renderer/DisplayImpl.h" |
| 10 | |
| 11 | #include "libANGLE/Surface.h" |
| 12 | |
| 13 | namespace rx |
| 14 | { |
| 15 | |
Geoff Lang | 1b76545 | 2014-12-11 11:58:39 -0500 | [diff] [blame^] | 16 | DisplayImpl::DisplayImpl() |
| 17 | : mExtensionsInitialized(false) |
| 18 | { |
| 19 | } |
| 20 | |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 21 | DisplayImpl::~DisplayImpl() |
| 22 | { |
| 23 | while (!mSurfaceSet.empty()) |
| 24 | { |
| 25 | destroySurface(*mSurfaceSet.begin()); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | void DisplayImpl::destroySurface(egl::Surface *surface) |
| 30 | { |
| 31 | mSurfaceSet.erase(surface); |
| 32 | SafeDelete(surface); |
| 33 | } |
| 34 | |
Geoff Lang | 1b76545 | 2014-12-11 11:58:39 -0500 | [diff] [blame^] | 35 | const egl::DisplayExtensions &DisplayImpl::getExtensions() const |
| 36 | { |
| 37 | if (!mExtensionsInitialized) |
| 38 | { |
| 39 | generateExtensions(&mExtensions); |
| 40 | mExtensionsInitialized = true; |
| 41 | } |
| 42 | |
| 43 | return mExtensions; |
| 44 | } |
| 45 | |
Jamie Madill | 870352a | 2014-12-01 11:01:17 -0500 | [diff] [blame] | 46 | } |