| 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/image_transport_surface.h" | 5 #include "content/common/gpu/image_transport_surface.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 } // namespace anonymous | 233 } // namespace anonymous |
| 234 | 234 |
| 235 // static | 235 // static |
| 236 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( | 236 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( |
| 237 GpuChannelManager* manager, | 237 GpuChannelManager* manager, |
| 238 GpuCommandBufferStub* stub, | 238 GpuCommandBufferStub* stub, |
| 239 const gfx::GLSurfaceHandle& handle) { | 239 const gfx::GLSurfaceHandle& handle) { |
| 240 scoped_refptr<gfx::GLSurface> surface; | 240 scoped_refptr<gfx::GLSurface> surface; |
| 241 | 241 |
| 242 if (handle.transport_type == gfx::TEXTURE_TRANSPORT) { | 242 if (handle.transport_type == gfx::TEXTURE_TRANSPORT || |
| 243 handle.transport_type == gfx::TEXTURE_TRANSPORT_NO_PARTIAL_SWAP) { |
| 243 // If we don't have a valid handle with the transport flag set, then we're | 244 // If we don't have a valid handle with the transport flag set, then we're |
| 244 // coming from a renderer and we want to render the webpage contents to a | 245 // coming from a renderer and we want to render the webpage contents to a |
| 245 // texture. | 246 // texture. |
| 246 DCHECK(!handle.handle); | 247 DCHECK(!handle.handle); |
| 247 surface = new TextureImageTransportSurface(manager, stub, handle); | 248 surface = new TextureImageTransportSurface(manager, stub, handle); |
| 248 } else { | 249 } else { |
| 249 DCHECK(handle.handle); | 250 DCHECK(handle.handle); |
| 250 DCHECK(handle.transport_type == gfx::NATIVE_DIRECT || | 251 DCHECK(handle.transport_type == gfx::NATIVE_DIRECT || |
| 251 handle.transport_type == gfx::NATIVE_TRANSPORT); | 252 handle.transport_type == gfx::NATIVE_TRANSPORT); |
| 252 if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 && | 253 if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 && |
| (...skipping 27 matching lines...) Expand all Loading... |
| 280 } | 281 } |
| 281 } | 282 } |
| 282 | 283 |
| 283 if (surface->Initialize()) | 284 if (surface->Initialize()) |
| 284 return surface; | 285 return surface; |
| 285 else | 286 else |
| 286 return NULL; | 287 return NULL; |
| 287 } | 288 } |
| 288 | 289 |
| 289 } // namespace content | 290 } // namespace content |
| OLD | NEW |