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 <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 | 584 |
585 void WaitForReadPixels(base::Closure callback) override; | 585 void WaitForReadPixels(base::Closure callback) override; |
586 | 586 |
587 Logger* GetLogger() override; | 587 Logger* GetLogger() override; |
588 | 588 |
589 void BeginDecoding() override; | 589 void BeginDecoding() override; |
590 void EndDecoding() override; | 590 void EndDecoding() override; |
591 | 591 |
592 ErrorState* GetErrorState() override; | 592 ErrorState* GetErrorState() override; |
593 const ContextState* GetContextState() override { return &state_; } | 593 const ContextState* GetContextState() override { return &state_; } |
594 scoped_refptr<ShaderTranslatorInterface> GetTranslator( | 594 scoped_refptr<ShaderTranslatorInterface> GetTranslator(GLenum type) override; |
595 GLenum type) const override; | |
596 | 595 |
597 void SetShaderCacheCallback(const ShaderCacheCallback& callback) override; | 596 void SetShaderCacheCallback(const ShaderCacheCallback& callback) override; |
598 void SetFenceSyncReleaseCallback( | 597 void SetFenceSyncReleaseCallback( |
599 const FenceSyncReleaseCallback& callback) override; | 598 const FenceSyncReleaseCallback& callback) override; |
600 void SetWaitSyncTokenCallback(const WaitSyncTokenCallback& callback) override; | 599 void SetWaitSyncTokenCallback(const WaitSyncTokenCallback& callback) override; |
601 | 600 |
602 void SetDescheduleUntilFinishedCallback( | 601 void SetDescheduleUntilFinishedCallback( |
603 const NoParamCallback& callback) override; | 602 const NoParamCallback& callback) override; |
604 void SetRescheduleAfterFinishedCallback( | 603 void SetRescheduleAfterFinishedCallback( |
605 const NoParamCallback& callback) override; | 604 const NoParamCallback& callback) override; |
(...skipping 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3603 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); | 3602 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); |
3604 } | 3603 } |
3605 | 3604 |
3606 if (workarounds().unbind_fbo_on_context_switch) { | 3605 if (workarounds().unbind_fbo_on_context_switch) { |
3607 context_->SetUnbindFboOnMakeCurrent(); | 3606 context_->SetUnbindFboOnMakeCurrent(); |
3608 } | 3607 } |
3609 | 3608 |
3610 if (workarounds().gl_clear_broken) { | 3609 if (workarounds().gl_clear_broken) { |
3611 DCHECK(!clear_framebuffer_blit_.get()); | 3610 DCHECK(!clear_framebuffer_blit_.get()); |
3612 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glClearWorkaroundInit"); | 3611 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glClearWorkaroundInit"); |
3613 clear_framebuffer_blit_.reset( | 3612 clear_framebuffer_blit_.reset(new ClearFramebufferResourceManager(this)); |
3614 new ClearFramebufferResourceManager(this, gl_version_info())); | |
3615 if (LOCAL_PEEK_GL_ERROR("glClearWorkaroundInit") != GL_NO_ERROR) | 3613 if (LOCAL_PEEK_GL_ERROR("glClearWorkaroundInit") != GL_NO_ERROR) |
3616 return false; | 3614 return false; |
3617 } | 3615 } |
3618 | 3616 |
3619 if (group_->gpu_preferences().enable_gpu_driver_debug_logging && | 3617 if (group_->gpu_preferences().enable_gpu_driver_debug_logging && |
3620 feature_info_->feature_flags().khr_debug) { | 3618 feature_info_->feature_flags().khr_debug) { |
3621 InitializeGLDebugLogging(); | 3619 InitializeGLDebugLogging(); |
3622 } | 3620 } |
3623 | 3621 |
3624 return true; | 3622 return true; |
(...skipping 6822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10447 GLenum buffer_mode) { | 10445 GLenum buffer_mode) { |
10448 Program* program = GetProgramInfoNotShader( | 10446 Program* program = GetProgramInfoNotShader( |
10449 client_program_id, "glTransformFeedbackVaryings"); | 10447 client_program_id, "glTransformFeedbackVaryings"); |
10450 if (!program) { | 10448 if (!program) { |
10451 return; | 10449 return; |
10452 } | 10450 } |
10453 program->TransformFeedbackVaryings(count, varyings, buffer_mode); | 10451 program->TransformFeedbackVaryings(count, varyings, buffer_mode); |
10454 } | 10452 } |
10455 | 10453 |
10456 scoped_refptr<ShaderTranslatorInterface> GLES2DecoderImpl::GetTranslator( | 10454 scoped_refptr<ShaderTranslatorInterface> GLES2DecoderImpl::GetTranslator( |
10457 GLenum type) const { | 10455 GLenum type) { |
10458 return type == GL_VERTEX_SHADER ? vertex_translator_ : fragment_translator_; | 10456 return type == GL_VERTEX_SHADER ? vertex_translator_ : fragment_translator_; |
10459 } | 10457 } |
10460 | 10458 |
10461 void GLES2DecoderImpl::DoCompileShader(GLuint client_id) { | 10459 void GLES2DecoderImpl::DoCompileShader(GLuint client_id) { |
10462 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCompileShader"); | 10460 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCompileShader"); |
10463 Shader* shader = GetShaderInfoNotProgram(client_id, "glCompileShader"); | 10461 Shader* shader = GetShaderInfoNotProgram(client_id, "glCompileShader"); |
10464 if (!shader) { | 10462 if (!shader) { |
10465 return; | 10463 return; |
10466 } | 10464 } |
10467 | 10465 |
(...skipping 9047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19515 } | 19513 } |
19516 | 19514 |
19517 // Include the auto-generated part of this file. We split this because it means | 19515 // Include the auto-generated part of this file. We split this because it means |
19518 // we can easily edit the non-auto generated parts right here in this file | 19516 // we can easily edit the non-auto generated parts right here in this file |
19519 // instead of having to edit some template or the code generator. | 19517 // instead of having to edit some template or the code generator. |
19520 #include "base/macros.h" | 19518 #include "base/macros.h" |
19521 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19519 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19522 | 19520 |
19523 } // namespace gles2 | 19521 } // namespace gles2 |
19524 } // namespace gpu | 19522 } // namespace gpu |
OLD | NEW |