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 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/94163. 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 offscreen_saved_color_texture_->Create(); | |
2535 glFlush(); | |
2536 } | |
2537 | 2534 |
2538 // Allocate the offscreen saved color texture. | 2535 // Allocate the offscreen saved color texture. |
2539 DCHECK(offscreen_saved_color_format_); | 2536 DCHECK(offscreen_saved_color_format_); |
2540 offscreen_saved_color_texture_->AllocateStorage( | 2537 offscreen_saved_color_texture_->AllocateStorage( |
2541 offscreen_size_, offscreen_saved_color_format_); | 2538 offscreen_size_, offscreen_saved_color_format_); |
2542 | 2539 |
2543 offscreen_saved_frame_buffer_->AttachRenderTexture( | 2540 offscreen_saved_frame_buffer_->AttachRenderTexture( |
2544 offscreen_saved_color_texture_.get()); | 2541 offscreen_saved_color_texture_.get()); |
2545 if (offscreen_saved_frame_buffer_->CheckStatus() != | 2542 if (offscreen_saved_frame_buffer_->CheckStatus() != |
2546 GL_FRAMEBUFFER_COMPLETE) { | 2543 GL_FRAMEBUFFER_COMPLETE) { |
(...skipping 4281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6828 return false; | 6825 return false; |
6829 } | 6826 } |
6830 | 6827 |
6831 // Include the auto-generated part of this file. We split this because it means | 6828 // Include the auto-generated part of this file. We split this because it means |
6832 // we can easily edit the non-auto generated parts right here in this file | 6829 // we can easily edit the non-auto generated parts right here in this file |
6833 // instead of having to edit some template or the code generator. | 6830 // instead of having to edit some template or the code generator. |
6834 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 6831 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
6835 | 6832 |
6836 } // namespace gles2 | 6833 } // namespace gles2 |
6837 } // namespace gpu | 6834 } // namespace gpu |
OLD | NEW |