OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrGLProgram.h" | 8 #include "GrGLProgram.h" |
9 | 9 |
10 #include "GrAllocator.h" | 10 #include "GrAllocator.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 } | 455 } |
456 | 456 |
457 bool needColorFilterUniform; | 457 bool needColorFilterUniform; |
458 bool needComputedColor; | 458 bool needComputedColor; |
459 need_blend_inputs(uniformCoeff, colorCoeff, | 459 need_blend_inputs(uniformCoeff, colorCoeff, |
460 &needColorFilterUniform, &needComputedColor); | 460 &needColorFilterUniform, &needComputedColor); |
461 | 461 |
462 // the dual source output has no canonical var name, have to | 462 // the dual source output has no canonical var name, have to |
463 // declare an output, which is incompatible with gl_FragColor/gl_FragData. | 463 // declare an output, which is incompatible with gl_FragColor/gl_FragData. |
464 bool dualSourceOutputWritten = false; | 464 bool dualSourceOutputWritten = false; |
465 builder.fHeader.append(GrGetGLSLVersionDecl(fContext.info().binding(), | |
466 fContext.info().glslGeneration()
)); | |
467 | 465 |
468 GrGLShaderVar colorOutput; | 466 GrGLShaderVar colorOutput; |
469 bool isColorDeclared = GrGLSLSetupFSColorOuput(fContext.info().glslGeneratio
n(), | 467 bool isColorDeclared = GrGLSLSetupFSColorOuput(fContext.info().glslGeneratio
n(), |
470 declared_color_output_name(), | 468 declared_color_output_name(), |
471 &colorOutput); | 469 &colorOutput); |
472 if (isColorDeclared) { | 470 if (isColorDeclared) { |
473 builder.fFSOutputs.push_back(colorOutput); | 471 builder.fFSOutputs.push_back(colorOutput); |
474 } | 472 } |
475 | 473 |
476 const char* viewMName; | 474 const char* viewMName; |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 SkScalarToFloat(m[SkMatrix::kMTransX]), | 951 SkScalarToFloat(m[SkMatrix::kMTransX]), |
954 SkScalarToFloat(m[SkMatrix::kMTransY]), | 952 SkScalarToFloat(m[SkMatrix::kMTransY]), |
955 SkScalarToFloat(m[SkMatrix::kMPersp2]) | 953 SkScalarToFloat(m[SkMatrix::kMPersp2]) |
956 }; | 954 }; |
957 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, mt); | 955 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, mt); |
958 fMatrixState.fViewMatrix = drawState.getViewMatrix(); | 956 fMatrixState.fViewMatrix = drawState.getViewMatrix(); |
959 fMatrixState.fRenderTargetSize = size; | 957 fMatrixState.fRenderTargetSize = size; |
960 fMatrixState.fRenderTargetOrigin = rt->origin(); | 958 fMatrixState.fRenderTargetOrigin = rt->origin(); |
961 } | 959 } |
962 } | 960 } |
OLD | NEW |