OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2520 glStencilMaskSeparate(GL_FRONT, -1); | 2520 glStencilMaskSeparate(GL_FRONT, -1); |
2521 glStencilMaskSeparate(GL_BACK, -1); | 2521 glStencilMaskSeparate(GL_BACK, -1); |
2522 glClearDepth(0); | 2522 glClearDepth(0); |
2523 glDepthMask(GL_TRUE); | 2523 glDepthMask(GL_TRUE); |
2524 glDisable(GL_SCISSOR_TEST); | 2524 glDisable(GL_SCISSOR_TEST); |
2525 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); | 2525 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
2526 RestoreClearState(); | 2526 RestoreClearState(); |
2527 } | 2527 } |
2528 | 2528 |
2529 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 2529 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
2530 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 2530 // crbug.com/94103. TODO(kbr): figure out reproduction so Apple will |
2531 // fix this. | 2531 // fix this. |
2532 if (needs_mac_nvidia_driver_workaround_) | 2532 if (needs_mac_nvidia_driver_workaround_) { |
2533 offscreen_saved_frame_buffer_->Create(); | 2533 offscreen_saved_frame_buffer_->Create(); |
| 2534 glFinish(); |
| 2535 } |
2534 | 2536 |
2535 // Allocate the offscreen saved color texture. | 2537 // Allocate the offscreen saved color texture. |
2536 DCHECK(offscreen_saved_color_format_); | 2538 DCHECK(offscreen_saved_color_format_); |
2537 offscreen_saved_color_texture_->AllocateStorage( | 2539 offscreen_saved_color_texture_->AllocateStorage( |
2538 offscreen_size_, offscreen_saved_color_format_); | 2540 offscreen_size_, offscreen_saved_color_format_); |
2539 | 2541 |
2540 offscreen_saved_frame_buffer_->AttachRenderTexture( | 2542 offscreen_saved_frame_buffer_->AttachRenderTexture( |
2541 offscreen_saved_color_texture_.get()); | 2543 offscreen_saved_color_texture_.get()); |
2542 if (offscreen_saved_frame_buffer_->CheckStatus() != | 2544 if (offscreen_saved_frame_buffer_->CheckStatus() != |
2543 GL_FRAMEBUFFER_COMPLETE) { | 2545 GL_FRAMEBUFFER_COMPLETE) { |
(...skipping 4281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6825 return false; | 6827 return false; |
6826 } | 6828 } |
6827 | 6829 |
6828 // Include the auto-generated part of this file. We split this because it means | 6830 // Include the auto-generated part of this file. We split this because it means |
6829 // we can easily edit the non-auto generated parts right here in this file | 6831 // we can easily edit the non-auto generated parts right here in this file |
6830 // instead of having to edit some template or the code generator. | 6832 // instead of having to edit some template or the code generator. |
6831 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 6833 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
6832 | 6834 |
6833 } // namespace gles2 | 6835 } // namespace gles2 |
6834 } // namespace gpu | 6836 } // namespace gpu |
OLD | NEW |