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
Review URL: https://codereview.chromium.org/1448883002
diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h
index bccf112..627dc4f 100644
--- a/dm/DMGpuSupport.h
+++ b/dm/DMGpuSupport.h
@@ -30,14 +30,15 @@
static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory,
GrContextFactory::GLContextType type,
+ GrContextFactory::GLContextOptions options,
GrGLStandard gpuAPI,
SkImageInfo info,
int samples,
bool useDIText) {
uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag : 0;
SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
- return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), SkSurface::kNo_Budgeted,
- info, samples, &props);
+ return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI, options),
+ SkSurface::kNo_Budgeted, info, samples, &props);
}
} // namespace DM
@@ -75,6 +76,10 @@
kNative_GLContextType = 0,
kNull_GLContextType = 0;
static const int kGLContextTypeCnt = 1;
+ enum GLContextOptions {
+ kNone_GLContextOptions = 0,
+ kEnableNVPR_GLContextOptions = 0x1,
+ };
void destroyContexts() {}
void abandonContexts() {}
@@ -86,6 +91,7 @@
static inline SkSurface* NewGpuSurface(GrContextFactory*,
GrContextFactory::GLContextType,
+ GrContextFactory::GLContextOptions,
GrGLStandard,
SkImageInfo,
int,