| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "GrGLProgramDesc.h" | 7 #include "GrGLProgramDesc.h" |
| 8 | 8 |
| 9 #include "GrProcessor.h" | 9 #include "GrProcessor.h" |
| 10 #include "GrPipeline.h" | 10 #include "GrPipeline.h" |
| 11 #include "GrRenderTargetPriv.h" | 11 #include "GrRenderTargetPriv.h" |
| 12 #include "SkChecksum.h" | 12 #include "SkChecksum.h" |
| 13 #include "gl/GrGLDefines.h" | 13 #include "gl/GrGLDefines.h" |
| 14 #include "gl/GrGLTexture.h" | 14 #include "gl/GrGLTexture.h" |
| 15 #include "gl/GrGLTypes.h" | 15 #include "gl/GrGLTypes.h" |
| 16 #include "glsl/GrGLSLFragmentProcessor.h" | 16 #include "glsl/GrGLSLFragmentProcessor.h" |
| 17 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 17 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
| 18 #include "glsl/GrGLSLCaps.h" | 18 #include "glsl/GrGLSLCaps.h" |
| 19 | 19 |
| 20 static uint8_t texture_target_key(GrGLenum target) { | 20 static uint8_t texture_target_key(GrGLenum target) { |
| 21 switch (target) { | 21 switch (target) { |
| 22 case GR_GL_TEXTURE_2D: | 22 case GR_GL_TEXTURE_2D: |
| 23 return 0; | 23 return 0; |
| 24 case GR_GL_TEXTURE_EXTERNAL: | 24 case GR_GL_TEXTURE_EXTERNAL: |
| 25 return 1; | 25 return 1; |
| 26 case GR_GL_TEXTURE_RECTANGLE: | 26 case GR_GL_TEXTURE_RECTANGLE: |
| 27 return 2; | 27 return 2; |
| 28 case GR_GL_TEXTURE_BUFFER: |
| 29 return 3; |
| 28 default: | 30 default: |
| 29 SkFAIL("Unexpected texture target."); | 31 SkFAIL("Unexpected texture target."); |
| 30 return 0; | 32 return 0; |
| 31 } | 33 } |
| 32 } | 34 } |
| 33 | 35 |
| 34 static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc, | 36 static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc, |
| 35 const GrGLSLCaps& caps) { | 37 const GrGLSLCaps& caps) { |
| 36 int numTextures = proc.numTextures(); | 38 int numTextures = proc.numTextures(); |
| 37 // Need two bytes per key (swizzle and target). | 39 // Need two bytes per key (swizzle and target). |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } else { | 174 } else { |
| 173 header->fIgnoresCoverage = 0; | 175 header->fIgnoresCoverage = 0; |
| 174 } | 176 } |
| 175 | 177 |
| 176 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); | 178 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); |
| 177 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); | 179 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); |
| 178 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); | 180 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); |
| 179 glDesc->finalize(); | 181 glDesc->finalize(); |
| 180 return true; | 182 return true; |
| 181 } | 183 } |
| OLD | NEW |