| 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 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| 7 | 7 |
| 8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "gles2_impl_export.h" | 17 #include "gles2_impl_export.h" |
| 18 #include "gpu/command_buffer/client/buffer_tracker.h" | 18 #include "gpu/command_buffer/client/buffer_tracker.h" |
| 19 #include "gpu/command_buffer/client/client_context_state.h" | 19 #include "gpu/command_buffer/client/client_context_state.h" |
| 20 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 20 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 21 #include "gpu/command_buffer/client/gles2_interface.h" | 21 #include "gpu/command_buffer/client/gles2_interface.h" |
| 22 #include "gpu/command_buffer/client/gpu_memory_buffer_tracker.h" | 22 #include "gpu/command_buffer/client/gpu_memory_buffer_tracker.h" |
| 23 #include "gpu/command_buffer/client/image_factory.h" | |
| 24 #include "gpu/command_buffer/client/query_tracker.h" | 23 #include "gpu/command_buffer/client/query_tracker.h" |
| 25 #include "gpu/command_buffer/client/ref_counted.h" | 24 #include "gpu/command_buffer/client/ref_counted.h" |
| 26 #include "gpu/command_buffer/client/ring_buffer.h" | 25 #include "gpu/command_buffer/client/ring_buffer.h" |
| 27 #include "gpu/command_buffer/client/share_group.h" | 26 #include "gpu/command_buffer/client/share_group.h" |
| 28 #include "gpu/command_buffer/common/compiler_specific.h" | 27 #include "gpu/command_buffer/common/compiler_specific.h" |
| 29 #include "gpu/command_buffer/common/debug_marker_manager.h" | 28 #include "gpu/command_buffer/common/debug_marker_manager.h" |
| 30 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 29 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 31 | 30 |
| 32 #if !defined(NDEBUG) && !defined(__native_client__) && !defined(GLES2_CONFORMANC
E_TESTS) // NOLINT | 31 #if !defined(NDEBUG) && !defined(__native_client__) && !defined(GLES2_CONFORMANC
E_TESTS) // NOLINT |
| 33 #if defined(GLES2_INLINE_OPTIMIZATION) | 32 #if defined(GLES2_INLINE_OPTIMIZATION) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 (ptr[0] == static_cast<type>(0) || ptr[0] == static_cast<type>(-1))); | 90 (ptr[0] == static_cast<type>(0) || ptr[0] == static_cast<type>(-1))); |
| 92 | 91 |
| 93 #define GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(type, ptr) \ | 92 #define GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(type, ptr) \ |
| 94 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION_ASSERT(!ptr || \ | 93 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION_ASSERT(!ptr || \ |
| 95 (ptr[0] == static_cast<type>(0) || ptr[0] == static_cast<type>(-1))); | 94 (ptr[0] == static_cast<type>(0) || ptr[0] == static_cast<type>(-1))); |
| 96 | 95 |
| 97 struct GLUniformDefinitionCHROMIUM; | 96 struct GLUniformDefinitionCHROMIUM; |
| 98 | 97 |
| 99 namespace gpu { | 98 namespace gpu { |
| 100 | 99 |
| 100 class GpuControl; |
| 101 class MappedMemoryManager; | 101 class MappedMemoryManager; |
| 102 class ScopedTransferBufferPtr; | 102 class ScopedTransferBufferPtr; |
| 103 class TransferBufferInterface; | 103 class TransferBufferInterface; |
| 104 | 104 |
| 105 namespace gles2 { | 105 namespace gles2 { |
| 106 | 106 |
| 107 class ImageFactory; | 107 class ImageFactory; |
| 108 class VertexArrayObjectManager; | 108 class VertexArrayObjectManager; |
| 109 | 109 |
| 110 // This class emulates GLES2 over command buffers. It can be used by a client | 110 // This class emulates GLES2 over command buffers. It can be used by a client |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 static const GLuint kClientSideElementArrayId = 0xFEDCBA99u; | 170 static const GLuint kClientSideElementArrayId = 0xFEDCBA99u; |
| 171 | 171 |
| 172 // Number of swap buffers allowed before waiting. | 172 // Number of swap buffers allowed before waiting. |
| 173 static const size_t kMaxSwapBuffers = 2; | 173 static const size_t kMaxSwapBuffers = 2; |
| 174 | 174 |
| 175 GLES2Implementation( | 175 GLES2Implementation( |
| 176 GLES2CmdHelper* helper, | 176 GLES2CmdHelper* helper, |
| 177 ShareGroup* share_group, | 177 ShareGroup* share_group, |
| 178 TransferBufferInterface* transfer_buffer, | 178 TransferBufferInterface* transfer_buffer, |
| 179 bool bind_generates_resource, | 179 bool bind_generates_resource, |
| 180 ImageFactory* image_factory); | 180 GpuControl* gpu_control); |
| 181 | 181 |
| 182 virtual ~GLES2Implementation(); | 182 virtual ~GLES2Implementation(); |
| 183 | 183 |
| 184 bool Initialize( | 184 bool Initialize( |
| 185 unsigned int starting_transfer_buffer_size, | 185 unsigned int starting_transfer_buffer_size, |
| 186 unsigned int min_transfer_buffer_size, | 186 unsigned int min_transfer_buffer_size, |
| 187 unsigned int max_transfer_buffer_size); | 187 unsigned int max_transfer_buffer_size); |
| 188 | 188 |
| 189 // The GLES2CmdHelper being used by this GLES2Implementation. You can use | 189 // The GLES2CmdHelper being used by this GLES2Implementation. You can use |
| 190 // this to issue cmds at a lower level for certain kinds of optimization. | 190 // this to issue cmds at a lower level for certain kinds of optimization. |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 QueryTracker::Query* current_query_; | 661 QueryTracker::Query* current_query_; |
| 662 | 662 |
| 663 scoped_ptr<BufferTracker> buffer_tracker_; | 663 scoped_ptr<BufferTracker> buffer_tracker_; |
| 664 | 664 |
| 665 scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_; | 665 scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_; |
| 666 | 666 |
| 667 ErrorMessageCallback* error_message_callback_; | 667 ErrorMessageCallback* error_message_callback_; |
| 668 | 668 |
| 669 scoped_ptr<std::string> current_trace_name_; | 669 scoped_ptr<std::string> current_trace_name_; |
| 670 | 670 |
| 671 ImageFactory* image_factory_; | 671 GpuControl* gpu_control_; |
| 672 | 672 |
| 673 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); | 673 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); |
| 674 }; | 674 }; |
| 675 | 675 |
| 676 inline bool GLES2Implementation::GetBufferParameterivHelper( | 676 inline bool GLES2Implementation::GetBufferParameterivHelper( |
| 677 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 677 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
| 678 return false; | 678 return false; |
| 679 } | 679 } |
| 680 | 680 |
| 681 inline bool GLES2Implementation::GetFramebufferAttachmentParameterivHelper( | 681 inline bool GLES2Implementation::GetFramebufferAttachmentParameterivHelper( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 703 | 703 |
| 704 inline bool GLES2Implementation::GetTexParameterivHelper( | 704 inline bool GLES2Implementation::GetTexParameterivHelper( |
| 705 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 705 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
| 706 return false; | 706 return false; |
| 707 } | 707 } |
| 708 | 708 |
| 709 } // namespace gles2 | 709 } // namespace gles2 |
| 710 } // namespace gpu | 710 } // namespace gpu |
| 711 | 711 |
| 712 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 712 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| OLD | NEW |