| OLD | NEW |
| 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 "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 2670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2681 | 2681 |
| 2682 bool call_gl_clear = true; | 2682 bool call_gl_clear = true; |
| 2683 #if defined(OS_ANDROID) | 2683 #if defined(OS_ANDROID) |
| 2684 // Temporary workaround for Android WebView because this clear ignores the | 2684 // Temporary workaround for Android WebView because this clear ignores the |
| 2685 // clip and corrupts that external UI of the App. Not calling glClear is ok | 2685 // clip and corrupts that external UI of the App. Not calling glClear is ok |
| 2686 // because the system already clears the buffer before each draw. Proper | 2686 // because the system already clears the buffer before each draw. Proper |
| 2687 // fix might be setting the scissor clip properly before initialize. See | 2687 // fix might be setting the scissor clip properly before initialize. See |
| 2688 // crbug.com/259023 for details. | 2688 // crbug.com/259023 for details. |
| 2689 call_gl_clear = surface_->GetHandle(); | 2689 call_gl_clear = surface_->GetHandle(); |
| 2690 #endif | 2690 #endif |
| 2691 if (call_gl_clear) { | 2691 // It is possible for us to not have a framebuffer at this point. If we don't |
| 2692 // then clearing will only generate an error. |
| 2693 if (call_gl_clear && |
| 2694 glCheckFramebufferStatusEXT(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE) { |
| 2692 // Clear the backbuffer. | 2695 // Clear the backbuffer. |
| 2693 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); | 2696 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
| 2694 } | 2697 } |
| 2695 | 2698 |
| 2696 supports_post_sub_buffer_ = surface->SupportsPostSubBuffer(); | 2699 supports_post_sub_buffer_ = surface->SupportsPostSubBuffer(); |
| 2697 if (feature_info_->workarounds() | 2700 if (feature_info_->workarounds() |
| 2698 .disable_post_sub_buffers_for_onscreen_surfaces && | 2701 .disable_post_sub_buffers_for_onscreen_surfaces && |
| 2699 !surface->IsOffscreen()) | 2702 !surface->IsOffscreen()) |
| 2700 supports_post_sub_buffer_ = false; | 2703 supports_post_sub_buffer_ = false; |
| 2701 | 2704 |
| (...skipping 8573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11275 } | 11278 } |
| 11276 } | 11279 } |
| 11277 | 11280 |
| 11278 // Include the auto-generated part of this file. We split this because it means | 11281 // Include the auto-generated part of this file. We split this because it means |
| 11279 // we can easily edit the non-auto generated parts right here in this file | 11282 // we can easily edit the non-auto generated parts right here in this file |
| 11280 // instead of having to edit some template or the code generator. | 11283 // instead of having to edit some template or the code generator. |
| 11281 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11284 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 11282 | 11285 |
| 11283 } // namespace gles2 | 11286 } // namespace gles2 |
| 11284 } // namespace gpu | 11287 } // namespace gpu |
| OLD | NEW |