| OLD | NEW |
| 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 "GrGLFragmentShaderBuilder.h" | 8 #include "GrGLFragmentShaderBuilder.h" |
| 9 #include "GrGLShaderStringBuilder.h" | 9 #include "GrGLShaderStringBuilder.h" |
| 10 #include "GrGLProgramBuilder.h" | 10 #include "GrGLProgramBuilder.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 GrGLFragmentShaderBuilder::DstReadKey GrGLFragmentShaderBuilder::KeyForDstRead( | 45 GrGLFragmentShaderBuilder::DstReadKey GrGLFragmentShaderBuilder::KeyForDstRead( |
| 46 const GrTexture* dstCopy, const GrGLCaps& caps) { | 46 const GrTexture* dstCopy, const GrGLCaps& caps) { |
| 47 uint32_t key = kYesDstRead_DstReadKeyBit; | 47 uint32_t key = kYesDstRead_DstReadKeyBit; |
| 48 if (caps.fbFetchSupport()) { | 48 if (caps.fbFetchSupport()) { |
| 49 return key; | 49 return key; |
| 50 } | 50 } |
| 51 SkASSERT(NULL != dstCopy); | 51 SkASSERT(dstCopy); |
| 52 if (!caps.textureSwizzleSupport() && GrPixelConfigIsAlphaOnly(dstCopy->confi
g())) { | 52 if (!caps.textureSwizzleSupport() && GrPixelConfigIsAlphaOnly(dstCopy->confi
g())) { |
| 53 // The fact that the config is alpha-only must be considered when genera
ting code. | 53 // The fact that the config is alpha-only must be considered when genera
ting code. |
| 54 key |= kUseAlphaConfig_DstReadKeyBit; | 54 key |= kUseAlphaConfig_DstReadKeyBit; |
| 55 } | 55 } |
| 56 if (kTopLeft_GrSurfaceOrigin == dstCopy->origin()) { | 56 if (kTopLeft_GrSurfaceOrigin == dstCopy->origin()) { |
| 57 key |= kTopLeftOrigin_DstReadKeyBit; | 57 key |= kTopLeftOrigin_DstReadKeyBit; |
| 58 } | 58 } |
| 59 SkASSERT(static_cast<DstReadKey>(key) == key); | 59 SkASSERT(static_cast<DstReadKey>(key) == key); |
| 60 return static_cast<DstReadKey>(key); | 60 return static_cast<DstReadKey>(key); |
| 61 } | 61 } |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 dual_source_output_name()); | 343 dual_source_output_name()); |
| 344 fHasSecondaryOutput = true; | 344 fHasSecondaryOutput = true; |
| 345 } | 345 } |
| 346 return dual_source_output_name(); | 346 return dual_source_output_name(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 const char* GrGLFragmentShaderBuilder::getColorOutputName() const { | 349 const char* GrGLFragmentShaderBuilder::getColorOutputName() const { |
| 350 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor"
; | 350 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor"
; |
| 351 } | 351 } |
| 352 | 352 |
| OLD | NEW |