Flutter Engine
The Flutter Engine
Classes | Macros | Enumerations | Functions
SkWGL.h File Reference
#include "include/core/SkRefCnt.h"
#include "src/base/SkLeanWindows.h"

Go to the source code of this file.

Classes

class  SkWGLExtensions
 
class  SkWGLPbufferContext
 

Macros

#define SK_WGL_DRAW_TO_WINDOW   0x2001
 
#define SK_WGL_ACCELERATION   0x2003
 
#define SK_WGL_SUPPORT_OPENGL   0x2010
 
#define SK_WGL_DOUBLE_BUFFER   0x2011
 
#define SK_WGL_COLOR_BITS   0x2014
 
#define SK_WGL_RED_BITS   0x2015
 
#define SK_WGL_GREEN_BITS   0x2017
 
#define SK_WGL_BLUE_BITS   0x2019
 
#define SK_WGL_ALPHA_BITS   0x201B
 
#define SK_WGL_STENCIL_BITS   0x2023
 
#define SK_WGL_FULL_ACCELERATION   0x2027
 
#define SK_WGL_SAMPLE_BUFFERS   0x2041
 
#define SK_WGL_SAMPLES   0x2042
 
#define SK_WGL_CONTEXT_MAJOR_VERSION   0x2091
 
#define SK_WGL_CONTEXT_MINOR_VERSION   0x2092
 
#define SK_WGL_CONTEXT_LAYER_PLANE   0x2093
 
#define SK_WGL_CONTEXT_FLAGS   0x2094
 
#define SK_WGL_CONTEXT_PROFILE_MASK   0x9126
 
#define SK_WGL_CONTEXT_DEBUG_BIT   0x0001
 
#define SK_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT   0x0002
 
#define SK_WGL_CONTEXT_CORE_PROFILE_BIT   0x00000001
 
#define SK_WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT   0x00000002
 
#define SK_WGL_CONTEXT_ES2_PROFILE_BIT   0x00000004
 
#define SK_ERROR_INVALID_VERSION   0x2095
 
#define SK_ERROR_INVALID_PROFILE   0x2096
 

Enumerations

enum  SkWGLContextRequest { kGLPreferCoreProfile_SkWGLContextRequest , kGLPreferCompatibilityProfile_SkWGLContextRequest , kGLES_SkWGLContextRequest }
 

Functions

 DECLARE_HANDLE (HPBUFFER)
 
HGLRC SkCreateWGLContext (HDC dc, int msaaSampleCount, bool deepColor, SkWGLContextRequest context, HGLRC shareContext=nullptr)
 

Macro Definition Documentation

◆ SK_ERROR_INVALID_PROFILE

#define SK_ERROR_INVALID_PROFILE   0x2096

Definition at line 49 of file SkWGL.h.

◆ SK_ERROR_INVALID_VERSION

#define SK_ERROR_INVALID_VERSION   0x2095

Definition at line 48 of file SkWGL.h.

◆ SK_WGL_ACCELERATION

#define SK_WGL_ACCELERATION   0x2003

Definition at line 26 of file SkWGL.h.

◆ SK_WGL_ALPHA_BITS

#define SK_WGL_ALPHA_BITS   0x201B

Definition at line 33 of file SkWGL.h.

◆ SK_WGL_BLUE_BITS

#define SK_WGL_BLUE_BITS   0x2019

Definition at line 32 of file SkWGL.h.

◆ SK_WGL_COLOR_BITS

#define SK_WGL_COLOR_BITS   0x2014

Definition at line 29 of file SkWGL.h.

◆ SK_WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT

#define SK_WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT   0x00000002

Definition at line 46 of file SkWGL.h.

◆ SK_WGL_CONTEXT_CORE_PROFILE_BIT

#define SK_WGL_CONTEXT_CORE_PROFILE_BIT   0x00000001

Definition at line 45 of file SkWGL.h.

◆ SK_WGL_CONTEXT_DEBUG_BIT

#define SK_WGL_CONTEXT_DEBUG_BIT   0x0001

Definition at line 43 of file SkWGL.h.

◆ SK_WGL_CONTEXT_ES2_PROFILE_BIT

#define SK_WGL_CONTEXT_ES2_PROFILE_BIT   0x00000004

Definition at line 47 of file SkWGL.h.

◆ SK_WGL_CONTEXT_FLAGS

#define SK_WGL_CONTEXT_FLAGS   0x2094

Definition at line 41 of file SkWGL.h.

