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 "content/common/gpu/texture_image_transport_surface.h" | 5 #include "content/common/gpu/texture_image_transport_surface.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 mailbox_manager_->ProduceTexture(GL_TEXTURE_2D, back_mailbox_, texture); | 393 mailbox_manager_->ProduceTexture(GL_TEXTURE_2D, back_mailbox_, texture); |
394 } | 394 } |
395 | 395 |
396 { | 396 { |
397 gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, | 397 gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, |
398 backbuffer_->service_id()); | 398 backbuffer_->service_id()); |
399 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, | 399 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, |
400 current_size_.width(), current_size_.height(), 0, | 400 current_size_.width(), current_size_.height(), 0, |
401 GL_RGBA, GL_UNSIGNED_BYTE, NULL); | 401 GL_RGBA, GL_UNSIGNED_BYTE, NULL); |
402 gpu::gles2::ErrorState* error_state = decoder->GetErrorState(); | 402 gpu::gles2::ErrorState* error_state = decoder->GetErrorState(); |
403 texture_manager->SetParameter("Backbuffer", | 403 texture_manager->SetParameteri("Backbuffer", |
404 error_state, | 404 error_state, |
405 backbuffer_.get(), | 405 backbuffer_.get(), |
406 GL_TEXTURE_MIN_FILTER, | 406 GL_TEXTURE_MIN_FILTER, |
407 GL_LINEAR); | 407 GL_LINEAR); |
408 texture_manager->SetParameter("Backbuffer", | 408 texture_manager->SetParameteri("Backbuffer", |
409 error_state, | 409 error_state, |
410 backbuffer_.get(), | 410 backbuffer_.get(), |
411 GL_TEXTURE_MAG_FILTER, | 411 GL_TEXTURE_MAG_FILTER, |
412 GL_LINEAR); | 412 GL_LINEAR); |
413 texture_manager->SetParameter("Backbuffer", | 413 texture_manager->SetParameteri("Backbuffer", |
414 error_state, | 414 error_state, |
415 backbuffer_.get(), | 415 backbuffer_.get(), |
416 GL_TEXTURE_WRAP_S, | 416 GL_TEXTURE_WRAP_S, |
417 GL_CLAMP_TO_EDGE); | 417 GL_CLAMP_TO_EDGE); |
418 texture_manager->SetParameter("Backbuffer", | 418 texture_manager->SetParameteri("Backbuffer", |
419 error_state, | 419 error_state, |
420 backbuffer_.get(), | 420 backbuffer_.get(), |
421 GL_TEXTURE_WRAP_T, | 421 GL_TEXTURE_WRAP_T, |
422 GL_CLAMP_TO_EDGE); | 422 GL_CLAMP_TO_EDGE); |
423 texture_manager->SetLevelInfo(backbuffer_.get(), | 423 texture_manager->SetLevelInfo(backbuffer_.get(), |
424 GL_TEXTURE_2D, | 424 GL_TEXTURE_2D, |
425 0, | 425 0, |
426 GL_RGBA, | 426 GL_RGBA, |
427 current_size_.width(), | 427 current_size_.width(), |
428 current_size_.height(), | 428 current_size_.height(), |
429 1, | 429 1, |
430 0, | 430 0, |
431 GL_RGBA, | 431 GL_RGBA, |
432 GL_UNSIGNED_BYTE, | 432 GL_UNSIGNED_BYTE, |
(...skipping 18 matching lines...) Expand all Loading... |
451 | 451 |
452 #ifndef NDEBUG | 452 #ifndef NDEBUG |
453 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); | 453 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); |
454 if (status != GL_FRAMEBUFFER_COMPLETE) { | 454 if (status != GL_FRAMEBUFFER_COMPLETE) { |
455 DLOG(FATAL) << "Framebuffer incomplete: " << status; | 455 DLOG(FATAL) << "Framebuffer incomplete: " << status; |
456 } | 456 } |
457 #endif | 457 #endif |
458 } | 458 } |
459 | 459 |
460 } // namespace content | 460 } // namespace content |
OLD | NEW |