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

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

Issue 10795058: Add GL surface creation for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
6
5 #include "base/logging.h" 7 #include "base/logging.h"
6 #include "content/common/gpu/image_transport_surface.h" 8 #include "content/common/gpu/texture_image_transport_surface.h"
9 #include "ui/gl/gl_surface_egl.h"
10
11 gfx::AcceleratedWidget GetNativeWidgetAndroid(int surface_id);
piman 2012/07/26 21:33:29 mmh, this is just here to workaround the include D
7 12
8 // static 13 // static
9 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( 14 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
10 GpuChannelManager* manager, 15 GpuChannelManager* manager,
11 GpuCommandBufferStub* stub, 16 GpuCommandBufferStub* stub,
12 const gfx::GLSurfaceHandle& handle) { 17 const gfx::GLSurfaceHandle& handle) {
13 NOTIMPLEMENTED(); 18 scoped_refptr<gfx::GLSurface> surface;
14 return NULL; 19 if (!handle.handle && handle.transport) {
20 DCHECK(handle.parent_client_id);
21 surface = new TextureImageTransportSurface(manager, stub, handle);
22 } else if (handle.handle == gfx::kDummyPluginWindow && !handle.transport) {
23 ANativeWindow* window = GetNativeWidgetAndroid(stub->surface_id());
24 DCHECK(window);
25 surface = new gfx::NativeViewGLSurfaceEGL(false, window);
26 if (!surface.get() || !surface->Initialize())
27 return NULL;
28
29 surface = new PassThroughImageTransportSurface(
30 manager, stub, surface.get(), handle.transport);
31 } else {
32 NOTIMPLEMENTED();
33 return NULL:
34 }
35
36 if (surface->Initialize())
37 return surface;
38 else {
39 LOG(ERROR) << "Failed to initialize ImageTransportSurface";
40 return NULL;
41 }
15 } 42 }
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698