◆ SK_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT

#define SK_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT   0x0002

Definition at line 44 of file SkWGL.h.

◆ SK_WGL_CONTEXT_LAYER_PLANE

#define SK_WGL_CONTEXT_LAYER_PLANE   0x2093

Definition at line 40 of file SkWGL.h.

◆ SK_WGL_CONTEXT_MAJOR_VERSION

#define SK_WGL_CONTEXT_MAJOR_VERSION   0x2091

Definition at line 38 of file SkWGL.h.

◆ SK_WGL_CONTEXT_MINOR_VERSION

#define SK_WGL_CONTEXT_MINOR_VERSION   0x2092

Definition at line 39 of file SkWGL.h.

◆ SK_WGL_CONTEXT_PROFILE_MASK

#define SK_WGL_CONTEXT_PROFILE_MASK   0x9126

Definition at line 42 of file SkWGL.h.

◆ SK_WGL_DOUBLE_BUFFER

#define SK_WGL_DOUBLE_BUFFER   0x2011

Definition at line 28 of file SkWGL.h.

◆ SK_WGL_DRAW_TO_WINDOW

#define SK_WGL_DRAW_TO_WINDOW   0x2001

Working with WGL extensions can be a pain. Among the reasons is that you must have a GL context to get the proc addresses, but you want to use the procs to create a context in the first place. So you have to create a placeholder GL ctx to get the proc addresses.

This file helps by providing SkCreateWGLInterface(). It returns a struct of function pointers that it initializes. It also has a helper function to query for WGL extensions. It handles the fact that wglGetExtensionsString is itself an extension.

Definition at line 25 of file SkWGL.h.

◆ SK_WGL_FULL_ACCELERATION

#define SK_WGL_FULL_ACCELERATION   0x2027

Definition at line 35 of file SkWGL.h.

◆ SK_WGL_GREEN_BITS

#define SK_WGL_GREEN_BITS   0x2017

Definition at line 31 of file SkWGL.h.

◆ SK_WGL_RED_BITS

#define SK_WGL_RED_BITS   0x2015

Definition at line 30 of file SkWGL.h.

◆ SK_WGL_SAMPLE_BUFFERS

#define SK_WGL_SAMPLE_BUFFERS   0x2041

Definition at line 36 of file SkWGL.h.

◆ SK_WGL_SAMPLES

#define SK_WGL_SAMPLES   0x2042

Definition at line 37 of file SkWGL.h.

◆ SK_WGL_STENCIL_BITS

#define SK_WGL_STENCIL_BITS   0x2023

Definition at line 34 of file SkWGL.h.

◆ SK_WGL_SUPPORT_OPENGL

#define SK_WGL_SUPPORT_OPENGL   0x2010

Definition at line 27 of file SkWGL.h.

Enumeration Type Documentation

◆ SkWGLContextRequest

Enumerator
kGLPreferCoreProfile_SkWGLContextRequest 

Requests to create core profile context if possible, otherwise compatibility profile.

kGLPreferCompatibilityProfile_SkWGLContextRequest 

Requests to create compatibility profile context if possible, otherwise core profile.

kGLES_SkWGLContextRequest 

Requests to create GL ES profile context.

Definition at line 119 of file SkWGL.h.

119 {
120 /** Requests to create core profile context if possible, otherwise
121 compatibility profile. */
123 /** Requests to create compatibility profile context if possible, otherwise
124 core profile. */
126 /** Requests to create GL ES profile context. */
128};
@ kGLES_SkWGLContextRequest
Definition: SkWGL.h:127
@ kGLPreferCompatibilityProfile_SkWGLContextRequest
Definition: SkWGL.h:125
@ kGLPreferCoreProfile_SkWGLContextRequest
Definition: SkWGL.h:122

Function Documentation

◆ DECLARE_HANDLE()

DECLARE_HANDLE ( HPBUFFER  )

◆ SkCreateWGLContext()

HGLRC SkCreateWGLContext ( HDC  dc,
int  msaaSampleCount,
bool  deepColor,
SkWGLContextRequest  context,
HGLRC  shareContext = nullptr 
)

Helper to create an OpenGL context for a DC using WGL. Configs with a sample count >= to msaaSampleCount are preferred but if none is available then a context with a lower sample count (including non-MSAA) will be created. If msaaSampleCount is 1 then this will fail if a non-msaa context cannot be created. If preferCoreProfile is true but a core profile cannot be created then a compatible profile context will be created.