9d66696f6b
Reason for revert: "Could not create surface" on Linux GTX660 bots Original issue's description: > Make NVPR a GL context option instead of a GL context > > Make NVPR a GL context option instead of a GL context. > This may enable NVPR to be run with command buffer > interface. > > No functionality change in DM or nanobench. NVPR can > only be run with normal GL APIs. > > BUG=skia:2992 > > Committed: https://skia.googlesource.com/skia/+/eeebdb538d476c1bfc8b63a946094ca1b505ecd1 > > Committed: https://skia.googlesource.com/skia/+/64492c43c3faee7ab0f69b1c84e0267616f85e52 TBR=mtklein@google.com,bsalomon@google.com,jvanverth@google.com,scroggo@google.com,kkinnunen@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:2992 Review URL: https://codereview.chromium.org/1513703002
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
/*
|
|
* Copyright 2011 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include "SkTypes.h"
|
|
|
|
#if SK_SUPPORT_GPU
|
|
|
|
#include "GrContextFactory.h"
|
|
#include "GrCaps.h"
|
|
#include "Test.h"
|
|
|
|
DEF_GPUTEST(GrContextFactory_NVPRContextTypeHasPathRenderingSupport, reporter, /*factory*/) {
|
|
// Test that if NVPR is requested, the context always has path rendering
|
|
// or the context creation fails.
|
|
GrContextFactory testFactory;
|
|
GrContext* context = testFactory.get(GrContextFactory::kNVPR_GLContextType);
|
|
if (context) {
|
|
REPORTER_ASSERT(
|
|
reporter,
|
|
context->caps()->shaderCaps()->pathRenderingSupport());
|
|
}
|
|
}
|
|
|
|
DEF_GPUTEST(GrContextFactory_NoPathRenderingUnlessNVPRRequested, reporter, /*factory*/) {
|
|
// Test that if NVPR is not requested, the context never has path rendering support.
|
|
|
|
GrContextFactory testFactory;
|
|
for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) {
|
|
GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType)i;
|
|
if (glCtxType == GrContextFactory::kNVPR_GLContextType) {
|
|
continue;
|
|
}
|
|
GrContext* context = testFactory.get(glCtxType);
|
|
if (context) {
|
|
REPORTER_ASSERT(
|
|
reporter,
|
|
!context->caps()->shaderCaps()->pathRenderingSupport());
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|