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

Side by Side 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: apatrick's fixes. Created 8 years 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Helper functions that Direct3D 9Ex code a little easier to work with for
6 // the ui/surface code.
7
8 #ifndef UI_SURFACE_D3D9_UTILS_WIN_H_
9 #define UI_SURFACE_D3D9_UTILS_WIN_H_
10
11 #include <d3d9.h>
12
13 #include "base/basictypes.h"
14
15 namespace base {
16 class ScopedNativeLibrary;
17 }
18
19 namespace gfx {
20 class Size;
21 }
22
23 namespace ui_surface_d3d9_utils {
24
25 // Visible for testing. Loads the Direct3D9 library. Returns true on success.
26 bool LoadD3D9(base::ScopedNativeLibrary* storage);
27
28 // Visible for testing. Creates a Direct3D9 device suitable for use with the
29 // accelerated surface code. Returns true on success.
30 bool CreateDevice(const base::ScopedNativeLibrary& d3d_module,
31 D3DDEVTYPE device_type,
32 uint32 presentation_interval,
33 IDirect3DDevice9Ex** device);
34
35 // Calls the Vista+ (WDDM1.0) variant of CreateTexture that semantically
36 // opens a texture allocated (possibly in another process) as shared. The
37 // shared texture is identified by its surface handle. The resulting texture
38 // is written into |opened_texture|.
39 //
40 // Returns true on success.
41 bool OpenSharedTexture(IDirect3DDevice9* device,
42 int64 surface_handle,
43 const gfx::Size& size,
44 IDirect3DTexture9** opened_texture);
45
46 // Create a one-off lockable surface of a specified size.
47 //
48 // Returns true on success.
49 bool CreateTemporaryLockableSurface(IDirect3DDevice9* device,
50 const gfx::Size& size,
51 IDirect3DSurface9** surface);
52
53 // Create a one-off renderable texture of a specified size. The texture object
54 // as well as the surface object for the texture's level 0 is returned (callers
55 // almost always need to use both).
56 //
57 // Returns true on success.
58 bool CreateTemporaryRenderTargetTexture(IDirect3DDevice9* device,
59 const gfx::Size& size,
60 IDirect3DTexture9** texture,
61 IDirect3DSurface9** render_target);
62
63 } // namespace ui_surface_d3d9_utils
64
65 #endif // UI_SURFACE_D3D9_UTILS_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698