gfx/layers/opengl/X11TextureSourceOGL.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: 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/. */
     6 #ifndef MOZILLA_GFX_X11TEXTURESOURCEOGL__H
     7 #define MOZILLA_GFX_X11TEXTURESOURCEOGL__H
     9 #ifdef GL_PROVIDER_GLX
    11 #include "mozilla/layers/TextureHostOGL.h"
    12 #include "mozilla/gfx/2D.h"
    14 namespace mozilla {
    15 namespace layers {
    17 // TextureSource for Xlib-backed surfaces.
    18 class X11TextureSourceOGL
    19   : public TextureSourceOGL
    20   , public NewTextureSource
    21 {
    22 public:
    23   X11TextureSourceOGL(CompositorOGL* aCompositor, gfxXlibSurface* aSurface);
    24   ~X11TextureSourceOGL();
    26   virtual X11TextureSourceOGL* AsSourceOGL() MOZ_OVERRIDE { return this; }
    28   virtual bool IsValid() const MOZ_OVERRIDE { return !!gl(); } ;
    30   virtual void BindTexture(GLenum aTextureUnit, gfx::Filter aFilter) MOZ_OVERRIDE;
    32   virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
    34   virtual GLenum GetTextureTarget() const MOZ_OVERRIDE { return LOCAL_GL_TEXTURE_2D; }
    36   virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
    38   virtual GLenum GetWrapMode() const MOZ_OVERRIDE { return LOCAL_GL_CLAMP_TO_EDGE; }
    40   virtual void DeallocateDeviceData() MOZ_OVERRIDE;
    42   virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
    44   gl::GLContext* gl() const;
    46   static gfx::SurfaceFormat ContentTypeToSurfaceFormat(gfxContentType aType);
    48 protected:
    49   CompositorOGL* mCompositor;
    50   nsRefPtr<gfxXlibSurface> mSurface;
    51   RefPtr<gfx::SourceSurface> mSourceSurface;
    52   GLuint mTexture;
    53 };
    55 } // namespace layers
    56 } // namespace mozilla
    58 #endif
    60 #endif // MOZILLA_GFX_X11TEXTURESOURCEOGL__H

mercurial