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

Unified Diff: ui/gfx/surface/accelerated_surface_win.cc

Issue 8622004: Reland 110355 - Use shared D3D9 texture to transport the compositor's backing buffer to the brows... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
Index: ui/gfx/surface/accelerated_surface_win.cc
===================================================================
--- ui/gfx/surface/accelerated_surface_win.cc (revision 111043)
+++ ui/gfx/surface/accelerated_surface_win.cc (working copy)
@@ -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 @@
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;
« content/common/gpu/image_transport_surface.h ('K') | « content/content_common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698