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

Unified Diff: ui/surface/d3d9_utils_win.h

Issue 11464017: Separate image processing logic from presentation logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed dependencies of surface_gpu_tests. Created 7 years, 12 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 | « ui/surface/accelerated_surface_win.hlsl ('k') | ui/surface/d3d9_utils_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/surface/d3d9_utils_win.h
diff --git a/ui/surface/d3d9_utils_win.h b/ui/surface/d3d9_utils_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..a9554dc2f14c802034a4abdaf37b779748044892
--- /dev/null
+++ b/ui/surface/d3d9_utils_win.h
@@ -0,0 +1,71 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Helper functions that Direct3D 9Ex code a little easier to work with for
+// the ui/surface code.
+
+#ifndef UI_SURFACE_D3D9_UTILS_WIN_H_
+#define UI_SURFACE_D3D9_UTILS_WIN_H_
+
+#include <d3d9.h>
+
+#include "base/basictypes.h"
+#include "ui/surface/surface_export.h"
+
+namespace base {
+class ScopedNativeLibrary;
+}
+
+namespace gfx {
+class Size;
+}
+
+namespace ui_surface_d3d9_utils {
+
+// Visible for testing. Loads the Direct3D9 library. Returns true on success.
+SURFACE_EXPORT
+bool LoadD3D9(base::ScopedNativeLibrary* storage);
+
+// Visible for testing. Creates a Direct3D9 device suitable for use with the
+// accelerated surface code. Returns true on success.
+SURFACE_EXPORT
+bool CreateDevice(const base::ScopedNativeLibrary& d3d_module,
+ D3DDEVTYPE device_type,
+ uint32 presentation_interval,
+ IDirect3DDevice9Ex** device);
+
+// Calls the Vista+ (WDDM1.0) variant of CreateTexture that semantically
+// opens a texture allocated (possibly in another process) as shared. The
+// shared texture is identified by its surface handle. The resulting texture
+// is written into |opened_texture|.
+//
+// Returns true on success.
+SURFACE_EXPORT
+bool OpenSharedTexture(IDirect3DDevice9* device,
+ int64 surface_handle,
+ const gfx::Size& size,
+ IDirect3DTexture9** opened_texture);
+
+// Create a one-off lockable surface of a specified size.
+//
+// Returns true on success.
+SURFACE_EXPORT
+bool CreateTemporaryLockableSurface(IDirect3DDevice9* device,
+ const gfx::Size& size,
+ IDirect3DSurface9** surface);
+
+// Create a one-off renderable texture of a specified size. The texture object
+// as well as the surface object for the texture's level 0 is returned (callers
+// almost always need to use both).
+//
+// Returns true on success.
+SURFACE_EXPORT
+bool CreateTemporaryRenderTargetTexture(IDirect3DDevice9* device,
+ const gfx::Size& size,
+ IDirect3DTexture9** texture,
+ IDirect3DSurface9** render_target);
+
+} // namespace ui_surface_d3d9_utils
+
+#endif // UI_SURFACE_D3D9_UTILS_WIN_H_
« no previous file with comments | « ui/surface/accelerated_surface_win.hlsl ('k') | ui/surface/d3d9_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698