| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkRefCnt.h" | 9 #include "SkRefCnt.h" |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 typedef BOOL (WINAPI *GetPixelFormatAttribfvProc)(HDC hdc, int, int, UINT, c
onst int*, FLOAT*); | 97 typedef BOOL (WINAPI *GetPixelFormatAttribfvProc)(HDC hdc, int, int, UINT, c
onst int*, FLOAT*); |
| 98 typedef HGLRC (WINAPI *CreateContextAttribsProc)(HDC hDC, HGLRC, const int *
); | 98 typedef HGLRC (WINAPI *CreateContextAttribsProc)(HDC hDC, HGLRC, const int *
); |
| 99 | 99 |
| 100 GetExtensionsStringProc fGetExtensionsString; | 100 GetExtensionsStringProc fGetExtensionsString; |
| 101 ChoosePixelFormatProc fChoosePixelFormat; | 101 ChoosePixelFormatProc fChoosePixelFormat; |
| 102 GetPixelFormatAttribfvProc fGetPixelFormatAttribfv; | 102 GetPixelFormatAttribfvProc fGetPixelFormatAttribfv; |
| 103 GetPixelFormatAttribivProc fGetPixelFormatAttribiv; | 103 GetPixelFormatAttribivProc fGetPixelFormatAttribiv; |
| 104 CreateContextAttribsProc fCreateContextAttribs; | 104 CreateContextAttribsProc fCreateContextAttribs; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 enum SkWGLContextRequest { |
| 108 /** Requests to create core profile context if possible, otherwise |
| 109 compatibility profile. */ |
| 110 kGLPreferCoreProfile_SkWGLContextRequest, |
| 111 /** Requests to create compatibility profile context if possible, otherwise |
| 112 core profile. */ |
| 113 kGLPreferCompatibilityProfile_SkWGLContextRequest, |
| 114 /** Requests to create GL ES profile context. */ |
| 115 kGLES_SkWGLContextRequest |
| 116 }; |
| 107 /** | 117 /** |
| 108 * Helper to create an OpenGL context for a DC using WGL. Configs with a sample
count >= to | 118 * Helper to create an OpenGL context for a DC using WGL. Configs with a sample
count >= to |
| 109 * msaaSampleCount are preferred but if none is available then a context with a
lower sample count | 119 * msaaSampleCount are preferred but if none is available then a context with a
lower sample count |
| 110 * (including non-MSAA) will be created. If preferCoreProfile is true but a core
profile cannot be | 120 * (including non-MSAA) will be created. If preferCoreProfile is true but a core
profile cannot be |
| 111 * created then a compatible profile context will be created. | 121 * created then a compatible profile context will be created. |
| 112 */ | 122 */ |
| 113 HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool preferCoreProfile); | 123 HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, SkWGLContextRequest contex
t); |
| 114 | 124 |
| 115 #endif | 125 #endif |
| OLD | NEW |