Sat, 03 Jan 2015 20:18:00 +0100
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.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | // Surface.h: Defines the egl::Surface class, representing a drawing surface |
michael@0 | 8 | // such as the client area of a window, including any back buffers. |
michael@0 | 9 | // Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3. |
michael@0 | 10 | |
michael@0 | 11 | #ifndef LIBEGL_SURFACE_H_ |
michael@0 | 12 | #define LIBEGL_SURFACE_H_ |
michael@0 | 13 | |
michael@0 | 14 | #define EGLAPI |
michael@0 | 15 | #include <EGL/egl.h> |
michael@0 | 16 | |
michael@0 | 17 | #include "common/angleutils.h" |
michael@0 | 18 | |
michael@0 | 19 | namespace gl |
michael@0 | 20 | { |
michael@0 | 21 | class Texture2D; |
michael@0 | 22 | } |
michael@0 | 23 | namespace rx |
michael@0 | 24 | { |
michael@0 | 25 | class Renderer; |
michael@0 | 26 | class SwapChain; |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | namespace egl |
michael@0 | 30 | { |
michael@0 | 31 | class Display; |
michael@0 | 32 | class Config; |
michael@0 | 33 | |
michael@0 | 34 | class Surface |
michael@0 | 35 | { |
michael@0 | 36 | public: |
michael@0 | 37 | Surface(Display *display, const egl::Config *config, HWND window, EGLint postSubBufferSupported); |
michael@0 | 38 | Surface(Display *display, const egl::Config *config, HANDLE shareHandle, EGLint width, EGLint height, EGLenum textureFormat, EGLenum textureTarget); |
michael@0 | 39 | |
michael@0 | 40 | ~Surface(); |
michael@0 | 41 | |
michael@0 | 42 | bool initialize(); |
michael@0 | 43 | void release(); |
michael@0 | 44 | bool resetSwapChain(); |
michael@0 | 45 | |
michael@0 | 46 | HWND getWindowHandle(); |
michael@0 | 47 | bool swap(); |
michael@0 | 48 | bool postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height); |
michael@0 | 49 | |
michael@0 | 50 | virtual EGLint getWidth() const; |
michael@0 | 51 | virtual EGLint getHeight() const; |
michael@0 | 52 | |
michael@0 | 53 | virtual EGLint isPostSubBufferSupported() const; |
michael@0 | 54 | |
michael@0 | 55 | virtual rx::SwapChain *getSwapChain() const; |
michael@0 | 56 | |
michael@0 | 57 | void setSwapInterval(EGLint interval); |
michael@0 | 58 | bool checkForOutOfDateSwapChain(); // Returns true if swapchain changed due to resize or interval update |
michael@0 | 59 | |
michael@0 | 60 | virtual EGLenum getTextureFormat() const; |
michael@0 | 61 | virtual EGLenum getTextureTarget() const; |
michael@0 | 62 | virtual EGLenum getFormat() const; |
michael@0 | 63 | |
michael@0 | 64 | virtual void setBoundTexture(gl::Texture2D *texture); |
michael@0 | 65 | virtual gl::Texture2D *getBoundTexture() const; |
michael@0 | 66 | |
michael@0 | 67 | private: |
michael@0 | 68 | DISALLOW_COPY_AND_ASSIGN(Surface); |
michael@0 | 69 | |
michael@0 | 70 | Display *const mDisplay; |
michael@0 | 71 | rx::Renderer *mRenderer; |
michael@0 | 72 | |
michael@0 | 73 | HANDLE mShareHandle; |
michael@0 | 74 | rx::SwapChain *mSwapChain; |
michael@0 | 75 | |
michael@0 | 76 | void subclassWindow(); |
michael@0 | 77 | void unsubclassWindow(); |
michael@0 | 78 | bool resizeSwapChain(int backbufferWidth, int backbufferHeight); |
michael@0 | 79 | bool resetSwapChain(int backbufferWidth, int backbufferHeight); |
michael@0 | 80 | bool swapRect(EGLint x, EGLint y, EGLint width, EGLint height); |
michael@0 | 81 | |
michael@0 | 82 | const HWND mWindow; // Window that the surface is created for. |
michael@0 | 83 | bool mWindowSubclassed; // Indicates whether we successfully subclassed mWindow for WM_RESIZE hooking |
michael@0 | 84 | const egl::Config *mConfig; // EGL config surface was created with |
michael@0 | 85 | EGLint mHeight; // Height of surface |
michael@0 | 86 | EGLint mWidth; // Width of surface |
michael@0 | 87 | // EGLint horizontalResolution; // Horizontal dot pitch |
michael@0 | 88 | // EGLint verticalResolution; // Vertical dot pitch |
michael@0 | 89 | // EGLBoolean largestPBuffer; // If true, create largest pbuffer possible |
michael@0 | 90 | // EGLBoolean mipmapTexture; // True if texture has mipmaps |
michael@0 | 91 | // EGLint mipmapLevel; // Mipmap level to render to |
michael@0 | 92 | // EGLenum multisampleResolve; // Multisample resolve behavior |
michael@0 | 93 | EGLint mPixelAspectRatio; // Display aspect ratio |
michael@0 | 94 | EGLenum mRenderBuffer; // Render buffer |
michael@0 | 95 | EGLenum mSwapBehavior; // Buffer swap behavior |
michael@0 | 96 | EGLenum mTextureFormat; // Format of texture: RGB, RGBA, or no texture |
michael@0 | 97 | EGLenum mTextureTarget; // Type of texture: 2D or no texture |
michael@0 | 98 | // EGLenum vgAlphaFormat; // Alpha format for OpenVG |
michael@0 | 99 | // EGLenum vgColorSpace; // Color space for OpenVG |
michael@0 | 100 | EGLint mSwapInterval; |
michael@0 | 101 | EGLint mPostSubBufferSupported; |
michael@0 | 102 | |
michael@0 | 103 | bool mSwapIntervalDirty; |
michael@0 | 104 | gl::Texture2D *mTexture; |
michael@0 | 105 | }; |
michael@0 | 106 | } |
michael@0 | 107 | |
michael@0 | 108 | #endif // LIBEGL_SURFACE_H_ |