1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Surface.hpp: Defines the gl::Surface class, which is the abstract interface 16 // for an EGL surface as viewed by the GL implementation. 17 18 #ifndef INCLUDE_SURFACE_H_ 19 #define INCLUDE_SURFACE_H_ 20 21 #include "Renderer/Surface.hpp" 22 23 #include <EGL/egl.h> 24 #undef Bool 25 26 namespace egl 27 { 28 class Texture; 29 class Image; 30 } 31 32 namespace gl 33 { 34 class [[clang::lto_visibility_public]] Surface 35 { 36 protected: 37 Surface(); 38 virtual ~Surface() = 0; 39 40 public: 41 virtual egl::Image *getRenderTarget() = 0; 42 virtual egl::Image *getDepthStencil() = 0; 43 44 virtual EGLint getWidth() const = 0; 45 virtual EGLint getHeight() const = 0; 46 virtual EGLenum getTextureTarget() const = 0; 47 48 virtual void setBoundTexture(egl::Texture *texture) = 0; 49 }; 50 } 51 52 #endif // INCLUDE_SURFACE_H_ 53