Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "gpu/command_buffer/service/gl_utils.h" | 10 #include "gpu/command_buffer/service/gl_utils.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 return shader_ids[index][SAMPLER_2D]; | 160 return shader_ids[index][SAMPLER_2D]; |
| 161 case GL_TEXTURE_RECTANGLE_ARB: | 161 case GL_TEXTURE_RECTANGLE_ARB: |
| 162 return shader_ids[index][SAMPLER_RECTANGLE_ARB]; | 162 return shader_ids[index][SAMPLER_RECTANGLE_ARB]; |
| 163 case GL_TEXTURE_EXTERNAL_OES: | 163 case GL_TEXTURE_EXTERNAL_OES: |
| 164 return shader_ids[index][SAMPLER_EXTERNAL_OES]; | 164 return shader_ids[index][SAMPLER_EXTERNAL_OES]; |
| 165 default: | 165 default: |
| 166 break; | 166 break; |
| 167 } | 167 } |
| 168 | 168 |
| 169 NOTREACHED(); | 169 NOTREACHED(); |
| 170 return shader_ids[index][SAMPLER_2D]; | 170 return shader_ids[0][SAMPLER_2D]; |
| 171 } | 171 } |
| 172 | 172 |
| 173 void CompileShader(GLuint shader, const char* shader_source) { | 173 void CompileShader(GLuint shader, const char* shader_source) { |
| 174 glShaderSource(shader, 1, &shader_source, 0); | 174 glShaderSource(shader, 1, &shader_source, 0); |
| 175 glCompileShader(shader); | 175 glCompileShader(shader); |
| 176 #ifndef NDEBUG | 176 #ifndef NDEBUG |
| 177 GLint compile_status; | 177 GLint compile_status; |
| 178 glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status); | 178 glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status); |
| 179 if (GL_TRUE != compile_status) | 179 if (GL_TRUE != compile_status) |
| 180 DLOG(ERROR) << "CopyTextureCHROMIUM: shader compilation failure."; | 180 DLOG(ERROR) << "CopyTextureCHROMIUM: shader compilation failure."; |
| 181 #endif | 181 #endif |
| 182 } | 182 } |
| 183 | 183 |
| 184 void DeleteShader(GLuint shader) { | 184 void DeleteShader(GLuint shader) { |
| 185 if (shader) | 185 if (shader) |
| 186 glDeleteShader(shader); | 186 glDeleteShader(shader); |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool BindFramebufferTexture2D( | |
| 190 GLenum target, | |
| 191 GLuint texture_id, | |
| 192 GLint level, | |
| 193 GLuint framebuffer) { | |
| 194 DCHECK(target == GL_TEXTURE_2D || target == GL_TEXTURE_RECTANGLE_ARB); | |
| 195 glActiveTexture(GL_TEXTURE0); | |
| 196 glBindTexture(target, texture_id); | |
| 197 // NVidia drivers require texture settings to be a certain way | |
| 198 // or they won't report FRAMEBUFFER_COMPLETE. | |
| 199 glTexParameterf(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | |
| 200 glTexParameterf(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | |
| 201 glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | |
| 202 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | |
| 203 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer); | |
| 204 glFramebufferTexture2DEXT( | |
| 205 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target, texture_id, level); | |
| 206 | |
| 207 #ifndef NDEBUG | |
| 208 GLenum fb_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); | |
| 209 if (GL_FRAMEBUFFER_COMPLETE != fb_status) { | |
| 210 DLOG(ERROR) << "CopyTextureCHROMIUM: Incomplete framebuffer."; | |
| 211 return false; | |
| 212 } | |
| 213 #endif | |
| 214 return true; | |
| 215 } | |
| 216 | |
| 217 void DoCopyTexImage2D( | |
| 218 const gpu::gles2::GLES2Decoder* decoder, | |
| 219 GLenum source_target, | |
| 220 GLuint source_id, | |
| 221 GLuint dest_id, | |
| 222 GLint level, | |
| 223 GLenum internal_format, | |
| 224 GLsizei width, | |
| 225 GLsizei height, | |
| 226 GLuint framebuffer) { | |
| 227 DCHECK(source_target == GL_TEXTURE_2D || | |
| 228 source_target == GL_TEXTURE_RECTANGLE_ARB); | |
| 229 if (BindFramebufferTexture2D(source_target, source_id, | |
| 230 0 /* level */, framebuffer)) { | |
| 231 glBindTexture(GL_TEXTURE_2D, dest_id); | |
| 232 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | |
| 233 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | |
| 234 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | |
| 235 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | |
| 236 glCopyTexImage2D(GL_TEXTURE_2D, | |
| 237 level, | |
| 238 internal_format, | |
| 239 0 /* x */, | |
| 240 0 /* y */, | |
| 241 width, | |
| 242 height, | |
| 243 0 /* border */); | |
| 244 } | |
| 245 | |
| 246 decoder->RestoreTextureState(source_id); | |
| 247 decoder->RestoreTextureState(dest_id); | |
| 248 decoder->RestoreTextureUnitBindings(0); | |
| 249 decoder->RestoreActiveTexture(); | |
| 250 decoder->RestoreFramebufferBindings(); | |
| 251 } | |
| 252 | |
| 189 } // namespace | 253 } // namespace |
| 190 | 254 |
| 191 namespace gpu { | 255 namespace gpu { |
| 192 | 256 |
| 193 CopyTextureCHROMIUMResourceManager::CopyTextureCHROMIUMResourceManager() | 257 CopyTextureCHROMIUMResourceManager::CopyTextureCHROMIUMResourceManager() |
| 194 : initialized_(false), | 258 : initialized_(false), |
| 195 vertex_shaders_(NUM_VERTEX_SHADERS, 0u), | 259 vertex_shaders_(NUM_VERTEX_SHADERS, 0u), |
| 196 fragment_shaders_(NUM_FRAGMENT_SHADERS, 0u), | 260 fragment_shaders_(NUM_FRAGMENT_SHADERS, 0u), |
| 197 buffer_id_(0u), | 261 buffer_id_(0u), |
| 198 framebuffer_(0u) {} | 262 framebuffer_(0u) {} |
| 199 | 263 |
| 200 CopyTextureCHROMIUMResourceManager::~CopyTextureCHROMIUMResourceManager() {} | 264 CopyTextureCHROMIUMResourceManager::~CopyTextureCHROMIUMResourceManager() { |
| 265 DCHECK(!buffer_id_ && !framebuffer_); | |
|
reveman
2014/07/10 18:13:18
DCHECK(!buffer_id_);
DCHECK(!framebuffer_);
is be
dshwang
2014/07/10 19:45:34
Done.
| |
| 266 } | |
| 201 | 267 |
| 202 void CopyTextureCHROMIUMResourceManager::Initialize( | 268 void CopyTextureCHROMIUMResourceManager::Initialize( |
| 203 const gles2::GLES2Decoder* decoder) { | 269 const gles2::GLES2Decoder* decoder) { |
| 204 COMPILE_ASSERT( | 270 COMPILE_ASSERT( |
| 205 kVertexPositionAttrib == 0u, | 271 kVertexPositionAttrib == 0u, |
| 206 Position_attribs_must_be_0); | 272 Position_attribs_must_be_0); |
| 273 DCHECK(!buffer_id_ && !framebuffer_ && programs_.empty()); | |
|
reveman
2014/07/10 18:13:18
split DCHECK into multiple lines here too.
dshwang
2014/07/10 19:45:34
Done.
| |
| 207 | 274 |
| 208 // Initialize all of the GPU resources required to perform the copy. | 275 // Initialize all of the GPU resources required to perform the copy. |
| 209 glGenBuffersARB(1, &buffer_id_); | 276 glGenBuffersARB(1, &buffer_id_); |
| 210 glBindBuffer(GL_ARRAY_BUFFER, buffer_id_); | 277 glBindBuffer(GL_ARRAY_BUFFER, buffer_id_); |
| 211 const GLfloat kQuadVertices[] = {-1.0f, -1.0f, | 278 const GLfloat kQuadVertices[] = {-1.0f, -1.0f, |
| 212 1.0f, -1.0f, | 279 1.0f, -1.0f, |
| 213 1.0f, 1.0f, | 280 1.0f, 1.0f, |
| 214 -1.0f, 1.0f}; | 281 -1.0f, 1.0f}; |
| 215 glBufferData( | 282 glBufferData( |
| 216 GL_ARRAY_BUFFER, sizeof(kQuadVertices), kQuadVertices, GL_STATIC_DRAW); | 283 GL_ARRAY_BUFFER, sizeof(kQuadVertices), kQuadVertices, GL_STATIC_DRAW); |
| 217 | 284 |
| 218 glGenFramebuffersEXT(1, &framebuffer_); | 285 glGenFramebuffersEXT(1, &framebuffer_); |
| 219 | 286 |
| 220 decoder->RestoreBufferBindings(); | 287 decoder->RestoreBufferBindings(); |
| 221 | 288 |
| 222 initialized_ = true; | 289 initialized_ = true; |
| 223 } | 290 } |
| 224 | 291 |
| 225 void CopyTextureCHROMIUMResourceManager::Destroy() { | 292 void CopyTextureCHROMIUMResourceManager::Destroy() { |
| 226 if (!initialized_) | 293 if (!initialized_) |
| 227 return; | 294 return; |
| 228 | 295 |
| 229 glDeleteFramebuffersEXT(1, &framebuffer_); | 296 glDeleteFramebuffersEXT(1, &framebuffer_); |
| 297 framebuffer_ = 0; | |
| 230 | 298 |
| 231 std::for_each(vertex_shaders_.begin(), vertex_shaders_.end(), DeleteShader); | 299 std::for_each(vertex_shaders_.begin(), vertex_shaders_.end(), DeleteShader); |
| 232 std::for_each( | 300 std::for_each( |
| 233 fragment_shaders_.begin(), fragment_shaders_.end(), DeleteShader); | 301 fragment_shaders_.begin(), fragment_shaders_.end(), DeleteShader); |
| 234 | 302 |
| 235 for (ProgramMap::const_iterator it = programs_.begin(); it != programs_.end(); | 303 for (ProgramMap::const_iterator it = programs_.begin(); it != programs_.end(); |
| 236 ++it) { | 304 ++it) { |
| 237 const ProgramInfo& info = it->second; | 305 const ProgramInfo& info = it->second; |
| 238 glDeleteProgram(info.program); | 306 glDeleteProgram(info.program); |
| 239 } | 307 } |
| 240 | 308 |
| 241 glDeleteBuffersARB(1, &buffer_id_); | 309 glDeleteBuffersARB(1, &buffer_id_); |
| 310 buffer_id_ = 0; | |
| 242 } | 311 } |
| 243 | 312 |
| 244 void CopyTextureCHROMIUMResourceManager::DoCopyTexture( | 313 void CopyTextureCHROMIUMResourceManager::DoCopyTexture( |
| 245 const gles2::GLES2Decoder* decoder, | 314 const gles2::GLES2Decoder* decoder, |
| 246 GLenum source_target, | 315 GLenum source_target, |
| 247 GLenum dest_target, | |
| 248 GLuint source_id, | 316 GLuint source_id, |
| 249 GLuint dest_id, | 317 GLuint dest_id, |
| 250 GLint level, | 318 GLint level, |
| 319 GLenum internal_format, | |
| 251 GLsizei width, | 320 GLsizei width, |
| 252 GLsizei height, | 321 GLsizei height, |
| 253 bool flip_y, | 322 bool flip_y, |
| 254 bool premultiply_alpha, | 323 bool premultiply_alpha, |
| 255 bool unpremultiply_alpha) { | 324 bool unpremultiply_alpha) { |
| 325 bool premultiply_alpha_change = premultiply_alpha ^ unpremultiply_alpha; | |
| 326 // GL_TEXTURE_RECTANGLE_ARB on FBO is supported by OpenGL, not GLES2, | |
| 327 // so restrict this to GL_TEXTURE_2D. | |
| 328 if (source_target == GL_TEXTURE_2D && !flip_y && !premultiply_alpha_change) { | |
| 329 DoCopyTexImage2D(decoder, | |
| 330 source_target, | |
| 331 source_id, | |
| 332 dest_id, | |
| 333 level, | |
| 334 internal_format, | |
| 335 width, | |
| 336 height, | |
| 337 framebuffer_); | |
| 338 return; | |
| 339 } | |
| 340 | |
| 256 // Use default transform matrix if no transform passed in. | 341 // Use default transform matrix if no transform passed in. |
| 257 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, | 342 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, |
| 258 0.0f, 1.0f, 0.0f, 0.0f, | 343 0.0f, 1.0f, 0.0f, 0.0f, |
| 259 0.0f, 0.0f, 1.0f, 0.0f, | 344 0.0f, 0.0f, 1.0f, 0.0f, |
| 260 0.0f, 0.0f, 0.0f, 1.0f}; | 345 0.0f, 0.0f, 0.0f, 1.0f}; |
| 261 DoCopyTextureWithTransform(decoder, source_target, dest_target, source_id, | 346 DoCopyTextureWithTransform(decoder, source_target, source_id, dest_id, |
| 262 dest_id, level, width, height, flip_y, premultiply_alpha, | 347 level, internal_format, width, height, flip_y, premultiply_alpha, |
| 263 unpremultiply_alpha, default_matrix); | 348 unpremultiply_alpha, default_matrix); |
| 264 } | 349 } |
| 265 | 350 |
| 266 void CopyTextureCHROMIUMResourceManager::DoCopyTextureWithTransform( | 351 void CopyTextureCHROMIUMResourceManager::DoCopyTextureWithTransform( |
| 267 const gles2::GLES2Decoder* decoder, | 352 const gles2::GLES2Decoder* decoder, |
| 268 GLenum source_target, | 353 GLenum source_target, |
| 269 GLenum dest_target, | |
| 270 GLuint source_id, | 354 GLuint source_id, |
| 271 GLuint dest_id, | 355 GLuint dest_id, |
| 272 GLint level, | 356 GLint level, |
| 357 GLenum internal_format, | |
| 273 GLsizei width, | 358 GLsizei width, |
| 274 GLsizei height, | 359 GLsizei height, |
| 275 bool flip_y, | 360 bool flip_y, |
| 276 bool premultiply_alpha, | 361 bool premultiply_alpha, |
| 277 bool unpremultiply_alpha, | 362 bool unpremultiply_alpha, |
| 278 const GLfloat transform_matrix[16]) { | 363 const GLfloat transform_matrix[16]) { |
| 279 DCHECK(source_target == GL_TEXTURE_2D || | 364 DCHECK(source_target == GL_TEXTURE_2D || |
| 280 source_target == GL_TEXTURE_RECTANGLE_ARB || | 365 source_target == GL_TEXTURE_RECTANGLE_ARB || |
| 281 source_target == GL_TEXTURE_EXTERNAL_OES); | 366 source_target == GL_TEXTURE_EXTERNAL_OES); |
| 282 if (!initialized_) { | 367 if (!initialized_) { |
| 283 DLOG(ERROR) << "CopyTextureCHROMIUM: Uninitialized manager."; | 368 DLOG(ERROR) << "CopyTextureCHROMIUM: Uninitialized manager."; |
| 284 return; | 369 return; |
| 285 } | 370 } |
| 286 | 371 |
| 287 VertexShaderId vertex_shader_id = GetVertexShaderId(flip_y); | 372 VertexShaderId vertex_shader_id = GetVertexShaderId(flip_y); |
| 288 DCHECK_LT(static_cast<size_t>(vertex_shader_id), vertex_shaders_.size()); | 373 DCHECK_LT(static_cast<size_t>(vertex_shader_id), vertex_shaders_.size()); |
| 289 GLuint* vertex_shader = &vertex_shaders_[vertex_shader_id]; | |
| 290 if (!*vertex_shader) { | |
| 291 *vertex_shader = glCreateShader(GL_VERTEX_SHADER); | |
| 292 CompileShader(*vertex_shader, vertex_shader_source[vertex_shader_id]); | |
| 293 } | |
| 294 | |
| 295 FragmentShaderId fragment_shader_id = GetFragmentShaderId( | 374 FragmentShaderId fragment_shader_id = GetFragmentShaderId( |
| 296 premultiply_alpha, unpremultiply_alpha, source_target); | 375 premultiply_alpha, unpremultiply_alpha, source_target); |
| 297 DCHECK_LT(static_cast<size_t>(fragment_shader_id), fragment_shaders_.size()); | 376 DCHECK_LT(static_cast<size_t>(fragment_shader_id), fragment_shaders_.size()); |
| 298 GLuint* fragment_shader = &fragment_shaders_[fragment_shader_id]; | |
| 299 if (!*fragment_shader) { | |
| 300 *fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); | |
| 301 CompileShader(*fragment_shader, fragment_shader_source[fragment_shader_id]); | |
| 302 } | |
| 303 | 377 |
| 304 ProgramMapKey key(vertex_shader_id, fragment_shader_id); | 378 ProgramMapKey key(vertex_shader_id, fragment_shader_id); |
| 305 ProgramInfo* info = &programs_[key]; | 379 ProgramInfo* info = &programs_[key]; |
| 306 // Create program if necessary. | 380 // Create program if necessary. |
| 307 if (!info->program) { | 381 if (!info->program) { |
| 308 info->program = glCreateProgram(); | 382 info->program = glCreateProgram(); |
| 383 GLuint* vertex_shader = &vertex_shaders_[vertex_shader_id]; | |
| 384 if (!*vertex_shader) { | |
| 385 *vertex_shader = glCreateShader(GL_VERTEX_SHADER); | |
| 386 CompileShader(*vertex_shader, vertex_shader_source[vertex_shader_id]); | |
| 387 } | |
| 309 glAttachShader(info->program, *vertex_shader); | 388 glAttachShader(info->program, *vertex_shader); |
| 389 GLuint* fragment_shader = &fragment_shaders_[fragment_shader_id]; | |
| 390 if (!*fragment_shader) { | |
| 391 *fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); | |
| 392 CompileShader(*fragment_shader, | |
| 393 fragment_shader_source[fragment_shader_id]); | |
| 394 } | |
| 310 glAttachShader(info->program, *fragment_shader); | 395 glAttachShader(info->program, *fragment_shader); |
| 311 glBindAttribLocation(info->program, kVertexPositionAttrib, "a_position"); | 396 glBindAttribLocation(info->program, kVertexPositionAttrib, "a_position"); |
| 312 glLinkProgram(info->program); | 397 glLinkProgram(info->program); |
| 313 #ifndef NDEBUG | 398 #ifndef NDEBUG |
| 314 GLint linked; | 399 GLint linked; |
| 315 glGetProgramiv(info->program, GL_LINK_STATUS, &linked); | 400 glGetProgramiv(info->program, GL_LINK_STATUS, &linked); |
| 316 if (!linked) | 401 if (!linked) |
| 317 DLOG(ERROR) << "CopyTextureCHROMIUM: program link failure."; | 402 DLOG(ERROR) << "CopyTextureCHROMIUM: program link failure."; |
| 318 #endif | 403 #endif |
| 319 info->matrix_handle = glGetUniformLocation(info->program, "u_matrix"); | 404 info->matrix_handle = glGetUniformLocation(info->program, "u_matrix"); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 330 DLOG(ERROR) << "CopyTextureCHROMIUM: Invalid shader."; | 415 DLOG(ERROR) << "CopyTextureCHROMIUM: Invalid shader."; |
| 331 return; | 416 return; |
| 332 } | 417 } |
| 333 #endif | 418 #endif |
| 334 | 419 |
| 335 glUniformMatrix4fv(info->matrix_handle, 1, GL_FALSE, transform_matrix); | 420 glUniformMatrix4fv(info->matrix_handle, 1, GL_FALSE, transform_matrix); |
| 336 if (source_target == GL_TEXTURE_RECTANGLE_ARB) | 421 if (source_target == GL_TEXTURE_RECTANGLE_ARB) |
| 337 glUniform2f(info->half_size_handle, width / 2.0f, height / 2.0f); | 422 glUniform2f(info->half_size_handle, width / 2.0f, height / 2.0f); |
| 338 else | 423 else |
| 339 glUniform2f(info->half_size_handle, 0.5f, 0.5f); | 424 glUniform2f(info->half_size_handle, 0.5f, 0.5f); |
| 340 glActiveTexture(GL_TEXTURE0); | |
| 341 glBindTexture(GL_TEXTURE_2D, dest_id); | |
| 342 // NVidia drivers require texture settings to be a certain way | |
| 343 // or they won't report FRAMEBUFFER_COMPLETE. | |
| 344 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | |
| 345 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | |
| 346 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | |
| 347 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | |
| 348 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer_); | |
| 349 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, dest_target, | |
| 350 dest_id, level); | |
| 351 | 425 |
| 352 #ifndef NDEBUG | 426 if (BindFramebufferTexture2D(GL_TEXTURE_2D, dest_id, level, framebuffer_)) { |
| 353 GLenum fb_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); | |
| 354 if (GL_FRAMEBUFFER_COMPLETE != fb_status) { | |
| 355 DLOG(ERROR) << "CopyTextureCHROMIUM: Incomplete framebuffer."; | |
| 356 } else | |
| 357 #endif | |
| 358 { | |
| 359 decoder->ClearAllAttributes(); | 427 decoder->ClearAllAttributes(); |
| 360 glEnableVertexAttribArray(kVertexPositionAttrib); | 428 glEnableVertexAttribArray(kVertexPositionAttrib); |
| 361 | 429 |
| 362 glBindBuffer(GL_ARRAY_BUFFER, buffer_id_); | 430 glBindBuffer(GL_ARRAY_BUFFER, buffer_id_); |
| 363 glVertexAttribPointer(kVertexPositionAttrib, 2, GL_FLOAT, GL_FALSE, 0, 0); | 431 glVertexAttribPointer(kVertexPositionAttrib, 2, GL_FLOAT, GL_FALSE, 0, 0); |
| 364 | 432 |
| 365 glUniform1i(info->sampler_handle, 0); | 433 glUniform1i(info->sampler_handle, 0); |
| 366 | 434 |
| 367 glBindTexture(source_target, source_id); | 435 glBindTexture(source_target, source_id); |
| 368 glTexParameterf(source_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 436 glTexParameterf(source_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 387 decoder->RestoreTextureState(dest_id); | 455 decoder->RestoreTextureState(dest_id); |
| 388 decoder->RestoreTextureUnitBindings(0); | 456 decoder->RestoreTextureUnitBindings(0); |
| 389 decoder->RestoreActiveTexture(); | 457 decoder->RestoreActiveTexture(); |
| 390 decoder->RestoreProgramBindings(); | 458 decoder->RestoreProgramBindings(); |
| 391 decoder->RestoreBufferBindings(); | 459 decoder->RestoreBufferBindings(); |
| 392 decoder->RestoreFramebufferBindings(); | 460 decoder->RestoreFramebufferBindings(); |
| 393 decoder->RestoreGlobalState(); | 461 decoder->RestoreGlobalState(); |
| 394 } | 462 } |
| 395 | 463 |
| 396 } // namespace gpu | 464 } // namespace gpu |
| OLD | NEW |