gfx/angle/src/libEGL/main.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 //
     2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 // main.h: Management of thread-local data.
     9 #ifndef LIBEGL_MAIN_H_
    10 #define LIBEGL_MAIN_H_
    12 #define EGLAPI
    13 #include <EGL/egl.h>
    14 #include <EGL/eglext.h>
    16 namespace egl
    17 {
    18 struct Current
    19 {
    20     EGLint error;
    21     EGLenum API;
    22     EGLDisplay display;
    23     EGLSurface drawSurface;
    24     EGLSurface readSurface;
    25 };
    27 void setCurrentError(EGLint error);
    28 EGLint getCurrentError();
    30 void setCurrentAPI(EGLenum API);
    31 EGLenum getCurrentAPI();
    33 void setCurrentDisplay(EGLDisplay dpy);
    34 EGLDisplay getCurrentDisplay();
    36 void setCurrentDrawSurface(EGLSurface surface);
    37 EGLSurface getCurrentDrawSurface();
    39 void setCurrentReadSurface(EGLSurface surface);
    40 EGLSurface getCurrentReadSurface();
    42 void error(EGLint errorCode);
    44 template<class T>
    45 const T &error(EGLint errorCode, const T &returnValue)
    46 {
    47     error(errorCode);
    49     return returnValue;
    50 }
    52 template<class T>
    53 const T &success(const T &returnValue)
    54 {
    55     egl::setCurrentError(EGL_SUCCESS);
    57     return returnValue;
    58 }
    60 }
    62 #endif  // LIBEGL_MAIN_H_

mercurial