summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-21 23:40:02 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-21 23:40:02 +0000
commit16aa68e81494965712aacc82c8b242ff9c1d5a51 (patch)
tree5eacabeb4bbdefa52184651a435c2efb61f9f1f0 /ui
parentcae68b3a7209f9d2a28220213944eaac39464687 (diff)
downloadchromium_src-16aa68e81494965712aacc82c8b242ff9c1d5a51.zip
chromium_src-16aa68e81494965712aacc82c8b242ff9c1d5a51.tar.gz
chromium_src-16aa68e81494965712aacc82c8b242ff9c1d5a51.tar.bz2
Reland 110355 - Use shared D3D9 texture to transport the compositor's backing buffer to the browser process for presentation.
Implemented ImageTransportSurface for Linux (without texture sharing), XP, Vista and 7. XP. The non-texture sharing Linux and XP paths just present directly to the compositing child window owned by the browser process as before. PassThroughImageTransportSurface still needs a proper name. I will move it into its own file once that is decided. I moved AcceleratedSurfaceBuffersSwapped outside of the platform specific ifdefs and made the signature the same on all platforms for greater consistency. I removed the code related to sharing surfaces between processes and synchronizing resize and swapping out of GpuCommandBufferStub. It is all now in ImageTransportSurface implementations. Original Review URL: http://codereview.chromium.org/8060045 Review URL: http://codereview.chromium.org/8620006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/surface/accelerated_surface_win.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/ui/gfx/surface/accelerated_surface_win.cc b/ui/gfx/surface/accelerated_surface_win.cc
index efb5706..c3bc154 100644
--- a/ui/gfx/surface/accelerated_surface_win.cc
+++ b/ui/gfx/surface/accelerated_surface_win.cc
@@ -27,8 +27,14 @@
namespace {
+typedef HRESULT (WINAPI *Direct3DCreate9ExFunc)(UINT sdk_version,
+ IDirect3D9Ex **d3d);
+
const int64 kPollQueryInterval = 1;
+const wchar_t kD3D9ModuleName[] = L"d3d9.dll";
+const char kCreate3D9DeviceExName[] = "Direct3DCreate9Ex";
+
class QuerySyncThread
: public base::Thread,
public base::RefCounted<QuerySyncThread> {
@@ -330,8 +336,17 @@ void AcceleratedSurface::DoInitialize() {
HRESULT hr;
+ HMODULE module = GetModuleHandle(kD3D9ModuleName);
+ if (!module)
+ return;
+
+ Direct3DCreate9ExFunc create_func = reinterpret_cast<Direct3DCreate9ExFunc>(
+ GetProcAddress(module, kCreate3D9DeviceExName));
+ if (!create_func)
+ return;
+
base::win::ScopedComPtr<IDirect3D9Ex> d3d;
- hr = Direct3DCreate9Ex(D3D_SDK_VERSION, d3d.Receive());
+ hr = create_func(D3D_SDK_VERSION, d3d.Receive());
if (FAILED(hr))
return;