| 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, ¤t_surface)))
|
| - return;
|
| -
|
| - CComPtr<IDirect3DSurface9> current_depth_surface;
|
| - if (!HR(d3d_device()->GetDepthStencilSurface(¤t_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);
|
|
|