| 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 26 matching lines...) Expand all Loading... |
| 37 #include "gpu/command_buffer/service/context_group.h" | 37 #include "gpu/command_buffer/service/context_group.h" |
| 38 #include "gpu/command_buffer/service/context_state.h" | 38 #include "gpu/command_buffer/service/context_state.h" |
| 39 #include "gpu/command_buffer/service/error_state.h" | 39 #include "gpu/command_buffer/service/error_state.h" |
| 40 #include "gpu/command_buffer/service/feature_info.h" | 40 #include "gpu/command_buffer/service/feature_info.h" |
| 41 #include "gpu/command_buffer/service/framebuffer_manager.h" | 41 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 42 #include "gpu/command_buffer/service/gl_utils.h" | 42 #include "gpu/command_buffer/service/gl_utils.h" |
| 43 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" | 43 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
| 44 #include "gpu/command_buffer/service/gles2_cmd_validation.h" | 44 #include "gpu/command_buffer/service/gles2_cmd_validation.h" |
| 45 #include "gpu/command_buffer/service/gpu_switches.h" | 45 #include "gpu/command_buffer/service/gpu_switches.h" |
| 46 #include "gpu/command_buffer/service/gpu_tracer.h" | 46 #include "gpu/command_buffer/service/gpu_tracer.h" |
| 47 #include "gpu/command_buffer/service/image_manager.h" | |
| 48 #include "gpu/command_buffer/service/mailbox_manager.h" | 47 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 49 #include "gpu/command_buffer/service/memory_tracking.h" | 48 #include "gpu/command_buffer/service/memory_tracking.h" |
| 50 #include "gpu/command_buffer/service/program_manager.h" | 49 #include "gpu/command_buffer/service/program_manager.h" |
| 51 #include "gpu/command_buffer/service/query_manager.h" | 50 #include "gpu/command_buffer/service/query_manager.h" |
| 52 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 51 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| 53 #include "gpu/command_buffer/service/shader_manager.h" | 52 #include "gpu/command_buffer/service/shader_manager.h" |
| 54 #include "gpu/command_buffer/service/shader_translator.h" | 53 #include "gpu/command_buffer/service/shader_translator.h" |
| 55 #include "gpu/command_buffer/service/shader_translator_cache.h" | 54 #include "gpu/command_buffer/service/shader_translator_cache.h" |
| 56 #include "gpu/command_buffer/service/stream_texture.h" | 55 #include "gpu/command_buffer/service/stream_texture.h" |
| 57 #include "gpu/command_buffer/service/stream_texture_manager.h" | 56 #include "gpu/command_buffer/service/stream_texture_manager.h" |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 } | 704 } |
| 706 | 705 |
| 707 TextureManager* texture_manager() { | 706 TextureManager* texture_manager() { |
| 708 return group_->texture_manager(); | 707 return group_->texture_manager(); |
| 709 } | 708 } |
| 710 | 709 |
| 711 MailboxManager* mailbox_manager() { | 710 MailboxManager* mailbox_manager() { |
| 712 return group_->mailbox_manager(); | 711 return group_->mailbox_manager(); |
| 713 } | 712 } |
| 714 | 713 |
| 715 ImageManager* image_manager() { | |
| 716 return group_->image_manager(); | |
| 717 } | |
| 718 | |
| 719 VertexArrayManager* vertex_array_manager() { | 714 VertexArrayManager* vertex_array_manager() { |
| 720 return vertex_array_manager_.get(); | 715 return vertex_array_manager_.get(); |
| 721 } | 716 } |
| 722 | 717 |
| 723 MemoryTracker* memory_tracker() { | 718 MemoryTracker* memory_tracker() { |
| 724 return group_->memory_tracker(); | 719 return group_->memory_tracker(); |
| 725 } | 720 } |
| 726 | 721 |
| 727 StreamTextureManager* stream_texture_manager() const { | 722 StreamTextureManager* stream_texture_manager() const { |
| 728 return group_->stream_texture_manager(); | 723 return group_->stream_texture_manager(); |
| (...skipping 9378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10107 // Default target might be conceptually valid, but disallow it to avoid | 10102 // Default target might be conceptually valid, but disallow it to avoid |
| 10108 // accidents. | 10103 // accidents. |
| 10109 TextureRef* texture_ref = GetTextureInfoForTargetUnlessDefault(target); | 10104 TextureRef* texture_ref = GetTextureInfoForTargetUnlessDefault(target); |
| 10110 if (!texture_ref) { | 10105 if (!texture_ref) { |
| 10111 LOCAL_SET_GL_ERROR( | 10106 LOCAL_SET_GL_ERROR( |
| 10112 GL_INVALID_OPERATION, | 10107 GL_INVALID_OPERATION, |
| 10113 "glBindTexImage2DCHROMIUM", "no texture bound"); | 10108 "glBindTexImage2DCHROMIUM", "no texture bound"); |
| 10114 return; | 10109 return; |
| 10115 } | 10110 } |
| 10116 | 10111 |
| 10117 gfx::GLImage* gl_image = image_manager()->LookupImage(image_id); | 10112 gfx::GLImage* gl_image = GetImage(image_id); |
| 10118 if (!gl_image) { | 10113 if (!gl_image) { |
| 10119 LOCAL_SET_GL_ERROR( | 10114 LOCAL_SET_GL_ERROR( |
| 10120 GL_INVALID_OPERATION, | 10115 GL_INVALID_OPERATION, |
| 10121 "glBindTexImage2DCHROMIUM", "no image found with the given ID"); | 10116 "glBindTexImage2DCHROMIUM", "no image found with the given ID"); |
| 10122 return; | 10117 return; |
| 10123 } | 10118 } |
| 10124 | 10119 |
| 10125 { | 10120 { |
| 10126 ScopedGLErrorSuppressor suppressor( | 10121 ScopedGLErrorSuppressor suppressor( |
| 10127 "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM", this); | 10122 "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM", this); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 10154 // Default target might be conceptually valid, but disallow it to avoid | 10149 // Default target might be conceptually valid, but disallow it to avoid |
| 10155 // accidents. | 10150 // accidents. |
| 10156 TextureRef* texture_ref = GetTextureInfoForTargetUnlessDefault(target); | 10151 TextureRef* texture_ref = GetTextureInfoForTargetUnlessDefault(target); |
| 10157 if (!texture_ref) { | 10152 if (!texture_ref) { |
| 10158 LOCAL_SET_GL_ERROR( | 10153 LOCAL_SET_GL_ERROR( |
| 10159 GL_INVALID_OPERATION, | 10154 GL_INVALID_OPERATION, |
| 10160 "glReleaseTexImage2DCHROMIUM", "no texture bound"); | 10155 "glReleaseTexImage2DCHROMIUM", "no texture bound"); |
| 10161 return; | 10156 return; |
| 10162 } | 10157 } |
| 10163 | 10158 |
| 10164 gfx::GLImage* gl_image = image_manager()->LookupImage(image_id); | 10159 gfx::GLImage* gl_image = GetImage(image_id); |
| 10165 if (!gl_image) { | 10160 if (!gl_image) { |
| 10166 LOCAL_SET_GL_ERROR( | 10161 LOCAL_SET_GL_ERROR( |
| 10167 GL_INVALID_OPERATION, | 10162 GL_INVALID_OPERATION, |
| 10168 "glReleaseTexImage2DCHROMIUM", "no image found with the given ID"); | 10163 "glReleaseTexImage2DCHROMIUM", "no image found with the given ID"); |
| 10169 return; | 10164 return; |
| 10170 } | 10165 } |
| 10171 | 10166 |
| 10172 // Do nothing when image is not currently bound. | 10167 // Do nothing when image is not currently bound. |
| 10173 if (texture_ref->texture()->GetLevelImage(target, 0) != gl_image) | 10168 if (texture_ref->texture()->GetLevelImage(target, 0) != gl_image) |
| 10174 return; | 10169 return; |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10503 return error::kNoError; | 10498 return error::kNoError; |
| 10504 } | 10499 } |
| 10505 | 10500 |
| 10506 // Include the auto-generated part of this file. We split this because it means | 10501 // Include the auto-generated part of this file. We split this because it means |
| 10507 // we can easily edit the non-auto generated parts right here in this file | 10502 // we can easily edit the non-auto generated parts right here in this file |
| 10508 // instead of having to edit some template or the code generator. | 10503 // instead of having to edit some template or the code generator. |
| 10509 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10504 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10510 | 10505 |
| 10511 } // namespace gles2 | 10506 } // namespace gles2 |
| 10512 } // namespace gpu | 10507 } // namespace gpu |
| OLD | NEW |