| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 DCHECK(!is_swap_buffers_pending_); | 272 DCHECK(!is_swap_buffers_pending_); |
| 273 is_swap_buffers_pending_ = true; | 273 is_swap_buffers_pending_ = true; |
| 274 return true; | 274 return true; |
| 275 } | 275 } |
| 276 | 276 |
| 277 std::string TextureImageTransportSurface::GetExtensions() { | 277 std::string TextureImageTransportSurface::GetExtensions() { |
| 278 std::string extensions = gfx::GLSurface::GetExtensions(); | 278 std::string extensions = gfx::GLSurface::GetExtensions(); |
| 279 extensions += extensions.empty() ? "" : " "; | 279 extensions += extensions.empty() ? "" : " "; |
| 280 extensions += "GL_CHROMIUM_front_buffer_cached "; | 280 extensions += "GL_CHROMIUM_front_buffer_cached "; |
| 281 extensions += "GL_CHROMIUM_post_sub_buffer"; | 281 if (handle_.transport_type != gfx::TEXTURE_TRANSPORT_NO_PARTIAL_SWAP) |
| 282 extensions += "GL_CHROMIUM_post_sub_buffer"; |
| 282 return extensions; | 283 return extensions; |
| 283 } | 284 } |
| 284 | 285 |
| 285 gfx::Size TextureImageTransportSurface::GetSize() { | 286 gfx::Size TextureImageTransportSurface::GetSize() { |
| 286 gfx::Size size = current_size_; | 287 gfx::Size size = current_size_; |
| 287 | 288 |
| 288 // OSMesa expects a non-zero size. | 289 // OSMesa expects a non-zero size. |
| 289 return gfx::Size(size.width() == 0 ? 1 : size.width(), | 290 return gfx::Size(size.width() == 0 ? 1 : size.width(), |
| 290 size.height() == 0 ? 1 : size.height()); | 291 size.height() == 0 ? 1 : size.height()); |
| 291 } | 292 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 GL_TEXTURE_2D, | 492 GL_TEXTURE_2D, |
| 492 texture->mailbox_name, | 493 texture->mailbox_name, |
| 493 definition.release(), | 494 definition.release(), |
| 494 NULL); | 495 NULL); |
| 495 DCHECK(success); | 496 DCHECK(success); |
| 496 texture->service_id = 0; | 497 texture->service_id = 0; |
| 497 texture->mailbox_name = MailboxName(); | 498 texture->mailbox_name = MailboxName(); |
| 498 } | 499 } |
| 499 | 500 |
| 500 } // namespace content | 501 } // namespace content |
| OLD | NEW |