Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: content/common/gpu/image_transport_surface_linux.cc

Issue 12463007: Disable partial swaps for webview guest renderer until we can figure out how to do that properly. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/common/gpu/texture_image_transport_surface.h" 7 #include "content/common/gpu/texture_image_transport_surface.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 // static 11 // static
12 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( 12 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
13 GpuChannelManager* manager, 13 GpuChannelManager* manager,
14 GpuCommandBufferStub* stub, 14 GpuCommandBufferStub* stub,
15 const gfx::GLSurfaceHandle& handle) { 15 const gfx::GLSurfaceHandle& handle) {
16 scoped_refptr<gfx::GLSurface> surface; 16 scoped_refptr<gfx::GLSurface> surface;
17 if (handle.transport_type == gfx::TEXTURE_TRANSPORT) { 17 if (handle.transport_type == gfx::TEXTURE_TRANSPORT ||
18 handle.transport_type == gfx::TEXTURE_TRANSPORT_NO_PARTIAL_SWAP) {
18 DCHECK(!handle.handle); 19 DCHECK(!handle.handle);
19 surface = new TextureImageTransportSurface(manager, stub, handle); 20 surface = new TextureImageTransportSurface(manager, stub, handle);
20 } else { 21 } else {
21 DCHECK(handle.handle); 22 DCHECK(handle.handle);
22 DCHECK(handle.transport_type == gfx::NATIVE_DIRECT || 23 DCHECK(handle.transport_type == gfx::NATIVE_DIRECT ||
23 handle.transport_type == gfx::NATIVE_TRANSPORT); 24 handle.transport_type == gfx::NATIVE_TRANSPORT);
24 surface = gfx::GLSurface::CreateViewGLSurface(false, handle.handle); 25 surface = gfx::GLSurface::CreateViewGLSurface(false, handle.handle);
25 if (!surface.get()) 26 if (!surface.get())
26 return NULL; 27 return NULL;
27 surface = new PassThroughImageTransportSurface(manager, 28 surface = new PassThroughImageTransportSurface(manager,
28 stub, 29 stub,
29 surface.get(), 30 surface.get(),
30 handle.is_transport()); 31 handle.is_transport());
31 } 32 }
32 33
33 if (surface->Initialize()) 34 if (surface->Initialize())
34 return surface; 35 return surface;
35 else 36 else
36 return NULL; 37 return NULL;
37 } 38 }
38 39
39 } // namespace content 40 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698