| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COMMON_COMMAND_BUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
| 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
| 7 | 7 |
| 8 #include "../common/buffer.h" | 8 #include "../common/buffer.h" |
| 9 #include "../common/constants.h" | 9 #include "../common/constants.h" |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // empty and there is no error). | 73 // empty and there is no error). |
| 74 virtual State FlushSync(int32 put_offset) = 0; | 74 virtual State FlushSync(int32 put_offset) = 0; |
| 75 | 75 |
| 76 // Sets the current get offset. This can be called from any thread. | 76 // Sets the current get offset. This can be called from any thread. |
| 77 virtual void SetGetOffset(int32 get_offset) = 0; | 77 virtual void SetGetOffset(int32 get_offset) = 0; |
| 78 | 78 |
| 79 // Create a transfer buffer and return a handle that uniquely | 79 // Create a transfer buffer and return a handle that uniquely |
| 80 // identifies it or -1 on error. | 80 // identifies it or -1 on error. |
| 81 virtual int32 CreateTransferBuffer(size_t size) = 0; | 81 virtual int32 CreateTransferBuffer(size_t size) = 0; |
| 82 | 82 |
| 83 // Register an existing shared memory object and get an ID that can be used |
| 84 // to identify it in the command buffer. Callee dups the handle until |
| 85 // DestroyTransferBuffer is called. |
| 86 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, |
| 87 size_t size) = 0; |
| 88 |
| 83 // Destroy a transfer buffer and recycle the handle. | 89 // Destroy a transfer buffer and recycle the handle. |
| 84 virtual void DestroyTransferBuffer(int32 id) = 0; | 90 virtual void DestroyTransferBuffer(int32 id) = 0; |
| 85 | 91 |
| 86 // Get the transfer buffer associated with a handle. | 92 // Get the transfer buffer associated with a handle. |
| 87 virtual Buffer GetTransferBuffer(int32 handle) = 0; | 93 virtual Buffer GetTransferBuffer(int32 handle) = 0; |
| 88 | 94 |
| 89 // Allows the reader to update the current token value. | 95 // Allows the reader to update the current token value. |
| 90 virtual void SetToken(int32 token) = 0; | 96 virtual void SetToken(int32 token) = 0; |
| 91 | 97 |
| 92 // Allows the reader to set the current parse error. | 98 // Allows the reader to set the current parse error. |
| 93 virtual void SetParseError(error::Error) = 0; | 99 virtual void SetParseError(error::Error) = 0; |
| 94 | 100 |
| 95 private: | 101 private: |
| 96 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); | 102 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); |
| 97 }; | 103 }; |
| 98 | 104 |
| 99 } // namespace gpu | 105 } // namespace gpu |
| 100 | 106 |
| 101 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 107 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
| OLD | NEW |