• 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 
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 
handleNoopDrawEvent()32 angle::Result ContextImpl::handleNoopDrawEvent()
33 {
34     return angle::Result::Continue;
35 }
36 
setMemoryProgramCache(gl::MemoryProgramCache * memoryProgramCache)37 void ContextImpl::setMemoryProgramCache(gl::MemoryProgramCache *memoryProgramCache)
38 {
39     mMemoryProgramCache = memoryProgramCache;
40 }
41 
handleError(GLenum errorCode,const char * message,const char * file,const char * function,unsigned int line)42 void ContextImpl::handleError(GLenum errorCode,
43                               const char *message,
44                               const char *file,
45                               const char *function,
46                               unsigned int line)
47 {
48     std::stringstream errorStream;
49     errorStream << "Internal error: " << gl::FmtHex(errorCode) << ": " << message;
50     mErrors->handleError(errorCode, errorStream.str().c_str(), file, function, line);
51 }
52 
getContextPriority() const53 egl::ContextPriority ContextImpl::getContextPriority() const
54 {
55     return egl::ContextPriority::Medium;
56 }
57 
releaseHighPowerGPU(gl::Context *)58 egl::Error ContextImpl::releaseHighPowerGPU(gl::Context *)
59 {
60     return egl::NoError();
61 }
62 
reacquireHighPowerGPU(gl::Context *)63 egl::Error ContextImpl::reacquireHighPowerGPU(gl::Context *)
64 {
65     return egl::NoError();
66 }
67 
68 }  // namespace rx
69