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

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

Issue 7623001: Rename and document glCommandBufferEnableCHROMIUM (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix stuff Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 19 matching lines...) Expand all
30 #include "gpu/command_buffer/service/framebuffer_manager.h" 30 #include "gpu/command_buffer/service/framebuffer_manager.h"
31 #include "gpu/command_buffer/service/gl_utils.h" 31 #include "gpu/command_buffer/service/gl_utils.h"
32 #include "gpu/command_buffer/service/gles2_cmd_validation.h" 32 #include "gpu/command_buffer/service/gles2_cmd_validation.h"
33 #include "gpu/command_buffer/service/program_manager.h" 33 #include "gpu/command_buffer/service/program_manager.h"
34 #include "gpu/command_buffer/service/renderbuffer_manager.h" 34 #include "gpu/command_buffer/service/renderbuffer_manager.h"
35 #include "gpu/command_buffer/service/shader_manager.h" 35 #include "gpu/command_buffer/service/shader_manager.h"
36 #include "gpu/command_buffer/service/shader_translator.h" 36 #include "gpu/command_buffer/service/shader_translator.h"
37 #include "gpu/command_buffer/service/surface_manager.h" 37 #include "gpu/command_buffer/service/surface_manager.h"
38 #include "gpu/command_buffer/service/texture_manager.h" 38 #include "gpu/command_buffer/service/texture_manager.h"
39 #include "gpu/command_buffer/service/vertex_attrib_manager.h" 39 #include "gpu/command_buffer/service/vertex_attrib_manager.h"
40 #include "gpu/GLES2/gles2_command_buffer.h"
41 #include "ui/gfx/gl/gl_context.h" 40 #include "ui/gfx/gl/gl_context.h"
42 #include "ui/gfx/gl/gl_implementation.h" 41 #include "ui/gfx/gl/gl_implementation.h"
43 #include "ui/gfx/gl/gl_surface.h" 42 #include "ui/gfx/gl/gl_surface.h"
44 43
45 #if !defined(GL_DEPTH24_STENCIL8) 44 #if !defined(GL_DEPTH24_STENCIL8)
46 #define GL_DEPTH24_STENCIL8 0x88F0 45 #define GL_DEPTH24_STENCIL8 0x88F0
47 #endif 46 #endif
48 47
49 namespace gpu { 48 namespace gpu {
50 namespace gles2 { 49 namespace gles2 {
(...skipping 6526 matching lines...) Expand 10 before | Expand all | Expand 10 after
6577 } 6576 }
6578 } 6577 }
6579 6578
6580 if (swap_buffers_callback_.get()) { 6579 if (swap_buffers_callback_.get()) {
6581 swap_buffers_callback_->Run(); 6580 swap_buffers_callback_->Run();
6582 } 6581 }
6583 6582
6584 return error::kNoError; 6583 return error::kNoError;
6585 } 6584 }
6586 6585
6587 error::Error GLES2DecoderImpl::HandleCommandBufferEnableCHROMIUM( 6586 error::Error GLES2DecoderImpl::HandleEnableFeatureCHROMIUM(
6588 uint32 immediate_data_size, const gles2::CommandBufferEnableCHROMIUM& c) { 6587 uint32 immediate_data_size, const gles2::EnableFeatureCHROMIUM& c) {
6589 Bucket* bucket = GetBucket(c.bucket_id); 6588 Bucket* bucket = GetBucket(c.bucket_id);
6590 typedef gles2::CommandBufferEnableCHROMIUM::Result Result; 6589 typedef gles2::EnableFeatureCHROMIUM::Result Result;
6591 Result* result = GetSharedMemoryAs<Result*>( 6590 Result* result = GetSharedMemoryAs<Result*>(
6592 c.result_shm_id, c.result_shm_offset, sizeof(*result)); 6591 c.result_shm_id, c.result_shm_offset, sizeof(*result));
6593 if (!result) { 6592 if (!result) {
6594 return error::kOutOfBounds; 6593 return error::kOutOfBounds;
6595 } 6594 }
6596 // Check that the client initialized the result. 6595 // Check that the client initialized the result.
6597 if (*result != 0) { 6596 if (*result != 0) {
6598 return error::kInvalidArguments; 6597 return error::kInvalidArguments;
6599 } 6598 }
6600 std::string feature_str; 6599 std::string feature_str;
6601 if (!bucket->GetAsString(&feature_str)) { 6600 if (!bucket->GetAsString(&feature_str)) {
6602 return error::kInvalidArguments; 6601 return error::kInvalidArguments;
6603 } 6602 }
6604 6603
6605 // TODO(gman): make this some kind of table to function pointer thingy. 6604 // TODO(gman): make this some kind of table to function pointer thingy.
6606 if (feature_str.compare(PEPPER3D_ALLOW_BUFFERS_ON_MULTIPLE_TARGETS) == 0) { 6605 if (feature_str.compare("pepper3d_allow_buffers_on_multiple_targets") == 0) {
6607 buffer_manager()->set_allow_buffers_on_multiple_targets(true); 6606 buffer_manager()->set_allow_buffers_on_multiple_targets(true);
6608 } else if (feature_str.compare(PEPPER3D_SUPPORT_FIXED_ATTRIBS) == 0) { 6607 } else if (feature_str.compare("pepper3d_support_fixed_attribs") == 0) {
6609 buffer_manager()->set_allow_buffers_on_multiple_targets(true); 6608 buffer_manager()->set_allow_buffers_on_multiple_targets(true);
6610 // TODO(gman): decide how to remove the need for this const_cast. 6609 // TODO(gman): decide how to remove the need for this const_cast.
6611 // I could make validators_ non const but that seems bad as this is the only 6610 // I could make validators_ non const but that seems bad as this is the only
6612 // place it is needed. I could make some special friend class of validators 6611 // place it is needed. I could make some special friend class of validators
6613 // just to allow this to set them. That seems silly. I could refactor this 6612 // just to allow this to set them. That seems silly. I could refactor this
6614 // code to use the extension mechanism or the initialization attributes to 6613 // code to use the extension mechanism or the initialization attributes to
6615 // turn this feature on. Given that the only real point of this is to make 6614 // turn this feature on. Given that the only real point of this is to make
6616 // the conformance tests pass and given that there is lots of real work that 6615 // the conformance tests pass and given that there is lots of real work that
6617 // needs to be done it seems like refactoring for one to one of those 6616 // needs to be done it seems like refactoring for one to one of those
6618 // methods is a very low priority. 6617 // methods is a very low priority.
6619 const_cast<Validators*>(validators_)->vertex_attrib_type.AddValue(GL_FIXED); 6618 const_cast<Validators*>(validators_)->vertex_attrib_type.AddValue(GL_FIXED);
6620 } else if (feature_str.compare(PEPPER3D_SKIP_GLSL_TRANSLATION) == 0) {
6621 use_shader_translator_ = false;
6622 } else { 6619 } else {
6623 return error::kNoError; 6620 return error::kNoError;
6624 } 6621 }
6625 6622
6626 *result = 1; // true. 6623 *result = 1; // true.
6627 return error::kNoError; 6624 return error::kNoError;
6628 } 6625 }
6629 6626
6630 error::Error GLES2DecoderImpl::HandleGetRequestableExtensionsCHROMIUM( 6627 error::Error GLES2DecoderImpl::HandleGetRequestableExtensionsCHROMIUM(
6631 uint32 immediate_data_size, 6628 uint32 immediate_data_size,
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
6791 return false; 6788 return false;
6792 } 6789 }
6793 6790
6794 // Include the auto-generated part of this file. We split this because it means 6791 // Include the auto-generated part of this file. We split this because it means
6795 // we can easily edit the non-auto generated parts right here in this file 6792 // we can easily edit the non-auto generated parts right here in this file
6796 // instead of having to edit some template or the code generator. 6793 // instead of having to edit some template or the code generator.
6797 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 6794 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
6798 6795
6799 } // namespace gles2 6796 } // namespace gles2
6800 } // namespace gpu 6797 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_utils.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698