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

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

Issue 1241433003: Rebind EGL context to flush driver caches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 5 months 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 void DoReleaseTexImage2DCHROMIUM( 1096 void DoReleaseTexImage2DCHROMIUM(
1097 GLenum target, 1097 GLenum target,
1098 GLint image_id); 1098 GLint image_id);
1099 1099
1100 void DoTraceEndCHROMIUM(void); 1100 void DoTraceEndCHROMIUM(void);
1101 1101
1102 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs); 1102 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs);
1103 1103
1104 void DoLoseContextCHROMIUM(GLenum current, GLenum other); 1104 void DoLoseContextCHROMIUM(GLenum current, GLenum other);
1105 1105
1106 void DoFlushDriverCachesCHROMIUM(void);
1107
1106 void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, const GLfloat* matrix); 1108 void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, const GLfloat* matrix);
1107 void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode); 1109 void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode);
1108 1110
1109 // Creates a Program for the given program. 1111 // Creates a Program for the given program.
1110 Program* CreateProgram( 1112 Program* CreateProgram(
1111 GLuint client_id, GLuint service_id) { 1113 GLuint client_id, GLuint service_id) {
1112 return program_manager()->CreateProgram(client_id, service_id); 1114 return program_manager()->CreateProgram(client_id, service_id);
1113 } 1115 }
1114 1116
1115 // Gets the program info for the given program. Returns NULL if none exists. 1117 // Gets the program info for the given program. Returns NULL if none exists.
(...skipping 12152 matching lines...) Expand 10 before | Expand all | Expand 10 after
13268 group_->set_draw_buffer(bufs[0]); 13270 group_->set_draw_buffer(bufs[0]);
13269 } 13271 }
13270 } 13272 }
13271 13273
13272 void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) { 13274 void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) {
13273 MarkContextLost(GetContextLostReasonFromResetStatus(current)); 13275 MarkContextLost(GetContextLostReasonFromResetStatus(current));
13274 group_->LoseContexts(GetContextLostReasonFromResetStatus(other)); 13276 group_->LoseContexts(GetContextLostReasonFromResetStatus(other));
13275 reset_by_robustness_extension_ = true; 13277 reset_by_robustness_extension_ = true;
13276 } 13278 }
13277 13279
13280 void GLES2DecoderImpl::DoFlushDriverCachesCHROMIUM(void) {
13281 // On Adreno Android devices we need to use a workaround to force caches to
13282 // clear.
13283 if (feature_info_->workarounds().unbind_egl_context_to_flush_driver_caches) {
13284 context_->ReleaseCurrent(nullptr);
13285 context_->MakeCurrent(surface_.get());
13286 }
13287 }
13288
13278 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, 13289 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode,
13279 const GLfloat* matrix) { 13290 const GLfloat* matrix) {
13280 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || 13291 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM ||
13281 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); 13292 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM);
13282 if (!features().chromium_path_rendering) { 13293 if (!features().chromium_path_rendering) {
13283 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, 13294 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
13284 "glMatrixLoadfCHROMIUM", 13295 "glMatrixLoadfCHROMIUM",
13285 "function not available"); 13296 "function not available");
13286 return; 13297 return;
13287 } 13298 }
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
14330 return error::kNoError; 14341 return error::kNoError;
14331 } 14342 }
14332 14343
14333 // Include the auto-generated part of this file. We split this because it means 14344 // Include the auto-generated part of this file. We split this because it means
14334 // we can easily edit the non-auto generated parts right here in this file 14345 // we can easily edit the non-auto generated parts right here in this file
14335 // instead of having to edit some template or the code generator. 14346 // instead of having to edit some template or the code generator.
14336 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 14347 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
14337 14348
14338 } // namespace gles2 14349 } // namespace gles2
14339 } // namespace gpu 14350 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_ids_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698