1 //
2 // Copyright (c) 2017 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 
7 // ProgramPipeline.cpp: Implements the gl::ProgramPipeline class.
8 // Implements GL program pipeline objects and related functionality.
9 // [OpenGL ES 3.1] section 7.4 page 105.
10 
11 #include "libANGLE/ProgramPipeline.h"
12 
13 #include "libANGLE/angletypes.h"
14 #include "libANGLE/renderer/GLImplFactory.h"
15 #include "libANGLE/renderer/ProgramPipelineImpl.h"
16 
17 namespace gl
18 {
19 
ProgramPipelineState()20 ProgramPipelineState::ProgramPipelineState() : mLabel()
21 {
22 }
23 
~ProgramPipelineState()24 ProgramPipelineState::~ProgramPipelineState()
25 {
26 }
27 
getLabel() const28 const std::string &ProgramPipelineState::getLabel() const
29 {
30     return mLabel;
31 }
32 
ProgramPipeline(rx::GLImplFactory * factory,GLuint handle)33 ProgramPipeline::ProgramPipeline(rx::GLImplFactory *factory, GLuint handle)
34     : RefCountObject(handle),
35       mProgramPipeline(factory->createProgramPipeline(mState))
36 {
37     ASSERT(mProgramPipeline);
38 }
39 
~ProgramPipeline()40 ProgramPipeline::~ProgramPipeline()
41 {
42     mProgramPipeline.release();
43 }
44 
onDestroy(const Context * context)45 Error ProgramPipeline::onDestroy(const Context *context)
46 {
47     return NoError();
48 }
49 
setLabel(const std::string & label)50 void ProgramPipeline::setLabel(const std::string &label)
51 {
52     mState.mLabel = label;
53 }
54 
getLabel() const55 const std::string &ProgramPipeline::getLabel() const
56 {
57     return mState.mLabel;
58 }
59 
getImplementation() const60 rx::ProgramPipelineImpl *ProgramPipeline::getImplementation() const
61 {
62     return mProgramPipeline.get();
63 }
64 
65 }  // namespace gl
66