diff options
author | 2015-12-08 01:24:40 -0800 | |
---|---|---|
committer | 2015-12-08 01:24:40 -0800 | |
commit | 64492c43c3faee7ab0f69b1c84e0267616f85e52 (patch) | |
tree | 1e87911280dc78c7a37b853bfbca3e45ce2a0810 /dm/DMGpuSupport.h | |
parent | c6e7a13489eda2abf7a03ea8de3a4abbab1c597d (diff) |
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
Review URL: https://codereview.chromium.org/1448883002
Diffstat (limited to 'dm/DMGpuSupport.h')
-rw-r--r-- | dm/DMGpuSupport.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h index bccf112f72..627dc4fda3 100644 --- a/dm/DMGpuSupport.h +++ b/dm/DMGpuSupport.h @@ -30,14 +30,15 @@ static const bool kGPUDisabled = false; 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 @@ public: 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 const bool kGPUDisabled = true; static inline SkSurface* NewGpuSurface(GrContextFactory*, GrContextFactory::GLContextType, + GrContextFactory::GLContextOptions, GrGLStandard, SkImageInfo, int, |