gfx/gl/GLContextProviderImpl.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 IN_GL_CONTEXT_PROVIDER_H
     7 #error GLContextProviderImpl.h must only be included from GLContextProvider.h
     8 #endif
    10 #ifndef GL_CONTEXT_PROVIDER_NAME
    11 #error GL_CONTEXT_PROVIDER_NAME not defined
    12 #endif
    14 class GL_CONTEXT_PROVIDER_NAME
    15 {
    16 public:
    17     typedef gfx::SurfaceCaps SurfaceCaps;
    18     /**
    19      * Create a context that renders to the surface of the widget that is
    20      * passed in.  The context is always created with an RGB pixel format,
    21      * with no alpha, depth or stencil.  If any of those features are needed,
    22      * either use a framebuffer, or use CreateOffscreen.
    23      *
    24      * This context will attempt to share resources with all other window
    25      * contexts.  As such, it's critical that resources allocated that are not
    26      * needed by other contexts be deleted before the context is destroyed.
    27      *
    28      * The GetSharedContext() method will return non-null if sharing
    29      * was successful.
    30      *
    31      * Note: a context created for a widget /must not/ hold a strong
    32      * reference to the widget; otherwise a cycle can be created through
    33      * a GL layer manager.
    34      *
    35      * @param aWidget Widget whose surface to create a context for
    36      *
    37      * @return Context to use for the window
    38      */
    39     static already_AddRefed<GLContext>
    40     CreateForWindow(nsIWidget* widget);
    42     /**
    43      * Create a context for offscreen rendering.  The target of this
    44      * context should be treated as opaque -- it might be a FBO, or a
    45      * pbuffer, or some other construct.  Users of this GLContext
    46      * should bind framebuffer 0 directly to use this offscreen buffer.
    47      *
    48      * The offscreen context returned by this method will always have
    49      * the ability to be rendered into a context created by a window.
    50      * It might or might not share resources with the global context;
    51      * query GetSharedContext() for a non-null result to check.  If
    52      * resource sharing can be avoided on the target platform, it will
    53      * be, in order to isolate the offscreen context.
    54      *
    55      * @param aSize The initial size of this offscreen context.
    56      * @param aFormat The ContextFormat for this offscreen context.
    57      *
    58      * @return Context to use for offscreen rendering
    59      */
    60     static already_AddRefed<GLContext>
    61     CreateOffscreen(const gfxIntSize& size,
    62                     const SurfaceCaps& caps);
    64     /**
    65      * Create wrapping Gecko GLContext for external gl context.
    66      *
    67      * @param aContext External context which will be wrapped by Gecko GLContext.
    68      * @param aSurface External surface which is used for external context.
    69      *
    70      * @return Wrapping Context to use for rendering
    71      */
    72     static already_AddRefed<GLContext>
    73     CreateWrappingExisting(void* aContext, void* aSurface);
    75     /**
    76      * Get a pointer to the global context, creating it if it doesn't exist.
    77      */
    78     static GLContext*
    79     GetGlobalContext();
    81     /**
    82      * Free any resources held by this Context Provider.
    83      */
    84     static void
    85     Shutdown();
    86 };

mercurial