• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2016 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 //
6 // ContextImpl:
7 //   Implementation-specific functionality associated with a GL Context.
8 //
9 
10 #include "libANGLE/renderer/ContextImpl.h"
11 
12 #include "libANGLE/Context.h"
13 
14 namespace rx
15 {
ContextImpl(const gl::State & state,gl::ErrorSet * errorSet)16 ContextImpl::ContextImpl(const gl::State &state, gl::ErrorSet *errorSet)
17     : mState(state), mMemoryProgramCache(nullptr), mErrors(errorSet)
18 {}
19 
~ContextImpl()20 ContextImpl::~ContextImpl() {}
21 
stencilFillPath(const gl::Path * path,GLenum fillMode,GLuint mask)22 void ContextImpl::stencilFillPath(const gl::Path *path, GLenum fillMode, GLuint mask)
23 {
24     UNREACHABLE();
25 }
26 
stencilStrokePath(const gl::Path * path,GLint reference,GLuint mask)27 void ContextImpl::stencilStrokePath(const gl::Path *path, GLint reference, GLuint mask)
28 {
29     UNREACHABLE();
30 }
31 
coverFillPath(const gl::Path * path,GLenum coverMode)32 void ContextImpl::coverFillPath(const gl::Path *path, GLenum coverMode)
33 {
34     UNREACHABLE();
35 }
36 
coverStrokePath(const gl::Path * path,GLenum coverMode)37 void ContextImpl::coverStrokePath(const gl::Path *path, GLenum coverMode)
38 {
39     UNREACHABLE();
40 }
41 
stencilThenCoverFillPath(const gl::Path * path,GLenum fillMode,GLuint mask,GLenum coverMode)42 void ContextImpl::stencilThenCoverFillPath(const gl::Path *path,
43                                            GLenum fillMode,
44                                            GLuint mask,
45                                            GLenum coverMode)
46 {
47     UNREACHABLE();
48 }
49 
stencilThenCoverStrokePath(const gl::Path * path,GLint reference,GLuint mask,GLenum coverMode)50 void ContextImpl::stencilThenCoverStrokePath(const gl::Path *path,
51                                              GLint reference,
52                                              GLuint mask,
53                                              GLenum coverMode)
54 {
55     UNREACHABLE();
56 }
57 
coverFillPathInstanced(const std::vector<gl::Path * > & paths,GLenum coverMode,GLenum transformType,const GLfloat * transformValues)58 void ContextImpl::coverFillPathInstanced(const std::vector<gl::Path *> &paths,
59                                          GLenum coverMode,
60                                          GLenum transformType,
61                                          const GLfloat *transformValues)
62 {
63     UNREACHABLE();
64 }
65 
coverStrokePathInstanced(const std::vector<gl::Path * > & paths,GLenum coverMode,GLenum transformType,const GLfloat * transformValues)66 void ContextImpl::coverStrokePathInstanced(const std::vector<gl::Path *> &paths,
67                                            GLenum coverMode,
68                                            GLenum transformType,
69                                            const GLfloat *transformValues)
70 {
71     UNREACHABLE();
72 }
73 
stencilFillPathInstanced(const std::vector<gl::Path * > & paths,GLenum fillMode,GLuint mask,GLenum transformType,const GLfloat * transformValues)74 void ContextImpl::stencilFillPathInstanced(const std::vector<gl::Path *> &paths,
75                                            GLenum fillMode,
76                                            GLuint mask,
77                                            GLenum transformType,
78                                            const GLfloat *transformValues)
79 {
80     UNREACHABLE();
81 }
82 
stencilStrokePathInstanced(const std::vector<gl::Path * > & paths,GLint reference,GLuint mask,GLenum transformType,const GLfloat * transformValues)83 void ContextImpl::stencilStrokePathInstanced(const std::vector<gl::Path *> &paths,
84                                              GLint reference,
85                                              GLuint mask,
86                                              GLenum transformType,
87                                              const GLfloat *transformValues)
88 {
89     UNREACHABLE();
90 }
91 
stencilThenCoverFillPathInstanced(const std::vector<gl::Path * > & paths,GLenum coverMode,GLenum fillMode,GLuint mask,GLenum transformType,const GLfloat * transformValues)92 void ContextImpl::stencilThenCoverFillPathInstanced(const std::vector<gl::Path *> &paths,
93                                                     GLenum coverMode,
94                                                     GLenum fillMode,
95                                                     GLuint mask,
96                                                     GLenum transformType,
97                                                     const GLfloat *transformValues)
98 {
99     UNREACHABLE();
100 }
101 
stencilThenCoverStrokePathInstanced(const std::vector<gl::Path * > & paths,GLenum coverMode,GLint reference,GLuint mask,GLenum transformType,const GLfloat * transformValues)102 void ContextImpl::stencilThenCoverStrokePathInstanced(const std::vector<gl::Path *> &paths,
103                                                       GLenum coverMode,
104                                                       GLint reference,
105                                                       GLuint mask,
106                                                       GLenum transformType,
107                                                       const GLfloat *transformValues)
108 {
109     UNREACHABLE();
110 }
111 
invalidateTexture(gl::TextureType target)112 void ContextImpl::invalidateTexture(gl::TextureType target)
113 {
114     UNREACHABLE();
115 }
116 
onUnMakeCurrent(const gl::Context * context)117 angle::Result ContextImpl::onUnMakeCurrent(const gl::Context *context)
118 {
119     return angle::Result::Continue;
120 }
121 
setMemoryProgramCache(gl::MemoryProgramCache * memoryProgramCache)122 void ContextImpl::setMemoryProgramCache(gl::MemoryProgramCache *memoryProgramCache)
123 {
124     mMemoryProgramCache = memoryProgramCache;
125 }
126 
handleError(GLenum errorCode,const char * message,const char * file,const char * function,unsigned int line)127 void ContextImpl::handleError(GLenum errorCode,
128                               const char *message,
129                               const char *file,
130                               const char *function,
131                               unsigned int line)
132 {
133     std::stringstream errorStream;
134     errorStream << "Internal error: " << gl::FmtHex(errorCode) << ": " << message;
135     mErrors->handleError(errorCode, errorStream.str().c_str(), file, function, line);
136 }
137 
138 }  // namespace rx
139