| 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_SERVICE_COMMON_DECODER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> |
| 12 #include <stack> | 13 #include <stack> |
| 13 #include <string> | 14 #include <string> |
| 15 |
| 14 #include "base/macros.h" | 16 #include "base/macros.h" |
| 15 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "gpu/command_buffer/common/buffer.h" | 18 #include "gpu/command_buffer/common/buffer.h" |
| 18 #include "gpu/command_buffer/service/cmd_parser.h" | 19 #include "gpu/command_buffer/service/cmd_parser.h" |
| 19 #include "gpu/gpu_export.h" | 20 #include "gpu/gpu_export.h" |
| 20 | 21 |
| 21 // Forwardly declare a few GL types to avoid including GL header files. | 22 // Forwardly declare a few GL types to avoid including GL header files. |
| 22 typedef int GLsizei; | 23 typedef int GLsizei; |
| 23 typedef int GLint; | 24 typedef int GLint; |
| 24 | 25 |
| 25 namespace gpu { | 26 namespace gpu { |
| 26 | 27 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 std::vector<char*>* _string, | 98 std::vector<char*>* _string, |
| 98 std::vector<GLint>* _length); | 99 std::vector<GLint>* _length); |
| 99 | 100 |
| 100 private: | 101 private: |
| 101 bool OffsetSizeValid(size_t offset, size_t size) const { | 102 bool OffsetSizeValid(size_t offset, size_t size) const { |
| 102 size_t temp = offset + size; | 103 size_t temp = offset + size; |
| 103 return temp <= size_ && temp >= offset; | 104 return temp <= size_ && temp >= offset; |
| 104 } | 105 } |
| 105 | 106 |
| 106 size_t size_; | 107 size_t size_; |
| 107 ::scoped_ptr<int8_t[]> data_; | 108 ::std::unique_ptr<int8_t[]> data_; |
| 108 | 109 |
| 109 DISALLOW_COPY_AND_ASSIGN(Bucket); | 110 DISALLOW_COPY_AND_ASSIGN(Bucket); |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 CommonDecoder(); | 113 CommonDecoder(); |
| 113 ~CommonDecoder() override; | 114 ~CommonDecoder() override; |
| 114 | 115 |
| 115 // Sets the engine, to get shared memory buffers from, and to set the token | 116 // Sets the engine, to get shared memory buffers from, and to set the token |
| 116 // to. | 117 // to. |
| 117 void set_engine(CommandBufferEngine* engine) { | 118 void set_engine(CommandBufferEngine* engine) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 195 |
| 195 // A table of CommandInfo for all the commands. | 196 // A table of CommandInfo for all the commands. |
| 196 static const CommandInfo command_info[]; | 197 static const CommandInfo command_info[]; |
| 197 | 198 |
| 198 }; | 199 }; |
| 199 | 200 |
| 200 } // namespace gpu | 201 } // namespace gpu |
| 201 | 202 |
| 202 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 203 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
| 203 | 204 |
| OLD | NEW |