Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: src/gpu/gl/builders/GrGLShaderStringBuilder.cpp

Issue 1165463005: Begin tracking driver info in GrGLContextInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLShaderStringBuilder.h" 8 #include "GrGLShaderStringBuilder.h"
9 #include "gl/GrGLGpu.h" 9 #include "gl/GrGLGpu.h"
10 #include "gl/GrGLSLPrettyPrint.h" 10 #include "gl/GrGLSLPrettyPrint.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (traceShader) { 47 if (traceShader) {
48 SkString shader = GrGLSLPrettyPrint::PrettyPrintGLSL(strings, lengths, c ount, false); 48 SkString shader = GrGLSLPrettyPrint::PrettyPrintGLSL(strings, lengths, c ount, false);
49 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "skia_gpu::G LShader", 49 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "skia_gpu::G LShader",
50 TRACE_EVENT_SCOPE_THREAD, "shader", TRACE_STR_COPY( shader.c_str())); 50 TRACE_EVENT_SCOPE_THREAD, "shader", TRACE_STR_COPY( shader.c_str()));
51 } 51 }
52 52
53 stats->incShaderCompilations(); 53 stats->incShaderCompilations();
54 GR_GL_CALL(gli, CompileShader(shaderId)); 54 GR_GL_CALL(gli, CompileShader(shaderId));
55 55
56 // Calling GetShaderiv in Chromium is quite expensive. Assume success in rel ease builds. 56 // Calling GetShaderiv in Chromium is quite expensive. Assume success in rel ease builds.
57 bool checkCompiled = !glCtx.isChromium(); 57 bool checkCompiled = kChromium_GrGLDriver != glCtx.driver();
58 #ifdef SK_DEBUG 58 #ifdef SK_DEBUG
59 checkCompiled = true; 59 checkCompiled = true;
60 #endif 60 #endif
61 if (checkCompiled) { 61 if (checkCompiled) {
62 GrGLint compiled = GR_GL_INIT_ZERO; 62 GrGLint compiled = GR_GL_INIT_ZERO;
63 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_COMPILE_STATUS, &compiled)); 63 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_COMPILE_STATUS, &compiled));
64 64
65 if (!compiled) { 65 if (!compiled) {
66 GrGLint infoLen = GR_GL_INIT_ZERO; 66 GrGLint infoLen = GR_GL_INIT_ZERO;
67 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_INFO_LOG_LENGTH, &infoLe n)); 67 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_INFO_LOG_LENGTH, &infoLe n));
(...skipping 18 matching lines...) Expand all
86 } 86 }
87 87
88 // Attach the shader, but defer deletion until after we have linked the prog ram. 88 // Attach the shader, but defer deletion until after we have linked the prog ram.
89 // This works around a bug in the Android emulator's GLES2 wrapper which 89 // This works around a bug in the Android emulator's GLES2 wrapper which
90 // will immediately delete the shader object and free its memory even though it's 90 // will immediately delete the shader object and free its memory even though it's
91 // attached to a program, which then causes glLinkProgram to fail. 91 // attached to a program, which then causes glLinkProgram to fail.
92 GR_GL_CALL(gli, AttachShader(programId, shaderId)); 92 GR_GL_CALL(gli, AttachShader(programId, shaderId));
93 93
94 return shaderId; 94 return shaderId;
95 } 95 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698