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
invalidateTexture(gl::TextureType target)22 void ContextImpl::invalidateTexture(gl::TextureType target)
23 {
24 UNREACHABLE();
25 }
26
onUnMakeCurrent(const gl::Context * context)27 angle::Result ContextImpl::onUnMakeCurrent(const gl::Context *context)
28 {
29 return angle::Result::Continue;
30 }
31
setMemoryProgramCache(gl::MemoryProgramCache * memoryProgramCache)32 void ContextImpl::setMemoryProgramCache(gl::MemoryProgramCache *memoryProgramCache)
33 {
34 mMemoryProgramCache = memoryProgramCache;
35 }
36
handleError(GLenum errorCode,const char * message,const char * file,const char * function,unsigned int line)37 void ContextImpl::handleError(GLenum errorCode,
38 const char *message,
39 const char *file,
40 const char *function,
41 unsigned int line)
42 {
43 std::stringstream errorStream;
44 errorStream << "Internal error: " << gl::FmtHex(errorCode) << ": " << message;
45 mErrors->handleError(errorCode, errorStream.str().c_str(), file, function, line);
46 }
47
getContextPriority() const48 egl::ContextPriority ContextImpl::getContextPriority() const
49 {
50 return egl::ContextPriority::Medium;
51 }
52
53 } // namespace rx
54