gfx/gl/TextureImageEGL.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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/. */
     6 #ifndef TEXTUREIMAGEEGL_H_
     7 #define TEXTUREIMAGEEGL_H_
     9 #include "GLTextureImage.h"
    11 namespace mozilla {
    12 namespace gl {
    14 class TextureImageEGL
    15     : public TextureImage
    16 {
    17 public:
    18     TextureImageEGL(GLuint aTexture,
    19                     const nsIntSize& aSize,
    20                     GLenum aWrapMode,
    21                     ContentType aContentType,
    22                     GLContext* aContext,
    23                     Flags aFlags = TextureImage::NoFlags,
    24                     TextureState aTextureState = Created,
    25                     TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown);
    27     virtual ~TextureImageEGL();
    29     virtual void GetUpdateRegion(nsIntRegion& aForRegion);
    31     virtual gfx::DrawTarget* BeginUpdate(nsIntRegion& aRegion);
    33     virtual void EndUpdate();
    35     virtual bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom = gfx::IntPoint(0,0));
    37     virtual void BindTexture(GLenum aTextureUnit);
    39     virtual GLuint GetTextureID()
    40     {
    41         // Ensure the texture is allocated before it is used.
    42         if (mTextureState == Created) {
    43             Resize(mSize);
    44         }
    45         return mTexture;
    46     };
    48     virtual bool InUpdate() const { return !!mUpdateDrawTarget; }
    50     virtual void Resize(const gfx::IntSize& aSize);
    52     bool BindTexImage();
    54     bool ReleaseTexImage();
    56     virtual bool CreateEGLSurface(gfxASurface* aSurface)
    57     {
    58         return false;
    59     }
    61     virtual void DestroyEGLSurface(void);
    63 protected:
    64     typedef gfxImageFormat ImageFormat;
    66     GLContext* mGLContext;
    68     nsIntRect mUpdateRect;
    69     gfx::SurfaceFormat mUpdateFormat;
    70     RefPtr<gfx::DrawTarget> mUpdateDrawTarget;
    71     EGLImage mEGLImage;
    72     GLuint mTexture;
    73     EGLSurface mSurface;
    74     EGLConfig mConfig;
    75     TextureState mTextureState;
    77     bool mBound;
    78 };
    80 already_AddRefed<TextureImage>
    81 CreateTextureImageEGL(GLContext *gl,
    82                       const gfx::IntSize& aSize,
    83                       TextureImage::ContentType aContentType,
    84                       GLenum aWrapMode,
    85                       TextureImage::Flags aFlags,
    86                       TextureImage::ImageFormat aImageFormat);
    88 already_AddRefed<TextureImage>
    89 TileGenFuncEGL(GLContext *gl,
    90                const nsIntSize& aSize,
    91                TextureImage::ContentType aContentType,
    92                TextureImage::Flags aFlags,
    93                TextureImage::ImageFormat aImageFormat);
    95 }
    96 }
    98 #endif // TEXTUREIMAGEEGL_H_

mercurial