gfx/gl/SharedSurfaceIO.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++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
     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 SHARED_SURFACEIO_H_
     7 #define SHARED_SURFACEIO_H_
     9 #include "gfxImageSurface.h"
    10 #include "SharedSurfaceGL.h"
    11 #include "mozilla/RefPtr.h"
    13 class MacIOSurface;
    15 namespace mozilla {
    16 namespace gl {
    18 class SharedSurface_IOSurface : public SharedSurface_GL
    19 {
    20 public:
    21     static SharedSurface_IOSurface* Create(MacIOSurface* surface, GLContext *gl, bool hasAlpha);
    23     ~SharedSurface_IOSurface();
    25     virtual void LockProdImpl() MOZ_OVERRIDE { }
    26     virtual void UnlockProdImpl() MOZ_OVERRIDE { }
    28     virtual void Fence() MOZ_OVERRIDE;
    29     virtual bool WaitSync() MOZ_OVERRIDE { return true; }
    31     virtual bool ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
    32                             GLenum format, GLenum type, GLvoid *pixels) MOZ_OVERRIDE;
    34     virtual GLuint ProdTexture() MOZ_OVERRIDE {
    35         return mProdTex;
    36     }
    38     virtual GLenum ProdTextureTarget() const MOZ_OVERRIDE {
    39         return LOCAL_GL_TEXTURE_RECTANGLE_ARB;
    40     }
    42     static SharedSurface_IOSurface* Cast(SharedSurface *surf) {
    43         MOZ_ASSERT(surf->Type() == SharedSurfaceType::IOSurface);
    44         return static_cast<SharedSurface_IOSurface*>(surf);
    45     }
    47     GLuint ConsTexture(GLContext* consGL);
    49     GLenum ConsTextureTarget() const {
    50         return LOCAL_GL_TEXTURE_RECTANGLE_ARB;
    51     }
    53 private:
    54     SharedSurface_IOSurface(MacIOSurface* surface, GLContext* gl, const gfx::IntSize& size, bool hasAlpha);
    56     RefPtr<MacIOSurface> mSurface;
    57     nsRefPtr<gfxImageSurface> mImageSurface;
    58     GLuint mProdTex;
    59     const GLContext* mCurConsGL;
    60     GLuint mConsTex;
    61 };
    63 class SurfaceFactory_IOSurface : public SurfaceFactory_GL
    64 {
    65 public:
    66     SurfaceFactory_IOSurface(GLContext* gl,
    67                              const SurfaceCaps& caps)
    68         : SurfaceFactory_GL(gl, SharedSurfaceType::IOSurface, caps)
    69     {
    70     }
    72 protected:
    73     virtual SharedSurface* CreateShared(const gfx::IntSize& size) MOZ_OVERRIDE;
    74 };
    76 } /* namespace gfx */
    77 } /* namespace mozilla */
    79 #endif /* SHARED_SURFACEIO_H_ */

mercurial