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 | /* |
michael@0 | 3 | * Copyright 2012 Google Inc. |
michael@0 | 4 | * |
michael@0 | 5 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 6 | * found in the LICENSE file. |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | |
michael@0 | 10 | #include "gl/GrGLInterface.h" |
michael@0 | 11 | |
michael@0 | 12 | #ifndef GL_GLEXT_PROTOTYPES |
michael@0 | 13 | #define GL_GLEXT_PROTOTYPES |
michael@0 | 14 | #endif |
michael@0 | 15 | |
michael@0 | 16 | #include "GLES2/gl2.h" |
michael@0 | 17 | #include "GLES2/gl2ext.h" |
michael@0 | 18 | #include "EGL/egl.h" |
michael@0 | 19 | |
michael@0 | 20 | #define GET_PROC(name) \ |
michael@0 | 21 | interface->fFunctions.f ## name = (GrGL ## name ## Proc) GetProcAddress(ghANGLELib, "gl" #name); |
michael@0 | 22 | |
michael@0 | 23 | const GrGLInterface* GrGLCreateANGLEInterface() { |
michael@0 | 24 | |
michael@0 | 25 | static HMODULE ghANGLELib = NULL; |
michael@0 | 26 | |
michael@0 | 27 | if (NULL == ghANGLELib) { |
michael@0 | 28 | // We load the ANGLE library and never let it go |
michael@0 | 29 | ghANGLELib = LoadLibrary("libGLESv2.dll"); |
michael@0 | 30 | } |
michael@0 | 31 | if (NULL == ghANGLELib) { |
michael@0 | 32 | // We can't setup the interface correctly w/o the DLL |
michael@0 | 33 | return NULL; |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | GrGLInterface* interface = SkNEW(GrGLInterface); |
michael@0 | 37 | interface->fStandard = kGLES_GrGLStandard; |
michael@0 | 38 | |
michael@0 | 39 | GrGLInterface::Functions* functions = &interface->fFunctions; |
michael@0 | 40 | |
michael@0 | 41 | GET_PROC(ActiveTexture); |
michael@0 | 42 | GET_PROC(AttachShader); |
michael@0 | 43 | GET_PROC(BindAttribLocation); |
michael@0 | 44 | GET_PROC(BindBuffer); |
michael@0 | 45 | GET_PROC(BindTexture); |
michael@0 | 46 | functions->fBindVertexArray = |
michael@0 | 47 | (GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArrayOES"); |
michael@0 | 48 | GET_PROC(BlendColor); |
michael@0 | 49 | GET_PROC(BlendFunc); |
michael@0 | 50 | GET_PROC(BufferData); |
michael@0 | 51 | GET_PROC(BufferSubData); |
michael@0 | 52 | GET_PROC(Clear); |
michael@0 | 53 | GET_PROC(ClearColor); |
michael@0 | 54 | GET_PROC(ClearStencil); |
michael@0 | 55 | GET_PROC(ColorMask); |
michael@0 | 56 | GET_PROC(CompileShader); |
michael@0 | 57 | GET_PROC(CompressedTexImage2D); |
michael@0 | 58 | GET_PROC(CopyTexSubImage2D); |
michael@0 | 59 | GET_PROC(CreateProgram); |
michael@0 | 60 | GET_PROC(CreateShader); |
michael@0 | 61 | GET_PROC(CullFace); |
michael@0 | 62 | GET_PROC(DeleteBuffers); |
michael@0 | 63 | GET_PROC(DeleteProgram); |
michael@0 | 64 | GET_PROC(DeleteShader); |
michael@0 | 65 | GET_PROC(DeleteTextures); |
michael@0 | 66 | functions->fDeleteVertexArrays = |
michael@0 | 67 | (GrGLDeleteVertexArraysProc) eglGetProcAddress("glDeleteVertexArraysOES"); |
michael@0 | 68 | GET_PROC(DepthMask); |
michael@0 | 69 | GET_PROC(Disable); |
michael@0 | 70 | GET_PROC(DisableVertexAttribArray); |
michael@0 | 71 | GET_PROC(DrawArrays); |
michael@0 | 72 | GET_PROC(DrawElements); |
michael@0 | 73 | GET_PROC(Enable); |
michael@0 | 74 | GET_PROC(EnableVertexAttribArray); |
michael@0 | 75 | GET_PROC(Finish); |
michael@0 | 76 | GET_PROC(Flush); |
michael@0 | 77 | GET_PROC(FrontFace); |
michael@0 | 78 | GET_PROC(GenBuffers); |
michael@0 | 79 | GET_PROC(GenerateMipmap); |
michael@0 | 80 | GET_PROC(GenTextures); |
michael@0 | 81 | functions->fGenVertexArrays = |
michael@0 | 82 | (GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArraysOES"); |
michael@0 | 83 | GET_PROC(GetBufferParameteriv); |
michael@0 | 84 | GET_PROC(GetError); |
michael@0 | 85 | GET_PROC(GetIntegerv); |
michael@0 | 86 | GET_PROC(GetProgramInfoLog); |
michael@0 | 87 | GET_PROC(GetProgramiv); |
michael@0 | 88 | GET_PROC(GetShaderInfoLog); |
michael@0 | 89 | GET_PROC(GetShaderiv); |
michael@0 | 90 | GET_PROC(GetString); |
michael@0 | 91 | GET_PROC(GetUniformLocation); |
michael@0 | 92 | GET_PROC(LineWidth); |
michael@0 | 93 | GET_PROC(LinkProgram); |
michael@0 | 94 | GET_PROC(PixelStorei); |
michael@0 | 95 | GET_PROC(ReadPixels); |
michael@0 | 96 | GET_PROC(Scissor); |
michael@0 | 97 | GET_PROC(ShaderSource); |
michael@0 | 98 | GET_PROC(StencilFunc); |
michael@0 | 99 | GET_PROC(StencilFuncSeparate); |
michael@0 | 100 | GET_PROC(StencilMask); |
michael@0 | 101 | GET_PROC(StencilMaskSeparate); |
michael@0 | 102 | GET_PROC(StencilOp); |
michael@0 | 103 | GET_PROC(StencilOpSeparate); |
michael@0 | 104 | GET_PROC(TexImage2D); |
michael@0 | 105 | GET_PROC(TexParameteri); |
michael@0 | 106 | GET_PROC(TexParameteriv); |
michael@0 | 107 | GET_PROC(TexSubImage2D); |
michael@0 | 108 | #if GL_ARB_texture_storage |
michael@0 | 109 | GET_PROC(TexStorage2D); |
michael@0 | 110 | #elif GL_EXT_texture_storage |
michael@0 | 111 | functions->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT"); |
michael@0 | 112 | #endif |
michael@0 | 113 | GET_PROC(Uniform1f); |
michael@0 | 114 | GET_PROC(Uniform1i); |
michael@0 | 115 | GET_PROC(Uniform1fv); |
michael@0 | 116 | GET_PROC(Uniform1iv); |
michael@0 | 117 | |
michael@0 | 118 | GET_PROC(Uniform2f); |
michael@0 | 119 | GET_PROC(Uniform2i); |
michael@0 | 120 | GET_PROC(Uniform2fv); |
michael@0 | 121 | GET_PROC(Uniform2iv); |
michael@0 | 122 | |
michael@0 | 123 | GET_PROC(Uniform3f); |
michael@0 | 124 | GET_PROC(Uniform3i); |
michael@0 | 125 | GET_PROC(Uniform3fv); |
michael@0 | 126 | GET_PROC(Uniform3iv); |
michael@0 | 127 | |
michael@0 | 128 | GET_PROC(Uniform4f); |
michael@0 | 129 | GET_PROC(Uniform4i); |
michael@0 | 130 | GET_PROC(Uniform4fv); |
michael@0 | 131 | GET_PROC(Uniform4iv); |
michael@0 | 132 | |
michael@0 | 133 | GET_PROC(UniformMatrix2fv); |
michael@0 | 134 | GET_PROC(UniformMatrix3fv); |
michael@0 | 135 | GET_PROC(UniformMatrix4fv); |
michael@0 | 136 | GET_PROC(UseProgram); |
michael@0 | 137 | GET_PROC(VertexAttrib4fv); |
michael@0 | 138 | GET_PROC(VertexAttribPointer); |
michael@0 | 139 | GET_PROC(Viewport); |
michael@0 | 140 | GET_PROC(BindFramebuffer); |
michael@0 | 141 | GET_PROC(BindRenderbuffer); |
michael@0 | 142 | GET_PROC(CheckFramebufferStatus); |
michael@0 | 143 | GET_PROC(DeleteFramebuffers); |
michael@0 | 144 | GET_PROC(DeleteRenderbuffers); |
michael@0 | 145 | GET_PROC(FramebufferRenderbuffer); |
michael@0 | 146 | GET_PROC(FramebufferTexture2D); |
michael@0 | 147 | GET_PROC(GenFramebuffers); |
michael@0 | 148 | GET_PROC(GenRenderbuffers); |
michael@0 | 149 | GET_PROC(GetFramebufferAttachmentParameteriv); |
michael@0 | 150 | GET_PROC(GetRenderbufferParameteriv); |
michael@0 | 151 | GET_PROC(RenderbufferStorage); |
michael@0 | 152 | |
michael@0 | 153 | functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES"); |
michael@0 | 154 | functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES"); |
michael@0 | 155 | |
michael@0 | 156 | #if GL_EXT_debug_marker |
michael@0 | 157 | functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glInsertEventMarkerEXT"); |
michael@0 | 158 | functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glPushGroupMarkerEXT"); |
michael@0 | 159 | functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress("glPopGropuMarkerEXT"); |
michael@0 | 160 | #endif |
michael@0 | 161 | |
michael@0 | 162 | interface->fExtensions.init(kGLES_GrGLStandard, |
michael@0 | 163 | interface->fFunctions.fGetString, |
michael@0 | 164 | interface->fFunctions.fGetStringi, |
michael@0 | 165 | interface->fFunctions.fGetIntegerv); |
michael@0 | 166 | return interface; |
michael@0 | 167 | } |