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 // Out of order because it has conflicts with other includes on Windows. | 7 // Out of order because it has conflicts with other includes on Windows. |
8 #include "third_party/angle/include/EGL/egl.h" | 8 #include "third_party/angle/include/EGL/egl.h" |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 GpuChannelManager* manager, | 239 GpuChannelManager* manager, |
240 GpuCommandBufferStub* stub, | 240 GpuCommandBufferStub* stub, |
241 const gfx::GLSurfaceHandle& handle) { | 241 const gfx::GLSurfaceHandle& handle) { |
242 scoped_refptr<gfx::GLSurface> surface; | 242 scoped_refptr<gfx::GLSurface> surface; |
243 | 243 |
244 if (!handle.handle) { | 244 if (!handle.handle) { |
245 // If we don't have a valid handle with the transport flag set, then we're | 245 // If we don't have a valid handle with the transport flag set, then we're |
246 // coming from a renderer and we want to render the webpage contents to a | 246 // coming from a renderer and we want to render the webpage contents to a |
247 // texture. | 247 // texture. |
248 DCHECK(handle.transport); | 248 DCHECK(handle.transport); |
249 DCHECK(handle.parent_client_id); | |
250 surface = new TextureImageTransportSurface(manager, stub, handle); | 249 surface = new TextureImageTransportSurface(manager, stub, handle); |
251 } else { | 250 } else { |
252 if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 && | 251 if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 && |
253 !CommandLine::ForCurrentProcess()->HasSwitch( | 252 !CommandLine::ForCurrentProcess()->HasSwitch( |
254 switches::kDisableImageTransportSurface)) { | 253 switches::kDisableImageTransportSurface)) { |
255 // This path handles two different cases. | 254 // This path handles two different cases. |
256 // | 255 // |
257 // For post-Vista regular Windows, this surface will be used for | 256 // For post-Vista regular Windows, this surface will be used for |
258 // renderer compositors. | 257 // renderer compositors. |
259 // | 258 // |
(...skipping 20 matching lines...) Expand all Loading... |
280 } | 279 } |
281 } | 280 } |
282 | 281 |
283 if (surface->Initialize()) | 282 if (surface->Initialize()) |
284 return surface; | 283 return surface; |
285 else | 284 else |
286 return NULL; | 285 return NULL; |
287 } | 286 } |
288 | 287 |
289 } // namespace content | 288 } // namespace content |
OLD | NEW |