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

Side by Side Diff: tools/gpu/GrContextFactory.cpp

Issue 1860593002: One signature for creating unit tests that run on premade GrContexts (Closed) Base URL: https://skia.googlesource.com/skia.git@try_no_native
Patch Set: another guess to fix windows Created 4 years, 8 months 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 | « tools/gpu/GrContextFactory.h ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrContextFactory.h" 9 #include "GrContextFactory.h"
10 #include "gl/GLTestContext.h" 10 #include "gl/GLTestContext.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_ FOR_MAC) 77 #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_ FOR_MAC)
78 const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType = 78 const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType =
79 GrContextFactory::kGL_ContextType; 79 GrContextFactory::kGL_ContextType;
80 #else 80 #else
81 const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType = 81 const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType =
82 GrContextFactory::kGLES_ContextType; 82 GrContextFactory::kGLES_ContextType;
83 #endif 83 #endif
84 84
85 GrContextFactory::ContextInfo GrContextFactory::getContextInfo(ContextType type, 85 ContextInfo GrContextFactory::getContextInfo(ContextType type, ContextOptions op tions) {
86 ContextOptions op tions) {
87 for (int i = 0; i < fContexts.count(); ++i) { 86 for (int i = 0; i < fContexts.count(); ++i) {
88 Context& context = fContexts[i]; 87 Context& context = fContexts[i];
89 if (!context.fGLContext) { 88 if (!context.fGLContext) {
90 continue; 89 continue;
91 } 90 }
92 if (context.fType == type && 91 if (context.fType == type &&
93 context.fOptions == options) { 92 context.fOptions == options) {
94 context.fGLContext->makeCurrent(); 93 context.fGLContext->makeCurrent();
95 return ContextInfo(context.fGrContext, context.fGLContext); 94 return ContextInfo(context.fGrContext, context.fGLContext);
96 } 95 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 172 }
174 173
175 Context& context = fContexts.push_back(); 174 Context& context = fContexts.push_back();
176 context.fGLContext = glCtx.release(); 175 context.fGLContext = glCtx.release();
177 context.fGrContext = SkRef(grCtx.get()); 176 context.fGrContext = SkRef(grCtx.get());
178 context.fType = type; 177 context.fType = type;
179 context.fOptions = options; 178 context.fOptions = options;
180 return ContextInfo(context.fGrContext, context.fGLContext); 179 return ContextInfo(context.fGrContext, context.fGLContext);
181 } 180 }
182 } // namespace sk_gpu_test 181 } // namespace sk_gpu_test
OLDNEW
« no previous file with comments | « tools/gpu/GrContextFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698