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

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

Issue 1894313002: Removed implementation of CHROMIUM_subscribe_uniform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed a couple more mus/ references Created 4 years, 8 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 <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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "gpu/command_buffer/service/mailbox_manager.h" 49 #include "gpu/command_buffer/service/mailbox_manager.h"
50 #include "gpu/command_buffer/service/memory_tracking.h" 50 #include "gpu/command_buffer/service/memory_tracking.h"
51 #include "gpu/command_buffer/service/path_manager.h" 51 #include "gpu/command_buffer/service/path_manager.h"
52 #include "gpu/command_buffer/service/program_manager.h" 52 #include "gpu/command_buffer/service/program_manager.h"
53 #include "gpu/command_buffer/service/query_manager.h" 53 #include "gpu/command_buffer/service/query_manager.h"
54 #include "gpu/command_buffer/service/renderbuffer_manager.h" 54 #include "gpu/command_buffer/service/renderbuffer_manager.h"
55 #include "gpu/command_buffer/service/sampler_manager.h" 55 #include "gpu/command_buffer/service/sampler_manager.h"
56 #include "gpu/command_buffer/service/shader_manager.h" 56 #include "gpu/command_buffer/service/shader_manager.h"
57 #include "gpu/command_buffer/service/shader_translator.h" 57 #include "gpu/command_buffer/service/shader_translator.h"
58 #include "gpu/command_buffer/service/texture_manager.h" 58 #include "gpu/command_buffer/service/texture_manager.h"
59 #include "gpu/command_buffer/service/valuebuffer_manager.h"
60 #include "gpu/command_buffer/service/vertex_array_manager.h" 59 #include "gpu/command_buffer/service/vertex_array_manager.h"
61 #include "gpu/command_buffer/service/vertex_attrib_manager.h" 60 #include "gpu/command_buffer/service/vertex_attrib_manager.h"
62 #include "third_party/smhasher/src/City.h" 61 #include "third_party/smhasher/src/City.h"
63 #include "ui/gfx/geometry/point.h" 62 #include "ui/gfx/geometry/point.h"
64 #include "ui/gfx/geometry/rect.h" 63 #include "ui/gfx/geometry/rect.h"
65 #include "ui/gfx/geometry/size.h" 64 #include "ui/gfx/geometry/size.h"
66 #include "ui/gfx/overlay_transform.h" 65 #include "ui/gfx/overlay_transform.h"
67 #include "ui/gfx/transform.h" 66 #include "ui/gfx/transform.h"
68 #include "ui/gl/gl_bindings.h" 67 #include "ui/gl/gl_bindings.h"
69 #include "ui/gl/gl_context.h" 68 #include "ui/gl/gl_context.h"
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 627
629 void ClearAllAttributes() const override; 628 void ClearAllAttributes() const override;
630 void RestoreAllAttributes() const override; 629 void RestoreAllAttributes() const override;
631 630
632 QueryManager* GetQueryManager() override { return query_manager_.get(); } 631 QueryManager* GetQueryManager() override { return query_manager_.get(); }
633 VertexArrayManager* GetVertexArrayManager() override { 632 VertexArrayManager* GetVertexArrayManager() override {
634 return vertex_array_manager_.get(); 633 return vertex_array_manager_.get();
635 } 634 }
636 ImageManager* GetImageManager() override { return image_manager_.get(); } 635 ImageManager* GetImageManager() override { return image_manager_.get(); }
637 636
638 ValuebufferManager* GetValuebufferManager() override {
639 return valuebuffer_manager();
640 }
641
642 bool HasPendingQueries() const override; 637 bool HasPendingQueries() const override;
643 void ProcessPendingQueries(bool did_finish) override; 638 void ProcessPendingQueries(bool did_finish) override;
644 639
645 bool HasMoreIdleWork() const override; 640 bool HasMoreIdleWork() const override;
646 void PerformIdleWork() override; 641 void PerformIdleWork() override;
647 642
648 void WaitForReadPixels(base::Closure callback) override; 643 void WaitForReadPixels(base::Closure callback) override;
649 644
650 Logger* GetLogger() override; 645 Logger* GetLogger() override;
651 646
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 731
737 // Helpers for the glGen and glDelete functions. 732 // Helpers for the glGen and glDelete functions.
738 bool GenTexturesHelper(GLsizei n, const GLuint* client_ids); 733 bool GenTexturesHelper(GLsizei n, const GLuint* client_ids);
739 void DeleteTexturesHelper(GLsizei n, const GLuint* client_ids); 734 void DeleteTexturesHelper(GLsizei n, const GLuint* client_ids);
740 bool GenBuffersHelper(GLsizei n, const GLuint* client_ids); 735 bool GenBuffersHelper(GLsizei n, const GLuint* client_ids);
741 void DeleteBuffersHelper(GLsizei n, const GLuint* client_ids); 736 void DeleteBuffersHelper(GLsizei n, const GLuint* client_ids);
742 bool GenFramebuffersHelper(GLsizei n, const GLuint* client_ids); 737 bool GenFramebuffersHelper(GLsizei n, const GLuint* client_ids);
743 void DeleteFramebuffersHelper(GLsizei n, const GLuint* client_ids); 738 void DeleteFramebuffersHelper(GLsizei n, const GLuint* client_ids);
744 bool GenRenderbuffersHelper(GLsizei n, const GLuint* client_ids); 739 bool GenRenderbuffersHelper(GLsizei n, const GLuint* client_ids);
745 void DeleteRenderbuffersHelper(GLsizei n, const GLuint* client_ids); 740 void DeleteRenderbuffersHelper(GLsizei n, const GLuint* client_ids);
746 bool GenValuebuffersCHROMIUMHelper(GLsizei n, const GLuint* client_ids);
747 void DeleteValuebuffersCHROMIUMHelper(GLsizei n, const GLuint* client_ids);
748 bool GenQueriesEXTHelper(GLsizei n, const GLuint* client_ids); 741 bool GenQueriesEXTHelper(GLsizei n, const GLuint* client_ids);
749 void DeleteQueriesEXTHelper(GLsizei n, const GLuint* client_ids); 742 void DeleteQueriesEXTHelper(GLsizei n, const GLuint* client_ids);
750 bool GenVertexArraysOESHelper(GLsizei n, const GLuint* client_ids); 743 bool GenVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
751 void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* client_ids); 744 void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
752 bool GenPathsCHROMIUMHelper(GLuint first_client_id, GLsizei range); 745 bool GenPathsCHROMIUMHelper(GLuint first_client_id, GLsizei range);
753 bool DeletePathsCHROMIUMHelper(GLuint first_client_id, GLsizei range); 746 bool DeletePathsCHROMIUMHelper(GLuint first_client_id, GLsizei range);
754 bool GenSamplersHelper(GLsizei n, const GLuint* client_ids); 747 bool GenSamplersHelper(GLsizei n, const GLuint* client_ids);
755 void DeleteSamplersHelper(GLsizei n, const GLuint* client_ids); 748 void DeleteSamplersHelper(GLsizei n, const GLuint* client_ids);
756 749
757 // Workarounds 750 // Workarounds
758 void OnFboChanged() const; 751 void OnFboChanged() const;
759 void OnUseFramebuffer() const; 752 void OnUseFramebuffer() const;
760 753
761 error::ContextLostReason GetContextLostReasonFromResetStatus( 754 error::ContextLostReason GetContextLostReasonFromResetStatus(
762 GLenum reset_status) const; 755 GLenum reset_status) const;
763 756
764 // TODO(gman): Cache these pointers? 757 // TODO(gman): Cache these pointers?
765 BufferManager* buffer_manager() { 758 BufferManager* buffer_manager() {
766 return group_->buffer_manager(); 759 return group_->buffer_manager();
767 } 760 }
768 761
769 RenderbufferManager* renderbuffer_manager() { 762 RenderbufferManager* renderbuffer_manager() {
770 return group_->renderbuffer_manager(); 763 return group_->renderbuffer_manager();
771 } 764 }
772 765
773 FramebufferManager* framebuffer_manager() { 766 FramebufferManager* framebuffer_manager() {
774 return group_->framebuffer_manager(); 767 return group_->framebuffer_manager();
775 } 768 }
776 769
777 ValuebufferManager* valuebuffer_manager() {
778 return group_->valuebuffer_manager();
779 }
780
781 ProgramManager* program_manager() { 770 ProgramManager* program_manager() {
782 return group_->program_manager(); 771 return group_->program_manager();
783 } 772 }
784 773
785 SamplerManager* sampler_manager() { 774 SamplerManager* sampler_manager() {
786 return group_->sampler_manager(); 775 return group_->sampler_manager();
787 } 776 }
788 777
789 ShaderManager* shader_manager() { 778 ShaderManager* shader_manager() {
790 return group_->shader_manager(); 779 return group_->shader_manager();
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 TextureRef* texture_ref, 1008 TextureRef* texture_ref,
1020 GLenum target, 1009 GLenum target,
1021 const GLbyte* data); 1010 const GLbyte* data);
1022 1011
1023 void EnsureTextureForClientId(GLenum target, GLuint client_id); 1012 void EnsureTextureForClientId(GLenum target, GLuint client_id);
1024 void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key); 1013 void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key);
1025 void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key, 1014 void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key,
1026 GLuint client_id); 1015 GLuint client_id);
1027 void DoApplyScreenSpaceAntialiasingCHROMIUM(); 1016 void DoApplyScreenSpaceAntialiasingCHROMIUM();
1028 1017
1029 bool DoIsValuebufferCHROMIUM(GLuint client_id);
1030 void DoBindValueBufferCHROMIUM(GLenum target, GLuint valuebuffer);
1031 void DoSubscribeValueCHROMIUM(GLenum target, GLenum subscription);
1032 void DoPopulateSubscribedValuesCHROMIUM(GLenum target);
1033 void DoUniformValueBufferCHROMIUM(GLint location,
1034 GLenum target,
1035 GLenum subscription);
1036
1037 void DoBindTexImage2DCHROMIUM( 1018 void DoBindTexImage2DCHROMIUM(
1038 GLenum target, 1019 GLenum target,
1039 GLint image_id); 1020 GLint image_id);
1040 void DoReleaseTexImage2DCHROMIUM( 1021 void DoReleaseTexImage2DCHROMIUM(
1041 GLenum target, 1022 GLenum target,
1042 GLint image_id); 1023 GLint image_id);
1043 1024
1044 void DoTraceEndCHROMIUM(void); 1025 void DoTraceEndCHROMIUM(void);
1045 1026
1046 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs); 1027 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 // Gets the renderbuffer info for the given renderbuffer. 1161 // Gets the renderbuffer info for the given renderbuffer.
1181 Renderbuffer* GetRenderbuffer(GLuint client_id) { 1162 Renderbuffer* GetRenderbuffer(GLuint client_id) {
1182 return renderbuffer_manager()->GetRenderbuffer(client_id); 1163 return renderbuffer_manager()->GetRenderbuffer(client_id);
1183 } 1164 }
1184 1165
1185 // Removes the renderbuffer info for the given renderbuffer. 1166 // Removes the renderbuffer info for the given renderbuffer.
1186 void RemoveRenderbuffer(GLuint client_id) { 1167 void RemoveRenderbuffer(GLuint client_id) {
1187 renderbuffer_manager()->RemoveRenderbuffer(client_id); 1168 renderbuffer_manager()->RemoveRenderbuffer(client_id);
1188 } 1169 }
1189 1170
1190 // Creates a valuebuffer info for the given valuebuffer.
1191 void CreateValuebuffer(GLuint client_id) {
1192 return valuebuffer_manager()->CreateValuebuffer(client_id);
1193 }
1194
1195 // Gets the valuebuffer info for a given valuebuffer.
1196 Valuebuffer* GetValuebuffer(GLuint client_id) {
1197 return valuebuffer_manager()->GetValuebuffer(client_id);
1198 }
1199
1200 // Removes the valuebuffer info for the given valuebuffer.
1201 void RemoveValuebuffer(GLuint client_id) {
1202 valuebuffer_manager()->RemoveValuebuffer(client_id);
1203 }
1204
1205 // Gets the vertex attrib manager for the given vertex array. 1171 // Gets the vertex attrib manager for the given vertex array.
1206 VertexAttribManager* GetVertexAttribManager(GLuint client_id) { 1172 VertexAttribManager* GetVertexAttribManager(GLuint client_id) {
1207 VertexAttribManager* info = 1173 VertexAttribManager* info =
1208 vertex_array_manager()->GetVertexAttribManager(client_id); 1174 vertex_array_manager()->GetVertexAttribManager(client_id);
1209 return info; 1175 return info;
1210 } 1176 }
1211 1177
1212 // Removes the vertex attrib manager for the given vertex array. 1178 // Removes the vertex attrib manager for the given vertex array.
1213 void RemoveVertexAttribManager(GLuint client_id) { 1179 void RemoveVertexAttribManager(GLuint client_id) {
1214 vertex_array_manager()->RemoveVertexAttribManager(client_id); 1180 vertex_array_manager()->RemoveVertexAttribManager(client_id);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 bool CheckFramebufferValid( 1281 bool CheckFramebufferValid(
1316 Framebuffer* framebuffer, 1282 Framebuffer* framebuffer,
1317 GLenum target, 1283 GLenum target,
1318 bool clear_uncleared_images, 1284 bool clear_uncleared_images,
1319 const char* func_name); 1285 const char* func_name);
1320 1286
1321 bool CheckBoundDrawFramebufferValid( 1287 bool CheckBoundDrawFramebufferValid(
1322 bool clear_uncleared_images, const char* func_name); 1288 bool clear_uncleared_images, const char* func_name);
1323 bool CheckBoundReadFramebufferValid(const char* func_name); 1289 bool CheckBoundReadFramebufferValid(const char* func_name);
1324 1290
1325 // Check if the current valuebuffer exists and is valid. If not generates
1326 // the appropriate GL error. Returns true if the current valuebuffer is in
1327 // a usable state.
1328 bool CheckCurrentValuebuffer(const char* function_name);
1329
1330 // Check if the current valuebuffer exists and is valiud and that the
1331 // value buffer is actually subscribed to the given subscription
1332 bool CheckCurrentValuebufferForSubscription(GLenum subscription,
1333 const char* function_name);
1334
1335 // Check if the location can be used for the given subscription target. If not
1336 // generates the appropriate GL error. Returns true if the location is usable
1337 bool CheckSubscriptionTarget(GLint location,
1338 GLenum subscription,
1339 const char* function_name);
1340
1341 // Checks if the current program exists and is valid. If not generates the 1291 // Checks if the current program exists and is valid. If not generates the
1342 // appropriate GL error. Returns true if the current program is in a usable 1292 // appropriate GL error. Returns true if the current program is in a usable
1343 // state. 1293 // state.
1344 bool CheckCurrentProgram(const char* function_name); 1294 bool CheckCurrentProgram(const char* function_name);
1345 1295
1346 // Checks if the current program exists and is valid and that location is not 1296 // Checks if the current program exists and is valid and that location is not
1347 // -1. If the current program is not valid generates the appropriate GL 1297 // -1. If the current program is not valid generates the appropriate GL
1348 // error. Returns true if the current program is in a usable state and 1298 // error. Returns true if the current program is in a usable state and
1349 // location is not -1. 1299 // location is not -1.
1350 bool CheckCurrentProgramForUniform(GLint location, const char* function_name); 1300 bool CheckCurrentProgramForUniform(GLint location, const char* function_name);
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
3076 3026
3077 // Set all the default state because some GL drivers get it wrong. 3027 // Set all the default state because some GL drivers get it wrong.
3078 state_.InitCapabilities(NULL); 3028 state_.InitCapabilities(NULL);
3079 state_.InitState(NULL); 3029 state_.InitState(NULL);
3080 glActiveTexture(GL_TEXTURE0 + state_.active_texture_unit); 3030 glActiveTexture(GL_TEXTURE0 + state_.active_texture_unit);
3081 3031
3082 DoBindBuffer(GL_ARRAY_BUFFER, 0); 3032 DoBindBuffer(GL_ARRAY_BUFFER, 0);
3083 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); 3033 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
3084 DoBindFramebuffer(GL_FRAMEBUFFER, 0); 3034 DoBindFramebuffer(GL_FRAMEBUFFER, 0);
3085 DoBindRenderbuffer(GL_RENDERBUFFER, 0); 3035 DoBindRenderbuffer(GL_RENDERBUFFER, 0);
3086 DoBindValueBufferCHROMIUM(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, 0);
3087 3036
3088 bool call_gl_clear = !surfaceless_; 3037 bool call_gl_clear = !surfaceless_;
3089 #if defined(OS_ANDROID) 3038 #if defined(OS_ANDROID)
3090 // Temporary workaround for Android WebView because this clear ignores the 3039 // Temporary workaround for Android WebView because this clear ignores the
3091 // clip and corrupts that external UI of the App. Not calling glClear is ok 3040 // clip and corrupts that external UI of the App. Not calling glClear is ok
3092 // because the system already clears the buffer before each draw. Proper 3041 // because the system already clears the buffer before each draw. Proper
3093 // fix might be setting the scissor clip properly before initialize. See 3042 // fix might be setting the scissor clip properly before initialize. See
3094 // crbug.com/259023 for details. 3043 // crbug.com/259023 for details.
3095 call_gl_clear = surface_->GetHandle(); 3044 call_gl_clear = surface_->GetHandle();
3096 #endif 3045 #endif
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
3478 } 3427 }
3479 } 3428 }
3480 std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); 3429 std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
3481 glGenRenderbuffersEXT(n, service_ids.get()); 3430 glGenRenderbuffersEXT(n, service_ids.get());
3482 for (GLsizei ii = 0; ii < n; ++ii) { 3431 for (GLsizei ii = 0; ii < n; ++ii) {
3483 CreateRenderbuffer(client_ids[ii], service_ids[ii]); 3432 CreateRenderbuffer(client_ids[ii], service_ids[ii]);
3484 } 3433 }
3485 return true; 3434 return true;
3486 } 3435 }
3487 3436
3488 bool GLES2DecoderImpl::GenValuebuffersCHROMIUMHelper(GLsizei n,
3489 const GLuint* client_ids) {
3490 for (GLsizei ii = 0; ii < n; ++ii) {
3491 if (GetValuebuffer(client_ids[ii])) {
3492 return false;
3493 }
3494 }
3495 for (GLsizei ii = 0; ii < n; ++ii) {
3496 CreateValuebuffer(client_ids[ii]);
3497 }
3498 return true;
3499 }
3500
3501 bool GLES2DecoderImpl::GenTexturesHelper(GLsizei n, const GLuint* client_ids) { 3437 bool GLES2DecoderImpl::GenTexturesHelper(GLsizei n, const GLuint* client_ids) {
3502 for (GLsizei ii = 0; ii < n; ++ii) { 3438 for (GLsizei ii = 0; ii < n; ++ii) {
3503 if (GetTexture(client_ids[ii])) { 3439 if (GetTexture(client_ids[ii])) {
3504 return false; 3440 return false;
3505 } 3441 }
3506 } 3442 }
3507 std::unique_ptr<GLuint[]> service_ids(new GLuint[n]); 3443 std::unique_ptr<GLuint[]> service_ids(new GLuint[n]);
3508 glGenTextures(n, service_ids.get()); 3444 glGenTextures(n, service_ids.get());
3509 for (GLsizei ii = 0; ii < n; ++ii) { 3445 for (GLsizei ii = 0; ii < n; ++ii) {
3510 CreateTexture(client_ids[ii], service_ids[ii]); 3446 CreateTexture(client_ids[ii], service_ids[ii]);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
3633 framebuffer_state_.bound_draw_framebuffer 3569 framebuffer_state_.bound_draw_framebuffer
3634 ->UnbindRenderbuffer(GL_FRAMEBUFFER, renderbuffer); 3570 ->UnbindRenderbuffer(GL_FRAMEBUFFER, renderbuffer);
3635 } 3571 }
3636 } 3572 }
3637 framebuffer_state_.clear_state_dirty = true; 3573 framebuffer_state_.clear_state_dirty = true;
3638 RemoveRenderbuffer(client_ids[ii]); 3574 RemoveRenderbuffer(client_ids[ii]);
3639 } 3575 }
3640 } 3576 }
3641 } 3577 }
3642 3578
3643 void GLES2DecoderImpl::DeleteValuebuffersCHROMIUMHelper(
3644 GLsizei n,
3645 const GLuint* client_ids) {
3646 for (GLsizei ii = 0; ii < n; ++ii) {
3647 Valuebuffer* valuebuffer = GetValuebuffer(client_ids[ii]);
3648 if (valuebuffer) {
3649 if (state_.bound_valuebuffer.get() == valuebuffer) {
3650 state_.bound_valuebuffer = NULL;
3651 }
3652 RemoveValuebuffer(client_ids[ii]);
3653 }
3654 }
3655 }
3656
3657 void GLES2DecoderImpl::DeleteTexturesHelper( 3579 void GLES2DecoderImpl::DeleteTexturesHelper(
3658 GLsizei n, const GLuint* client_ids) { 3580 GLsizei n, const GLuint* client_ids) {
3659 bool supports_separate_framebuffer_binds = 3581 bool supports_separate_framebuffer_binds =
3660 features().chromium_framebuffer_multisample; 3582 features().chromium_framebuffer_multisample;
3661 for (GLsizei ii = 0; ii < n; ++ii) { 3583 for (GLsizei ii = 0; ii < n; ++ii) {
3662 TextureRef* texture_ref = GetTexture(client_ids[ii]); 3584 TextureRef* texture_ref = GetTexture(client_ids[ii]);
3663 if (texture_ref) { 3585 if (texture_ref) {
3664 Texture* texture = texture_ref->texture(); 3586 Texture* texture = texture_ref->texture();
3665 if (texture->IsAttachedToFramebuffer()) { 3587 if (texture->IsAttachedToFramebuffer()) {
3666 framebuffer_state_.clear_state_dirty = true; 3588 framebuffer_state_.clear_state_dirty = true;
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
4119 state_.bound_array_buffer = NULL; 4041 state_.bound_array_buffer = NULL;
4120 state_.bound_copy_read_buffer = NULL; 4042 state_.bound_copy_read_buffer = NULL;
4121 state_.bound_copy_write_buffer = NULL; 4043 state_.bound_copy_write_buffer = NULL;
4122 state_.bound_pixel_pack_buffer = NULL; 4044 state_.bound_pixel_pack_buffer = NULL;
4123 state_.bound_pixel_unpack_buffer = NULL; 4045 state_.bound_pixel_unpack_buffer = NULL;
4124 state_.bound_transform_feedback_buffer = NULL; 4046 state_.bound_transform_feedback_buffer = NULL;
4125 state_.bound_uniform_buffer = NULL; 4047 state_.bound_uniform_buffer = NULL;
4126 framebuffer_state_.bound_read_framebuffer = NULL; 4048 framebuffer_state_.bound_read_framebuffer = NULL;
4127 framebuffer_state_.bound_draw_framebuffer = NULL; 4049 framebuffer_state_.bound_draw_framebuffer = NULL;
4128 state_.bound_renderbuffer = NULL; 4050 state_.bound_renderbuffer = NULL;
4129 state_.bound_valuebuffer = NULL;
4130 4051
4131 if (offscreen_saved_color_texture_info_.get()) { 4052 if (offscreen_saved_color_texture_info_.get()) {
4132 DCHECK(offscreen_target_color_texture_); 4053 DCHECK(offscreen_target_color_texture_);
4133 DCHECK_EQ(offscreen_saved_color_texture_info_->service_id(), 4054 DCHECK_EQ(offscreen_saved_color_texture_info_->service_id(),
4134 offscreen_saved_color_texture_->id()); 4055 offscreen_saved_color_texture_->id());
4135 offscreen_saved_color_texture_->Invalidate(); 4056 offscreen_saved_color_texture_->Invalidate();
4136 offscreen_saved_color_texture_info_ = NULL; 4057 offscreen_saved_color_texture_info_ = NULL;
4137 } 4058 }
4138 if (have_context) { 4059 if (have_context) {
4139 if (copy_texture_CHROMIUM_.get()) { 4060 if (copy_texture_CHROMIUM_.get()) {
(...skipping 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after
7242 if (!texture) { 7163 if (!texture) {
7243 LOCAL_SET_GL_ERROR( 7164 LOCAL_SET_GL_ERROR(
7244 GL_INVALID_VALUE, "glTexParameteriv", "unknown texture"); 7165 GL_INVALID_VALUE, "glTexParameteriv", "unknown texture");
7245 return; 7166 return;
7246 } 7167 }
7247 7168
7248 texture_manager()->SetParameteri( 7169 texture_manager()->SetParameteri(
7249 "glTexParameteriv", GetErrorState(), texture, pname, *params); 7170 "glTexParameteriv", GetErrorState(), texture, pname, *params);
7250 } 7171 }
7251 7172
7252 bool GLES2DecoderImpl::CheckCurrentValuebuffer(const char* function_name) {
7253 if (!state_.bound_valuebuffer.get()) {
7254 // There is no valuebuffer bound
7255 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
7256 "no valuebuffer in use");
7257 return false;
7258 }
7259 return true;
7260 }
7261
7262 bool GLES2DecoderImpl::CheckCurrentValuebufferForSubscription(
7263 GLenum subscription,
7264 const char* function_name) {
7265 if (!CheckCurrentValuebuffer(function_name)) {
7266 return false;
7267 }
7268 if (!state_.bound_valuebuffer.get()->IsSubscribed(subscription)) {
7269 // The valuebuffer is not subscribed to the target
7270 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
7271 "valuebuffer is not subscribed");
7272 return false;
7273 }
7274 return true;
7275 }
7276
7277 bool GLES2DecoderImpl::CheckSubscriptionTarget(GLint location,
7278 GLenum subscription,
7279 const char* function_name) {
7280 if (!CheckCurrentProgramForUniform(location, function_name)) {
7281 return false;
7282 }
7283 GLint real_location = -1;
7284 GLint array_index = -1;
7285 const Program::UniformInfo* info =
7286 state_.current_program->GetUniformInfoByFakeLocation(
7287 location, &real_location, &array_index);
7288 if (!info) {
7289 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "unknown location");
7290 return false;
7291 }
7292 if ((ValuebufferManager::ApiTypeForSubscriptionTarget(subscription) &
7293 info->accepts_api_type) == 0) {
7294 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
7295 "wrong type for subscription");
7296 return false;
7297 }
7298 return true;
7299 }
7300
7301 bool GLES2DecoderImpl::CheckCurrentProgram(const char* function_name) { 7173 bool GLES2DecoderImpl::CheckCurrentProgram(const char* function_name) {
7302 if (!state_.current_program.get()) { 7174 if (!state_.current_program.get()) {
7303 // The program does not exist. 7175 // The program does not exist.
7304 LOCAL_SET_GL_ERROR( 7176 LOCAL_SET_GL_ERROR(
7305 GL_INVALID_OPERATION, function_name, "no program in use"); 7177 GL_INVALID_OPERATION, function_name, "no program in use");
7306 return false; 7178 return false;
7307 } 7179 }
7308 if (!state_.current_program->InUse()) { 7180 if (!state_.current_program->InUse()) {
7309 LOCAL_SET_GL_ERROR( 7181 LOCAL_SET_GL_ERROR(
7310 GL_INVALID_OPERATION, function_name, "program not linked"); 7182 GL_INVALID_OPERATION, function_name, "program not linked");
(...skipping 7477 matching lines...) Expand 10 before | Expand all | Expand 10 after
14788 texture_ref = texture_manager()->Consume(client_id, texture); 14660 texture_ref = texture_manager()->Consume(client_id, texture);
14789 } 14661 }
14790 14662
14791 void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() { 14663 void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() {
14792 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the 14664 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the
14793 // color attachments of currently bound draw framebuffer. 14665 // color attachments of currently bound draw framebuffer.
14794 // Reference GL_INTEL_framebuffer_CMAA for details. 14666 // Reference GL_INTEL_framebuffer_CMAA for details.
14795 glApplyFramebufferAttachmentCMAAINTEL(); 14667 glApplyFramebufferAttachmentCMAAINTEL();
14796 } 14668 }
14797 14669
14798 bool GLES2DecoderImpl::DoIsValuebufferCHROMIUM(GLuint client_id) {
14799 const Valuebuffer* valuebuffer = GetValuebuffer(client_id);
14800 return valuebuffer && valuebuffer->IsValid();
14801 }
14802
14803 void GLES2DecoderImpl::DoBindValueBufferCHROMIUM(GLenum target,
14804 GLuint client_id) {
14805 Valuebuffer* valuebuffer = NULL;
14806 if (client_id != 0) {
14807 valuebuffer = GetValuebuffer(client_id);
14808 if (!valuebuffer) {
14809 if (!group_->bind_generates_resource()) {
14810 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBindValuebufferCHROMIUM",
14811 "id not generated by glBindValuebufferCHROMIUM");
14812 return;
14813 }
14814
14815 // It's a new id so make a valuebuffer for it.
14816 CreateValuebuffer(client_id);
14817 valuebuffer = GetValuebuffer(client_id);
14818 }
14819 valuebuffer->MarkAsValid();
14820 }
14821 state_.bound_valuebuffer = valuebuffer;
14822 }
14823
14824 void GLES2DecoderImpl::DoSubscribeValueCHROMIUM(GLenum target,
14825 GLenum subscription) {
14826 if (!CheckCurrentValuebuffer("glSubscribeValueCHROMIUM")) {
14827 return;
14828 }
14829 state_.bound_valuebuffer.get()->AddSubscription(subscription);
14830 }
14831
14832 void GLES2DecoderImpl::DoPopulateSubscribedValuesCHROMIUM(GLenum target) {
14833 if (!CheckCurrentValuebuffer("glPopulateSubscribedValuesCHROMIUM")) {
14834 return;
14835 }
14836 valuebuffer_manager()->UpdateValuebufferState(state_.bound_valuebuffer.get());
14837 }
14838
14839 void GLES2DecoderImpl::DoUniformValueBufferCHROMIUM(GLint location,
14840 GLenum target,
14841 GLenum subscription) {
14842 if (!CheckCurrentValuebufferForSubscription(
14843 subscription, "glPopulateSubscribedValuesCHROMIUM")) {
14844 return;
14845 }
14846 if (!CheckSubscriptionTarget(location, subscription,
14847 "glPopulateSubscribedValuesCHROMIUM")) {
14848 return;
14849 }
14850 const ValueState* state =
14851 state_.bound_valuebuffer.get()->GetState(subscription);
14852 if (state) {
14853 switch (subscription) {
14854 case GL_MOUSE_POSITION_CHROMIUM:
14855 DoUniform2iv(location, 1, state->int_value);
14856 break;
14857 default:
14858 NOTREACHED() << "Unhandled uniform subscription target "
14859 << subscription;
14860 break;
14861 }
14862 }
14863 }
14864
14865 void GLES2DecoderImpl::DoInsertEventMarkerEXT( 14670 void GLES2DecoderImpl::DoInsertEventMarkerEXT(
14866 GLsizei length, const GLchar* marker) { 14671 GLsizei length, const GLchar* marker) {
14867 if (!marker) { 14672 if (!marker) {
14868 marker = ""; 14673 marker = "";
14869 } 14674 }
14870 debug_marker_manager_.SetMarker( 14675 debug_marker_manager_.SetMarker(
14871 length ? std::string(marker, length) : std::string(marker)); 14676 length ? std::string(marker, length) : std::string(marker));
14872 } 14677 }
14873 14678
14874 void GLES2DecoderImpl::DoPushGroupMarkerEXT( 14679 void GLES2DecoderImpl::DoPushGroupMarkerEXT(
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
16512 } 16317 }
16513 16318
16514 // Include the auto-generated part of this file. We split this because it means 16319 // Include the auto-generated part of this file. We split this because it means
16515 // we can easily edit the non-auto generated parts right here in this file 16320 // we can easily edit the non-auto generated parts right here in this file
16516 // instead of having to edit some template or the code generator. 16321 // instead of having to edit some template or the code generator.
16517 #include "base/macros.h" 16322 #include "base/macros.h"
16518 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 16323 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
16519 16324
16520 } // namespace gles2 16325 } // namespace gles2
16521 } // namespace gpu 16326 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.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