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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 current_size_.width(), current_size_.height(), 0, | 396 current_size_.width(), current_size_.height(), 0, |
397 GL_RGBA, GL_UNSIGNED_BYTE, NULL); | 397 GL_RGBA, GL_UNSIGNED_BYTE, NULL); |
398 CHECK_GL_ERROR(); | 398 CHECK_GL_ERROR(); |
399 } | 399 } |
400 | 400 |
401 AttachBackTextureToFBO(); | 401 AttachBackTextureToFBO(); |
402 | 402 |
403 const MailboxName& name = mailbox_name(backbuffer_.surface_handle); | 403 const MailboxName& name = mailbox_name(backbuffer_.surface_handle); |
404 | 404 |
405 GpuHostMsg_AcceleratedSurfaceNew_Params params; | 405 GpuHostMsg_AcceleratedSurfaceNew_Params params; |
406 params.width = current_size_.width(); | |
407 params.height = current_size_.height(); | |
408 params.surface_handle = backbuffer_.surface_handle; | 406 params.surface_handle = backbuffer_.surface_handle; |
409 params.mailbox_name.append( | 407 params.mailbox_name.append( |
410 reinterpret_cast<const char*>(&name), sizeof(name)); | 408 reinterpret_cast<const char*>(&name), sizeof(name)); |
411 helper_->SendAcceleratedSurfaceNew(params); | 409 helper_->SendAcceleratedSurfaceNew(params); |
412 } | 410 } |
413 | 411 |
414 void TextureImageTransportSurface::AttachBackTextureToFBO() { | 412 void TextureImageTransportSurface::AttachBackTextureToFBO() { |
415 DCHECK(backbuffer_.service_id); | 413 DCHECK(backbuffer_.service_id); |
416 ScopedFrameBufferBinder fbo_binder(fbo_id_); | 414 ScopedFrameBufferBinder fbo_binder(fbo_id_); |
417 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, | 415 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 // at which point we consume the correct texture back. | 471 // at which point we consume the correct texture back. |
474 mailbox_manager_->ProduceTexture( | 472 mailbox_manager_->ProduceTexture( |
475 GL_TEXTURE_2D, | 473 GL_TEXTURE_2D, |
476 mailbox_name(texture.surface_handle), | 474 mailbox_name(texture.surface_handle), |
477 definition.release(), | 475 definition.release(), |
478 NULL); | 476 NULL); |
479 texture.service_id = 0; | 477 texture.service_id = 0; |
480 } | 478 } |
481 | 479 |
482 } // namespace content | 480 } // namespace content |
OLD | NEW |