Various GL testing fixes

Check for GL context when printing NVPR error string.
Fix some indenting.

Review URL: https://codereview.chromium.org/1235283004
This commit is contained in:
jvanverth 2015-07-16 07:46:07 -07:00 committed by Commit bot
parent c83a29759a
commit 3e5f55542c
3 changed files with 16 additions and 10 deletions

View File

@ -59,8 +59,7 @@ protected:
signed char* uvPixels[2];
yPixels = static_cast<unsigned char*>(fYUVBmps[0].getPixels());
uvPixels[0] = static_cast<signed char*>(fYUVBmps[1].getPixels());
uvPixels[1] = static_cast<signed char*>(fYUVBmps[2
].getPixels());
uvPixels[1] = static_cast<signed char*>(fYUVBmps[2].getPixels());
// Here we encode using the NTC encoding (even though we will draw it with all the supported
// yuv color spaces when converted back to RGB)

View File

@ -83,12 +83,19 @@ GrContext* GrContextFactory::get(GLContextType type, GrGLStandard forcedGpuAPI)
// Warn if path rendering support is not available for the NVPR type.
if (kNVPR_GLContextType == type) {
if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) {
GrGLGpu* gpu = static_cast<GrGLGpu*>(grCtx->getGpu());
const GrGLubyte* verUByte;
GR_GL_CALL_RET(gpu->glInterface(), verUByte, GetString(GR_GL_VERSION));
const char* ver = reinterpret_cast<const char*>(verUByte);
SkDebugf("\nWARNING: nvprmsaa config requested, but driver path rendering support not"
" available. Maybe update the driver? Your driver version string: \"%s\"\n", ver);
GrGpu* gpu = grCtx->getGpu();
const GrGLContext* ctx = gpu->glContextForTesting();
if (ctx) {
const GrGLubyte* verUByte;
GR_GL_CALL_RET(ctx->interface(), verUByte, GetString(GR_GL_VERSION));
const char* ver = reinterpret_cast<const char*>(verUByte);
SkDebugf("\nWARNING: nvprmsaa config requested, but driver path rendering "
"support not available. Maybe update the driver? Your driver version "
"string: \"%s\"\n", ver);
} else {
SkDebugf("\nWARNING: nvprmsaa config requested, but driver path rendering "
"support not available.\n");
}
}
}

View File

@ -197,11 +197,11 @@ static void test_wrapped_resources(skiatest::Reporter* reporter, GrContext* cont
desc.fTextureHandle = texIDs[0];
SkAutoTUnref<GrTexture> borrowed(context->textureProvider()->wrapBackendTexture(
desc, kBorrow_GrWrapOwnership));
desc, kBorrow_GrWrapOwnership));
desc.fTextureHandle = texIDs[1];
SkAutoTUnref<GrTexture> adopted(context->textureProvider()->wrapBackendTexture(
desc, kAdopt_GrWrapOwnership));
desc, kAdopt_GrWrapOwnership));
REPORTER_ASSERT(reporter, SkToBool(borrowed) && SkToBool(adopted));
if (!SkToBool(borrowed) || !SkToBool(adopted)) {