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_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 "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
10 #include "gpu/command_buffer/client/id_allocator.h" | 10 #include "gpu/command_buffer/client/id_allocator.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 uint32 result_shm_offset() const { | 56 uint32 result_shm_offset() const { |
57 return result_shm_offset_; | 57 return result_shm_offset_; |
58 } | 58 } |
59 | 59 |
60 // Gets the value of the result. | 60 // Gets the value of the result. |
61 template <typename T> | 61 template <typename T> |
62 T GetResultAs() const { | 62 T GetResultAs() const { |
63 return *static_cast<T*>(result_buffer_); | 63 return *static_cast<T*>(result_buffer_); |
64 } | 64 } |
65 | 65 |
| 66 // Copies the result. |
| 67 void CopyResult(void* dst); |
| 68 |
66 // Waits for all commands to execute. | 69 // Waits for all commands to execute. |
67 void WaitForCmd(); | 70 void WaitForCmd(); |
68 | 71 |
69 // The maxiumum result size from simple GL get commands. | 72 // The maxiumum result size from simple GL get commands. |
70 static const size_t kMaxSizeOfSimpleResult = 4 * sizeof(uint32); // NOLINT. | 73 static const size_t kMaxSizeOfSimpleResult = 4 * sizeof(uint32); // NOLINT. |
71 | 74 |
72 GLES2Util util_; | 75 GLES2Util util_; |
73 GLES2CmdHelper* helper_; | 76 GLES2CmdHelper* helper_; |
74 IdAllocator id_allocator_; | 77 IdAllocator id_allocator_; |
75 FencedAllocatorWrapper transfer_buffer_; | 78 FencedAllocatorWrapper transfer_buffer_; |
76 int transfer_buffer_id_; | 79 int transfer_buffer_id_; |
77 void* result_buffer_; | 80 void* result_buffer_; |
78 uint32 result_shm_offset_; | 81 uint32 result_shm_offset_; |
79 | 82 |
80 // pack alignment as last set by glPixelStorei | 83 // pack alignment as last set by glPixelStorei |
81 GLint pack_alignment_; | 84 GLint pack_alignment_; |
82 | 85 |
83 // unpack alignment as last set by glPixelStorei | 86 // unpack alignment as last set by glPixelStorei |
84 GLint unpack_alignment_; | 87 GLint unpack_alignment_; |
85 | 88 |
86 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); | 89 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); |
87 }; | 90 }; |
88 | 91 |
89 | 92 |
90 } // namespace gles2 | 93 } // namespace gles2 |
91 } // namespace gpu | 94 } // namespace gpu |
92 | 95 |
93 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 96 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
94 | 97 |
OLD | NEW |