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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1387143003: Add missing break in switch-case statements in gles2_cmd_decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit test for checking clearing of backbuffer bits! Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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 <cmath> 10 #include <cmath>
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 const FenceSyncReleaseCallback& callback) override; 894 const FenceSyncReleaseCallback& callback) override;
895 void SetWaitFenceSyncCallback(const WaitFenceSyncCallback& callback) override; 895 void SetWaitFenceSyncCallback(const WaitFenceSyncCallback& callback) override;
896 896
897 void SetIgnoreCachedStateForTest(bool ignore) override; 897 void SetIgnoreCachedStateForTest(bool ignore) override;
898 void ProcessFinishedAsyncTransfers(); 898 void ProcessFinishedAsyncTransfers();
899 899
900 bool GetServiceTextureId(uint32 client_texture_id, 900 bool GetServiceTextureId(uint32 client_texture_id,
901 uint32* service_texture_id) override; 901 uint32* service_texture_id) override;
902 902
903 uint32 GetTextureUploadCount() override; 903 uint32 GetTextureUploadCount() override;
904 // Methods added specifically for unit tests.
905 uint32 GetBackbufferClearBits() override {
906 return backbuffer_needs_clear_bits_;
907 }
908 void ClearBackbufferClearBits() override {
909 backbuffer_needs_clear_bits_ = 0;
910 }
904 base::TimeDelta GetTotalTextureUploadTime() override; 911 base::TimeDelta GetTotalTextureUploadTime() override;
905 base::TimeDelta GetTotalProcessingCommandsTime() override; 912 base::TimeDelta GetTotalProcessingCommandsTime() override;
906 void AddProcessingCommandsTime(base::TimeDelta) override; 913 void AddProcessingCommandsTime(base::TimeDelta) override;
907 914
908 // Restores the current state to the user's settings. 915 // Restores the current state to the user's settings.
909 void RestoreCurrentFramebufferBindings(); 916 void RestoreCurrentFramebufferBindings();
910 917
911 // Sets DEPTH_TEST, STENCIL_TEST and color mask for the current framebuffer. 918 // Sets DEPTH_TEST, STENCIL_TEST and color mask for the current framebuffer.
912 void ApplyDirtyState(); 919 void ApplyDirtyState();
913 920
(...skipping 4233 matching lines...) Expand 10 before | Expand all | Expand 10 after
5147 texture_manager(), 5154 texture_manager(),
5148 attachments[i], 5155 attachments[i],
5149 false); 5156 false);
5150 } else { 5157 } else {
5151 switch (attachments[i]) { 5158 switch (attachments[i]) {
5152 case GL_COLOR_EXT: 5159 case GL_COLOR_EXT:
5153 backbuffer_needs_clear_bits_ |= GL_COLOR_BUFFER_BIT; 5160 backbuffer_needs_clear_bits_ |= GL_COLOR_BUFFER_BIT;
5154 break; 5161 break;
5155 case GL_DEPTH_EXT: 5162 case GL_DEPTH_EXT:
5156 backbuffer_needs_clear_bits_ |= GL_DEPTH_BUFFER_BIT; 5163 backbuffer_needs_clear_bits_ |= GL_DEPTH_BUFFER_BIT;
5164 break;
5157 case GL_STENCIL_EXT: 5165 case GL_STENCIL_EXT:
5158 backbuffer_needs_clear_bits_ |= GL_STENCIL_BUFFER_BIT; 5166 backbuffer_needs_clear_bits_ |= GL_STENCIL_BUFFER_BIT;
5159 break; 5167 break;
5160 default: 5168 default:
5161 NOTREACHED(); 5169 NOTREACHED();
5162 break; 5170 break;
5163 } 5171 }
5164 } 5172 }
5165 } 5173 }
5166 5174
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
6474 *params = renderbuffer->height(); 6482 *params = renderbuffer->height();
6475 break; 6483 break;
6476 case GL_RENDERBUFFER_SAMPLES_EXT: 6484 case GL_RENDERBUFFER_SAMPLES_EXT:
6477 if (features().use_img_for_multisampled_render_to_texture) { 6485 if (features().use_img_for_multisampled_render_to_texture) {
6478 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_IMG, 6486 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_IMG,
6479 params); 6487 params);
6480 } else { 6488 } else {
6481 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_EXT, 6489 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_EXT,
6482 params); 6490 params);
6483 } 6491 }
6492 break;
6484 default: 6493 default:
6485 glGetRenderbufferParameterivEXT(target, pname, params); 6494 glGetRenderbufferParameterivEXT(target, pname, params);
6486 break; 6495 break;
6487 } 6496 }
6488 } 6497 }
6489 6498
6490 void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM( 6499 void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM(
6491 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, 6500 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
6492 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, 6501 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
6493 GLbitfield mask, GLenum filter) { 6502 GLbitfield mask, GLenum filter) {
(...skipping 8486 matching lines...) Expand 10 before | Expand all | Expand 10 after
14980 return error::kNoError; 14989 return error::kNoError;
14981 } 14990 }
14982 14991
14983 // Include the auto-generated part of this file. We split this because it means 14992 // Include the auto-generated part of this file. We split this because it means
14984 // we can easily edit the non-auto generated parts right here in this file 14993 // we can easily edit the non-auto generated parts right here in this file
14985 // instead of having to edit some template or the code generator. 14994 // instead of having to edit some template or the code generator.
14986 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 14995 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
14987 14996
14988 } // namespace gles2 14997 } // namespace gles2
14989 } // namespace gpu 14998 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698