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

Unified Diff: src/gpu/gl/GrGLSL.cpp

Issue 1144433002: Move copy-surface-as-draw fallback to GrGLGpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@vares
Patch Set: remove incorrect assert Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLSL.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLSL.cpp
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index d388d9120a1d3fc43891ba47a50f2f4221ddb432..f4caf5201292ffbe837129d077fccbbc1d0586b1 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -91,6 +91,25 @@ const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) {
}
}
+void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision p, GrGLStandard s, SkString* out) {
+ // Desktop GLSL has added precision qualifiers but they don't do anything.
+ if (kGLES_GrGLStandard == s) {
+ switch (p) {
+ case kHigh_GrSLPrecision:
+ out->append("precision highp float;\n");
+ break;
+ case kMedium_GrSLPrecision:
+ out->append("precision mediump float;\n");
+ break;
+ case kLow_GrSLPrecision:
+ out->append("precision lowp float;\n");
+ break;
+ default:
+ SkFAIL("Unknown precision value.");
+ }
+ }
+}
+
void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSLExpr4& mulFactor) {
if (mulFactor.isOnes()) {
*outAppend = SkString();
« no previous file with comments | « src/gpu/gl/GrGLSL.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698