LCOV - code coverage report
Current view: top level - gfx/layers - GLImages.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 13 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 9 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
       2             :  * This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       5             : 
       6             : #ifndef GFX_GLIMAGES_H
       7             : #define GFX_GLIMAGES_H
       8             : 
       9             : #include "AndroidSurfaceTexture.h"
      10             : #include "GLContextTypes.h"
      11             : #include "GLTypes.h"
      12             : #include "ImageContainer.h"             // for Image
      13             : #include "ImageTypes.h"                 // for ImageFormat::SHARED_GLTEXTURE
      14             : #include "nsCOMPtr.h"                   // for already_AddRefed
      15             : #include "mozilla/gfx/Point.h"          // for IntSize
      16             : 
      17             : namespace mozilla {
      18             : namespace layers {
      19             : 
      20           0 : class GLImage : public Image {
      21             : public:
      22           0 :   explicit GLImage(ImageFormat aFormat) : Image(nullptr, aFormat){}
      23             : 
      24             :   virtual already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override;
      25             : 
      26           0 :   GLImage* AsGLImage() override {
      27           0 :     return this;
      28             :   }
      29             : };
      30             : 
      31             : class EGLImageImage : public GLImage {
      32             : public:
      33             :   EGLImageImage(EGLImage aImage, EGLSync aSync,
      34             :                 const gfx::IntSize& aSize, const gl::OriginPos& aOrigin,
      35             :                 bool aOwns);
      36             : 
      37           0 :   gfx::IntSize GetSize() override { return mSize; }
      38           0 :   gl::OriginPos GetOriginPos() const {
      39           0 :     return mPos;
      40             :   }
      41           0 :   EGLImage GetImage() const {
      42           0 :     return mImage;
      43             :   }
      44           0 :   EGLSync GetSync() const {
      45           0 :     return mSync;
      46             :   }
      47             : 
      48           0 :   EGLImageImage* AsEGLImageImage() override {
      49           0 :     return this;
      50             :   }
      51             : 
      52             : protected:
      53             :   virtual ~EGLImageImage();
      54             : 
      55             : private:
      56             :   EGLImage mImage;
      57             :   EGLSync mSync;
      58             :   gfx::IntSize mSize;
      59             :   gl::OriginPos mPos;
      60             :   bool mOwns;
      61             : };
      62             : 
      63             : #ifdef MOZ_WIDGET_ANDROID
      64             : 
      65             : class SurfaceTextureImage : public GLImage {
      66             : public:
      67             :   SurfaceTextureImage(AndroidSurfaceTextureHandle aHandle,
      68             :                       const gfx::IntSize& aSize,
      69             :                       bool aContinuous,
      70             :                       gl::OriginPos aOriginPos);
      71             : 
      72             :   gfx::IntSize GetSize() override { return mSize; }
      73             :   AndroidSurfaceTextureHandle GetHandle() const {
      74             :     return mHandle;
      75             :   }
      76             :   bool GetContinuous() const {
      77             :     return mContinuous;
      78             :   }
      79             :   gl::OriginPos GetOriginPos() const {
      80             :     return mOriginPos;
      81             :   }
      82             : 
      83             :   SurfaceTextureImage* AsSurfaceTextureImage() override {
      84             :     return this;
      85             :   }
      86             : 
      87             : private:
      88             :   AndroidSurfaceTextureHandle mHandle;
      89             :   gfx::IntSize mSize;
      90             :   bool mContinuous;
      91             :   gl::OriginPos mOriginPos;
      92             : };
      93             : 
      94             : #endif // MOZ_WIDGET_ANDROID
      95             : 
      96             : } // namespace layers
      97             : } // namespace mozilla
      98             : 
      99             : #endif // GFX_GLIMAGES_H

Generated by: LCOV version 1.13