diff options
author | mtklein <mtklein@chromium.org> | 2014-11-05 12:28:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-05 12:28:26 -0800 |
commit | 31f88675718966bbb7f09718b40de10c7e214739 (patch) | |
tree | 5c3d2b74b9a9a22cecfd9a934eaf9358dcd2fa53 /dm | |
parent | 820dd6c335411aad889c1d7e8a857642ecd87e30 (diff) |
Turn on NVPR 4x MSAA by default when supported in DM and nanobench.
This brings DM and nanobench's default configs in line with GM's.
BUG=skia:
Review URL: https://codereview.chromium.org/704563003
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DMGpuGMTask.cpp | 8 | ||||
-rw-r--r-- | dm/DMGpuSupport.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/dm/DMGpuGMTask.cpp b/dm/DMGpuGMTask.cpp index fb170a26b9..2890483f55 100644 --- a/dm/DMGpuGMTask.cpp +++ b/dm/DMGpuGMTask.cpp @@ -22,6 +22,8 @@ GpuGMTask::GpuGMTask(const char* config, , fSampleCount(sampleCount) {} +static bool gAlreadyWarned[GrContextFactory::kGLContextTypeCnt][kGrGLStandardCnt]; + void GpuGMTask::draw(GrContextFactory* grFactory) { SkImageInfo info = SkImageInfo::Make(SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt(fGM->height()), @@ -30,7 +32,11 @@ void GpuGMTask::draw(GrContextFactory* grFactory) { SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, fGpuAPI, info, fSampleCount)); if (!surface) { - this->fail("Could not create context for the config and the api."); + if (!gAlreadyWarned[fContextType][fGpuAPI]) { + SkDebugf("FYI: couldn't create GPU context, type %d API %d. Will skip.\n", + fContextType, fGpuAPI); + gAlreadyWarned[fContextType][fGpuAPI] = true; + } return; } SkCanvas* canvas = surface->getCanvas(); diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h index af6270dfc3..90b0ea55cf 100644 --- a/dm/DMGpuSupport.h +++ b/dm/DMGpuSupport.h @@ -36,6 +36,7 @@ enum GrGLStandard { kGL_GrGLStandard, kGLES_GrGLStandard }; +static const int kGrGLStandardCnt = 3; class GrContextFactory { public: @@ -47,6 +48,7 @@ public: kNVPR_GLContextType = 0, kNative_GLContextType = 0, kNull_GLContextType = 0; + static const int kGLContextTypeCnt = 1; void destroyContexts() {} void abandonContexts() {} |