| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 default: | 98 default: |
| 99 NOTREACHED(); | 99 NOTREACHED(); |
| 100 break; | 100 break; |
| 101 } | 101 } |
| 102 return id; | 102 return id; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Returns the correct fragment shader id to evaluate the copy operation for | 105 // Returns the correct fragment shader id to evaluate the copy operation for |
| 106 // the premultiply alpha pixel store settings and target. | 106 // the premultiply alpha pixel store settings and target. |
| 107 ShaderId GetFragmentShaderId(bool premultiply_alpha, | 107 ShaderId GetFragmentShaderId(bool premultiply_alpha, |
| 108 bool unpremultiply_alpha, | 108 bool unpremultiply_alpha, |
| 109 GLenum target, | 109 GLenum target, |
| 110 GLenum source_format, | 110 GLenum source_format, |
| 111 GLenum dest_format) { | 111 GLenum dest_format) { |
| 112 unsigned alphaIndex = 0; | 112 unsigned alphaIndex = 0; |
| 113 unsigned targetIndex = 0; | 113 unsigned targetIndex = 0; |
| 114 unsigned sourceFormatIndex = 0; | 114 unsigned sourceFormatIndex = 0; |
| 115 unsigned destFormatIndex = 0; | 115 unsigned destFormatIndex = 0; |
| 116 | 116 |
| 117 alphaIndex = (premultiply_alpha ? (1 << 0) : 0) | | 117 alphaIndex = (premultiply_alpha ? (1 << 0) : 0) | |
| 118 (unpremultiply_alpha ? (1 << 1) : 0); | 118 (unpremultiply_alpha ? (1 << 1) : 0); |
| 119 | 119 |
| 120 switch (target) { | 120 switch (target) { |
| 121 case GL_TEXTURE_2D: | 121 case GL_TEXTURE_2D: |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 decoder->RestoreTextureUnitBindings(0); | 1147 decoder->RestoreTextureUnitBindings(0); |
| 1148 decoder->RestoreActiveTexture(); | 1148 decoder->RestoreActiveTexture(); |
| 1149 decoder->RestoreProgramBindings(); | 1149 decoder->RestoreProgramBindings(); |
| 1150 decoder->RestoreBufferBindings(); | 1150 decoder->RestoreBufferBindings(); |
| 1151 decoder->RestoreFramebufferBindings(); | 1151 decoder->RestoreFramebufferBindings(); |
| 1152 decoder->RestoreGlobalState(); | 1152 decoder->RestoreGlobalState(); |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 } // namespace gles2 | 1155 } // namespace gles2 |
| 1156 } // namespace gpu | 1156 } // namespace gpu |
| OLD | NEW |