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

Unified Diff: src/gpu/GrContextFactory.cpp

Issue 1446453003: Generate list of GPU contexts outside SurfaceTest tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: msvc fixes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContextFactory.h ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContextFactory.cpp
diff --git a/src/gpu/GrContextFactory.cpp b/src/gpu/GrContextFactory.cpp
index acd5d93a04f846fb93d66b697dc89c55e630d280..424b3fda3a86b6047ee45d4fbe94ca056b86a3ff 100755
--- a/src/gpu/GrContextFactory.cpp
+++ b/src/gpu/GrContextFactory.cpp
@@ -23,15 +23,16 @@
#include "gl/GrGLGpu.h"
#include "GrCaps.h"
-GrContext* GrContextFactory::get(GLContextType type, GrGLStandard forcedGpuAPI) {
+GrContextFactory::ContextInfo* GrContextFactory::getContextInfo(GLContextType type,
+ GrGLStandard forcedGpuAPI) {
for (int i = 0; i < fContexts.count(); ++i) {
if (forcedGpuAPI != kNone_GrGLStandard &&
- forcedGpuAPI != fContexts[i].fGLContext->gl()->fStandard)
+ forcedGpuAPI != fContexts[i]->fGLContext->gl()->fStandard)
continue;
- if (fContexts[i].fType == type) {
- fContexts[i].fGLContext->makeCurrent();
- return fContexts[i].fGrContext;
+ if (fContexts[i]->fType == type) {
+ fContexts[i]->fGLContext->makeCurrent();
+ return fContexts[i];
}
}
SkAutoTUnref<SkGLContext> glCtx;
@@ -114,11 +115,9 @@ GrContext* GrContextFactory::get(GLContextType type, GrGLStandard forcedGpuAPI)
}
}
- GPUContext& ctx = fContexts.push_back();
- ctx.fGLContext = glCtx.get();
- ctx.fGLContext->ref();
- ctx.fGrContext = grCtx.get();
- ctx.fGrContext->ref();
- ctx.fType = type;
- return ctx.fGrContext;
+ ContextInfo* ctx = fContexts.emplace_back(new ContextInfo);
+ ctx->fGLContext = SkRef(glCtx.get());
+ ctx->fGrContext = SkRef(grCtx.get());
+ ctx->fType = type;
+ return ctx;
}
« no previous file with comments | « src/gpu/GrContextFactory.h ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698