| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 377 |
| 378 if (backbuffer_.get() && backbuffer_size() == current_size_) | 378 if (backbuffer_.get() && backbuffer_size() == current_size_) |
| 379 return; | 379 return; |
| 380 | 380 |
| 381 VLOG(1) << "Allocating new backbuffer texture"; | 381 VLOG(1) << "Allocating new backbuffer texture"; |
| 382 | 382 |
| 383 GLES2Decoder* decoder = helper_->stub()->decoder(); | 383 GLES2Decoder* decoder = helper_->stub()->decoder(); |
| 384 TextureManager* texture_manager = | 384 TextureManager* texture_manager = |
| 385 decoder->GetContextGroup()->texture_manager(); | 385 decoder->GetContextGroup()->texture_manager(); |
| 386 if (!backbuffer_.get()) { | 386 if (!backbuffer_.get()) { |
| 387 mailbox_manager_->GenerateMailbox(&back_mailbox_); | 387 back_mailbox_ = gpu::Mailbox::Generate(); |
| 388 GLuint service_id; | 388 GLuint service_id; |
| 389 glGenTextures(1, &service_id); | 389 glGenTextures(1, &service_id); |
| 390 backbuffer_ = TextureRef::Create(texture_manager, 0, service_id); | 390 backbuffer_ = TextureRef::Create(texture_manager, 0, service_id); |
| 391 texture_manager->SetTarget(backbuffer_.get(), GL_TEXTURE_2D); | 391 texture_manager->SetTarget(backbuffer_.get(), GL_TEXTURE_2D); |
| 392 Texture* texture = texture_manager->Produce(backbuffer_.get()); | 392 Texture* texture = texture_manager->Produce(backbuffer_.get()); |
| 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, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |