| 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "content/common/gpu/image_transport_surface.h" | 7 #include "content/common/gpu/image_transport_surface.h" |
| 8 | 8 |
| 9 // Out of order because it has conflicts with other includes on Windows. | 9 // Out of order because it has conflicts with other includes on Windows. |
| 10 #include "third_party/angle/include/EGL/egl.h" | 10 #include "third_party/angle/include/EGL/egl.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 scoped_refptr<gfx::GLSurface> surface; | 243 scoped_refptr<gfx::GLSurface> surface; |
| 244 | 244 |
| 245 if (!handle.handle) { | 245 if (!handle.handle) { |
| 246 // If we don't have a valid handle with the transport flag set, then we're | 246 // If we don't have a valid handle with the transport flag set, then we're |
| 247 // coming from a renderer and we want to render the webpage contents to a | 247 // coming from a renderer and we want to render the webpage contents to a |
| 248 // texture. | 248 // texture. |
| 249 DCHECK(handle.transport); | 249 DCHECK(handle.transport); |
| 250 DCHECK(handle.parent_client_id); | 250 DCHECK(handle.parent_client_id); |
| 251 surface = new TextureImageTransportSurface(manager, stub, handle); | 251 surface = new TextureImageTransportSurface(manager, stub, handle); |
| 252 } else { | 252 } else { |
| 253 if (handle.transport && | 253 if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 && |
| 254 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 && | |
| 255 !CommandLine::ForCurrentProcess()->HasSwitch( | 254 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 256 switches::kDisableImageTransportSurface)) { | 255 switches::kDisableImageTransportSurface)) { |
| 257 // This path handles two different cases. | 256 // This path handles two different cases. |
| 258 // | 257 // |
| 259 // For post-Vista regular Windows, this surface will be used for | 258 // For post-Vista regular Windows, this surface will be used for |
| 260 // renderer compositors. | 259 // renderer compositors. |
| 261 // | 260 // |
| 262 // For Aura Windows, this will be the surface for the browser compositor | 261 // For Aura Windows, this will be the surface for the browser compositor |
| 263 // (and the renderer compositors surface's will be | 262 // (and the renderer compositors surface's will be |
| 264 // TextureImageTransportSurface above). | 263 // TextureImageTransportSurface above). |
| (...skipping 19 matching lines...) Expand all Loading... |
| 284 | 283 |
| 285 if (surface->Initialize()) | 284 if (surface->Initialize()) |
| 286 return surface; | 285 return surface; |
| 287 else | 286 else |
| 288 return NULL; | 287 return NULL; |
| 289 } | 288 } |
| 290 | 289 |
| 291 } // namespace content | 290 } // namespace content |
| 292 | 291 |
| 293 #endif // ENABLE_GPU | 292 #endif // ENABLE_GPU |
| OLD | NEW |