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

Unified Diff: core/win/d3d9/renderer_d3d9.cc

Issue 270100: Fix clearing render targets in D3D if there... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 2 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 | « DEPS_gyp ('k') | tests/selenium/javascript_unit_test_list.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/win/d3d9/renderer_d3d9.cc
===================================================================
--- core/win/d3d9/renderer_d3d9.cc (revision 28938)
+++ core/win/d3d9/renderer_d3d9.cc (working copy)
@@ -1028,29 +1028,22 @@
bool depth_flag,
int stencil,
bool stencil_flag) {
- // is this safe to call inside BeginScene/EndScene?
- CComPtr<IDirect3DSurface9> current_surface;
- if (!HR(d3d_device()->GetRenderTarget(0, &current_surface)))
- return;
-
- CComPtr<IDirect3DSurface9> current_depth_surface;
- if (!HR(d3d_device()->GetDepthStencilSurface(&current_depth_surface)))
- return;
-
// Conditionally clear the properties of the back buffer based on the
// argument flags, and the existence of currently bound buffers.
- HR(d3d_device_->Clear(
+ if (!HR(d3d_device_->Clear(
0,
NULL,
- ((color_flag && current_surface) ? D3DCLEAR_TARGET : 0) |
- ((depth_flag && current_depth_surface) ? D3DCLEAR_ZBUFFER : 0) |
- ((stencil_flag && current_depth_surface) ? D3DCLEAR_STENCIL : 0),
+ (color_flag ? D3DCLEAR_TARGET : 0) |
+ (depth_flag ? D3DCLEAR_ZBUFFER : 0) |
+ (stencil_flag ? D3DCLEAR_STENCIL : 0),
D3DCOLOR_COLORVALUE(color[0],
color[1],
color[2],
color[3]),
depth,
- stencil));
+ stencil))) {
+ DLOG(ERROR) << "Clear Failed.";
+ }
}
void RendererD3D9::SetViewportInPixels(int left,
@@ -1552,9 +1545,10 @@
down_cast<const RenderDepthStencilSurfaceD3D9*>(surface_depth);
IDirect3DSurface9 *d3d_surface =
- d3d_render_surface ? d3d_render_surface->GetSurfaceHandle() : NULL;
+ d3d_render_surface ? d3d_render_surface->GetSurfaceHandle() :
+ back_buffer_surface_;
IDirect3DSurface9 *d3d_depth_surface = d3d_render_depth_surface ?
- d3d_render_depth_surface->GetSurfaceHandle() : NULL;
+ d3d_render_depth_surface->GetSurfaceHandle() : back_buffer_depth_surface_;
// At least one of the surfaces must be non-null.
DCHECK(d3d_surface || d3d_depth_surface);
« no previous file with comments | « DEPS_gyp ('k') | tests/selenium/javascript_unit_test_list.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698