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

Side by Side Diff: ui/surface/d3d9_utils_win.cc

Issue 11280318: YUV conversion on the GPU. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "Yet more line endings." Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/surface/d3d9_utils_win.h ('k') | ui/surface/surface.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/surface/d3d9_utils_win.h" 5 #include "ui/surface/d3d9_utils_win.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/scoped_native_library.h" 8 #include "base/scoped_native_library.h"
9 #include "base/win/scoped_comptr.h" 9 #include "base/win/scoped_comptr.h"
10 #include "ui/gfx/size.h" 10 #include "ui/gfx/size.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 D3DFMT_A8R8G8B8, 109 D3DFMT_A8R8G8B8,
110 D3DPOOL_DEFAULT, 110 D3DPOOL_DEFAULT,
111 texture, 111 texture,
112 NULL); 112 NULL);
113 if (!SUCCEEDED(hr)) 113 if (!SUCCEEDED(hr))
114 return false; 114 return false;
115 hr = (*texture)->GetSurfaceLevel(0, render_target); 115 hr = (*texture)->GetSurfaceLevel(0, render_target);
116 return SUCCEEDED(hr); 116 return SUCCEEDED(hr);
117 } 117 }
118 118
119 gfx::Size GetSize(IDirect3DSurface9* surface) {
120 D3DSURFACE_DESC surface_description;
121 HRESULT hr = surface->GetDesc(&surface_description);
122 if (FAILED(hr))
123 return gfx::Size(0, 0);
124 return gfx::Size(surface_description.Width, surface_description.Height);
125 }
126
127 gfx::Size GetSize(IDirect3DTexture9* texture) {
128 D3DSURFACE_DESC surface_description;
129 HRESULT hr = texture->GetLevelDesc(0, &surface_description);
130 if (FAILED(hr))
131 return gfx::Size(0, 0);
132 return gfx::Size(surface_description.Width, surface_description.Height);
133 }
134
119 } // namespace ui_surface_d3d9_utils 135 } // namespace ui_surface_d3d9_utils
OLDNEW
« no previous file with comments | « ui/surface/d3d9_utils_win.h ('k') | ui/surface/surface.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698