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

Unified Diff: content/common/gpu/image_transport_surface_win.cc

Issue 1538803004: Create child window in GPU process for DirectComposition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/content_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface_win.cc
diff --git a/content/common/gpu/image_transport_surface_win.cc b/content/common/gpu/image_transport_surface_win.cc
index 597a4725f4065b1c47cd15ff5366456e45074102..06073250000760a4bcf27d16e9d6d86ea135c018 100644
--- a/content/common/gpu/image_transport_surface_win.cc
+++ b/content/common/gpu/image_transport_surface_win.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/win/windows_version.h"
+#include "content/common/gpu/child_window_surface_win.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/public/common/content_switches.h"
#include "ui/gfx/native_widget_types.h"
@@ -27,10 +28,17 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(
const gfx::GLSurfaceHandle& handle) {
DCHECK(handle.handle);
DCHECK_EQ(handle.transport_type, gfx::NATIVE_DIRECT);
- scoped_refptr<gfx::GLSurface> surface =
- gfx::GLSurface::CreateViewGLSurface(handle.handle);
- if (!surface.get())
- return surface;
+
+ scoped_refptr<gfx::GLSurface> surface;
+ if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 &&
+ gfx::GLSurfaceEGL::IsDirectCompositionSupported()) {
+ surface = new ChildWindowSurfaceWin(manager, handle.handle);
+ if (!surface->Initialize())
+ return nullptr;
+ } else {
+ surface = gfx::GLSurface::CreateViewGLSurface(handle.handle);
+ }
+
return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface(
manager, stub, surface.get()));
}
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698