Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: src/gpu/GrContextFactory.h

Issue 1455093003: Remove GrContextFactory::getGLContext (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-01-gpu-test-context-support
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bench/nanobench.cpp ('k') | tests/EGLImageTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrContextFactory_DEFINED 8 #ifndef GrContextFactory_DEFINED
9 #define GrContextFactory_DEFINED 9 #define GrContextFactory_DEFINED
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 /** 131 /**
132 * Get a GrContext initialized with a type of GL context. It also makes the GL context current. 132 * Get a GrContext initialized with a type of GL context. It also makes the GL context current.
133 */ 133 */
134 GrContext* get(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLSta ndard) { 134 GrContext* get(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLSta ndard) {
135 if (ContextInfo* info = this->getContextInfo(type, forcedGpuAPI)) { 135 if (ContextInfo* info = this->getContextInfo(type, forcedGpuAPI)) {
136 return info->fGrContext; 136 return info->fGrContext;
137 } 137 }
138 return nullptr; 138 return nullptr;
139 } 139 }
140
141 // Returns the GLContext of the given type. If it has not been created yet,
142 // nullptr is returned instead.
143 SkGLContext* getGLContext(GLContextType type) {
144 for (int i = 0; i < fContexts.count(); ++i) {
145 if (fContexts[i]->fType == type) {
146 return fContexts[i]->fGLContext;
147 }
148 }
149
150 return nullptr;
151 }
152
153 const GrContextOptions& getGlobalOptions() const { return fGlobalOptions; } 140 const GrContextOptions& getGlobalOptions() const { return fGlobalOptions; }
154 141
155 private: 142 private:
156 SkTArray<SkAutoTDelete<ContextInfo>, true> fContexts; 143 SkTArray<SkAutoTDelete<ContextInfo>, true> fContexts;
157 const GrContextOptions fGlobalOptions; 144 const GrContextOptions fGlobalOptions;
158 }; 145 };
159 146
160 #endif 147 #endif
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | tests/EGLImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698