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

Side by Side Diff: content/common/gpu/image_transport_surface_android.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 "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/gpu/gpu_surface_lookup.h" 8 #include "content/common/gpu/gpu_surface_lookup.h"
9 #include "content/common/gpu/texture_image_transport_surface.h" 9 #include "content/common/gpu/texture_image_transport_surface.h"
10 #include "ui/gl/gl_surface_egl.h" 10 #include "ui/gl/gl_surface_egl.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 // static 14 // static
15 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( 15 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
16 GpuChannelManager* manager, 16 GpuChannelManager* manager,
17 GpuCommandBufferStub* stub, 17 GpuCommandBufferStub* stub,
18 const gfx::GLSurfaceHandle& handle) { 18 const gfx::GLSurfaceHandle& handle) {
19 scoped_refptr<gfx::GLSurface> surface; 19 scoped_refptr<gfx::GLSurface> surface;
20 if (handle.transport_type == gfx::TEXTURE_TRANSPORT) { 20 if (handle.transport_type == gfx::TEXTURE_TRANSPORT ||
21 handle.transport_type == gfx::TEXTURE_TRANSPORT_NO_PARTIAL_SWAP) {
21 surface = new TextureImageTransportSurface(manager, stub, handle); 22 surface = new TextureImageTransportSurface(manager, stub, handle);
22 } else if (handle.transport_type == gfx::NATIVE_DIRECT) { 23 } else if (handle.transport_type == gfx::NATIVE_DIRECT) {
23 DCHECK(GpuSurfaceLookup::GetInstance()); 24 DCHECK(GpuSurfaceLookup::GetInstance());
24 ANativeWindow* window = 25 ANativeWindow* window =
25 GpuSurfaceLookup::GetInstance()->AcquireNativeWidget( 26 GpuSurfaceLookup::GetInstance()->AcquireNativeWidget(
26 stub->surface_id()); 27 stub->surface_id());
27 surface = new gfx::NativeViewGLSurfaceEGL(false, window); 28 surface = new gfx::NativeViewGLSurfaceEGL(false, window);
28 bool initialize_success = surface->Initialize(); 29 bool initialize_success = surface->Initialize();
29 if (window) 30 if (window)
30 ANativeWindow_release(window); 31 ANativeWindow_release(window);
31 if (!initialize_success) 32 if (!initialize_success)
32 return NULL; 33 return NULL;
33 34
34 surface = new PassThroughImageTransportSurface( 35 surface = new PassThroughImageTransportSurface(
35 manager, stub, surface.get(), false); 36 manager, stub, surface.get(), false);
36 } else { 37 } else {
37 NOTIMPLEMENTED(); 38 NOTIMPLEMENTED();
38 return NULL; 39 return NULL;
39 } 40 }
40 41
41 if (surface->Initialize()) { 42 if (surface->Initialize()) {
42 return surface; 43 return surface;
43 } else { 44 } else {
44 LOG(ERROR) << "Failed to initialize ImageTransportSurface"; 45 LOG(ERROR) << "Failed to initialize ImageTransportSurface";
45 return NULL; 46 return NULL;
46 } 47 }
47 } 48 }
48 49
49 } // namespace content 50 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698