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

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

Issue 14985005: Support for ozone graphics in content and gpu/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: freshened patch Created 7 years, 7 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 | « no previous file | content/content_common.gypi » ('j') | 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) 2013 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_command_buffer_stub.h" 8 #include "content/common/gpu/gpu_command_buffer_stub.h"
9 #include "content/common/gpu/gpu_surface_lookup.h" 9 #include "content/common/gpu/gpu_surface_lookup.h"
10 #include "ui/base/ozone/surface_factory_ozone.h"
10 #include "ui/gl/gl_surface_egl.h" 11 #include "ui/gl/gl_surface_egl.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 // static 15 // static
15 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( 16 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(
16 GpuChannelManager* manager, 17 GpuChannelManager* manager,
17 GpuCommandBufferStub* stub, 18 GpuCommandBufferStub* stub,
18 const gfx::GLSurfaceHandle& handle) { 19 const gfx::GLSurfaceHandle& handle) {
19 DCHECK(GpuSurfaceLookup::GetInstance());
20 DCHECK_EQ(handle.transport_type, gfx::NATIVE_DIRECT); 20 DCHECK_EQ(handle.transport_type, gfx::NATIVE_DIRECT);
21 ANativeWindow* window = 21
22 GpuSurfaceLookup::GetInstance()->AcquireNativeWidget( 22 gfx::AcceleratedWidget window =
23 stub->surface_id()); 23 ui::SurfaceFactoryOzone::GetInstance()->GetAcceleratedWidget(
24 handle);
piman 2013/05/21 21:28:56 This feels weird. The intent of the GLSurfaceHandl
rjkroege 2013/05/22 17:20:05 I was going down the wrong path here. The changes
24 scoped_refptr<gfx::GLSurface> surface = 25 scoped_refptr<gfx::GLSurface> surface =
25 new gfx::NativeViewGLSurfaceEGL(false, window); 26 new gfx::NativeViewGLSurfaceEGL(false, window);
26 bool initialize_success = surface->Initialize(); 27 bool initialize_success = surface->Initialize();
27 if (window)
28 ANativeWindow_release(window);
29 if (!initialize_success) 28 if (!initialize_success)
30 return scoped_refptr<gfx::GLSurface>(); 29 return scoped_refptr<gfx::GLSurface>();
31 30
32 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( 31 return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface(
33 manager, stub, surface.get(), false)); 32 manager, stub, surface.get(), false));
34 } 33 }
35 34
36 } // namespace content 35 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698