Home | History | Annotate | Download | only in common
      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 
     25 namespace egl
     26 {
     27 class Texture;
     28 class Image;
     29 }
     30 
     31 namespace gl
     32 {
     33 class [[clang::lto_visibility_public]] Surface
     34 {
     35 protected:
     36 	Surface();
     37 	virtual ~Surface() = 0;
     38 
     39 public:
     40 	virtual egl::Image *getRenderTarget() = 0;
     41 	virtual egl::Image *getDepthStencil() = 0;
     42 
     43 	virtual sw::Format getInternalFormat() const = 0;
     44 
     45 	virtual EGLint getWidth() const = 0;
     46 	virtual EGLint getHeight() const = 0;
     47 
     48 	virtual void setBoundTexture(egl::Texture *texture) = 0;
     49 };
     50 }
     51 
     52 #endif   // INCLUDE_SURFACE_H_
     53