aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-24 14:38:13 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-24 14:38:13 +0000
commit83d81c96de34950bdd84dc575997a250b685a3d6 (patch)
tree4b6369af0e88494794a0bc9a8ca9bedfc500db0b /samplecode
parent1c2f8c2973df1ee04f7a09bbdec4650f6ee74380 (diff)
Turn NVPR on by default (but off in tools).
BUG=skia:2042 R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/144003006 git-svn-id: http://skia.googlecode.com/svn/trunk@13164 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleApp.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 127646d0d7..3b953f4846 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -210,6 +210,7 @@ public:
fMSAASampleCount = msaaSampleCount;
SkASSERT(NULL == fCurIntf);
+ SkAutoTUnref<const GrGLInterface> glInterface;
switch (win->getDeviceType()) {
case kRaster_DeviceType:
// fallthrough
@@ -217,21 +218,25 @@ public:
// fallthrough
case kGPU_DeviceType:
// all these guys use the native interface
- fCurIntf = GrGLCreateNativeInterface();
+ glInterface.reset(GrGLCreateNativeInterface());
break;
#if SK_ANGLE
case kANGLE_DeviceType:
- fCurIntf = GrGLCreateANGLEInterface();
+ glInterface.reset(GrGLCreateANGLEInterface());
break;
#endif // SK_ANGLE
case kNullGPU_DeviceType:
- fCurIntf = GrGLCreateNullInterface();
+ glInterface.reset(GrGLCreateNullInterface());
break;
default:
SkASSERT(false);
break;
}
+ // Currently SampleApp does not use NVPR. TODO: Provide an NVPR device type that is skipped
+ // when the driver doesn't support NVPR.
+ fCurIntf = GrGLInterfaceRemoveNVPR(glInterface.get());
+
SkASSERT(NULL == fCurContext);
fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fCurIntf);
@@ -239,6 +244,8 @@ public:
// We need some context and interface to see results
SkSafeUnref(fCurContext);
SkSafeUnref(fCurIntf);
+ fCurContext = NULL;
+ fCurIntf = NULL;
SkDebugf("Failed to setup 3D");
win->detach();