skiaserve no longer crashes when no X server is present
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2059263002 Review-Url: https://codereview.chromium.org/2059263002
This commit is contained in:
parent
76963e7370
commit
2ec06c9b1c
@ -71,8 +71,14 @@ SkCanvas* Request::getCanvas() {
|
|||||||
#if SK_SUPPORT_GPU
|
#if SK_SUPPORT_GPU
|
||||||
GrContextFactory* factory = fContextFactory;
|
GrContextFactory* factory = fContextFactory;
|
||||||
GLTestContext* gl = factory->getContextInfo(GrContextFactory::kNativeGL_ContextType,
|
GLTestContext* gl = factory->getContextInfo(GrContextFactory::kNativeGL_ContextType,
|
||||||
GrContextFactory::kNone_ContextOptions).glContext();
|
GrContextFactory::kNone_ContextOptions).glContext();
|
||||||
gl->makeCurrent();
|
if (!gl) {
|
||||||
|
gl = factory->getContextInfo(GrContextFactory::kMESA_ContextType,
|
||||||
|
GrContextFactory::kNone_ContextOptions).glContext();
|
||||||
|
}
|
||||||
|
if (gl) {
|
||||||
|
gl->makeCurrent();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
SkASSERT(fDebugCanvas);
|
SkASSERT(fDebugCanvas);
|
||||||
|
|
||||||
@ -115,10 +121,15 @@ SkData* Request::writeOutSkp() {
|
|||||||
|
|
||||||
GrContext* Request::getContext() {
|
GrContext* Request::getContext() {
|
||||||
#if SK_SUPPORT_GPU
|
#if SK_SUPPORT_GPU
|
||||||
return fContextFactory->get(GrContextFactory::kNativeGL_ContextType,
|
GrContext* result = fContextFactory->get(GrContextFactory::kNativeGL_ContextType,
|
||||||
GrContextFactory::kNone_ContextOptions);
|
GrContextFactory::kNone_ContextOptions);
|
||||||
|
if (!result) {
|
||||||
|
result = fContextFactory->get(GrContextFactory::kMESA_ContextType,
|
||||||
|
GrContextFactory::kNone_ContextOptions);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
#else
|
#else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user